0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
fmemopen.h File Reference

Go to the source code of this file.

Functions

FILE * fmemopen (void *buf, size_t size, const char *mode)
 A BSD port of the fmemopen Linux method using funopen. More...
 

Function Documentation

FILE* fmemopen ( void *  buf,
size_t  size,
const char *  mode 
)

A BSD port of the fmemopen Linux method using funopen.

man docs for fmemopen: http://linux.die.net/man/3/fmemopen

man docs for funopen: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/funopen.3.html

This method is ported from ingenuitas' python-tesseract project.

You must call fclose on the returned file pointer or memory will be leaked.

Parameters
bufThe data that will be used to back the FILE* methods. Must be at least size bytes.
sizeThe size of the buf data.
modeThe permitted stream operation modes.
Returns
A pointer that can be used in the fread/fwrite/fseek/fclose family of methods. If a failure occurred NULL will be returned.

Definition at line 94 of file fmemopen.c.