Import upstream MIO changes

This commit is contained in:
Colomban Wendling 2011-12-25 18:39:01 +01:00
parent 387d071b60
commit d76d72518a
2 changed files with 36 additions and 1 deletions

View File

@ -18,6 +18,16 @@
*
*/
/* Hack to force ANSI compliance by not using va_copy() even if present.
* This relies on the fact G_VA_COPY is maybe defined as va_copy in
* glibconfig.h, so we undef it, but gutils.h takes care of defining a
* compiler-specific implementation if not already defined.
* This needs to come before any other GLib inclusion. */
#ifdef MIO_FORCE_ANSI
# include <glibconfig.h>
# undef G_VA_COPY
#endif
#include "mio.h"
#include "mio-file.c"
#include "mio-memory.c"
@ -30,6 +40,31 @@
/**
* SECTION:mio
* @short_description: The MIO object
* @include: mio/mio.h
*
* The #MIO object replicates the C file I/O API with support of both standard
* file based operations and in-memory operations. Its goal is to ease the port
* of an application that uses C file I/O API to perform in-memory operations.
*
* A #MIO object is created using mio_new_file() or mio_new_memory(), depending
* on whether you want file or in-memory operations, and destroyed using
* mio_free(). There is also some other convenient API to create file-based
* #MIO objects for more complex cases, such as mio_new_file_full() and
* mio_new_fp().
*
* Once the #MIO object is created, you can perform standard I/O operations on
* it transparently without the need to care about the effective underlying
* operations.
*
* The I/O API is almost exactly a replication of the standard C file I/O API
* with the significant difference that the first parameter is always the #MIO
* object to work on.
*/
/**
* mio_new_file_full:
* @filename: Filename to open, passed as-is to @open_func as the first argument

View File

@ -93,7 +93,7 @@ struct _MIOPos {
#endif
union {
fpos_t file;
size_t mem;
gsize mem;
} impl;
};