lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Luiz Henrique de Figueiredo once stated:
> > then I found out about the various extentions that the GNU C library provides
> 
> For the lazy among us, could you please summarize those extensions or
> point to a document? Thanks.

  I found out about them by going through stdio.h under Linux, and doing a
man on the functions found therein.  For instance:

NAME
       fmemopen, open_memstream, open_wmemstream -  open memory as stream

SYNOPSIS
       #define _GNU_SOURCE
       #include <stdio.h>

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

       FILE *open_memstream(char **ptr, size_t *sizeloc);

       #define _GNU_SOURCE
       #include <wchar.h>

       FILE *open_wmemstream(wchar_t **ptr, size_t *sizeloc);

DESCRIPTION
       The  fmemopen()  function opens a stream that permits the access speci‐
       fied by mode.  The stream allows I/O to be performed on the  string or
       memory  buffer  pointed  to  by buf.  This buffer must be at least size
       bytes long.

	...

NAME
       fopencookie - opening a custom stream

SYNOPSIS
       #define _GNU_SOURCE
       #include <stdio.h>

       FILE *fopencookie(void *cookie, const char *mode,
                         cookie_io_functions_t io_funcs);

DESCRIPTION
       The  fopencookie()  function  allows  the programmer to create a custom
       implementation for a standard  I/O  stream.   This  implementation can
       store the stream's data at a location of its own choosing; for example,
       fopencookie() is used to implement fmemopen(3), which provides a stream
       interface to data that is stored in a buffer in memory.

	...

  There's more at
http://www.gnu.org/software/libc/manual/html_mono/libc.html (warning:  huge
file) but it does describe not only the standard functions, but other
functions than the GNU C library provides (including the above).

  -spc (And that covers the library calls---the GNU C compiler has any
	number of extentions as well ... )