Calling C function with file handles

new topic     » topic index » view thread      » older message » newer message

A function in bz2lib.dll

typedef void BZFILE;

   BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f,
                            int small, int verbosity,
                            void *unused, int nUnused );

Description:

To make the library a little simpler and more portable,
BZ2_bzReadOpen and BZ2_bzWriteOpen require you to pass them file
handles (FILE*s) which have previously been opened for reading or
writing respectively. That avoids portability problems associated
with file operations and file attributes, whilst not being much of
an
imposition on the programmer.

The FILE* arguments passed to BZ2_bzReadOpen/BZ2_bzWriteOpen should
be set to binary mode. Most Unix systems will do this by default,
but
other platforms, including Windows and Mac, will not. If you omit
this, you may encounter problems when moving code to new platforms.

How can I convert the function to call in euphoria?
Because of the "FILE *f" it is file handle.
It is not the value returned by open(), isn't it?

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu