#ifndef WH_STDIO_UTIL_H_2a7d12a7_ #define WH_STDIO_UTIL_H_2a7d12a7_ /* * APIs exported by stdio-util.c. These are, of course, stdio utility * routines. */ #include /* * Open a stream which accumulates stuff written; when it's closed, the * accumulated string is written through the char ** passed to * fopenmalloc(), with its length written through the int *. Either * pointer (or both, though that's not very useful) may be nil, to not * return that datum. One NUL is appended automatically (but not * included in the length value) as a convenience for uses that want a * C-style NUL-terminated string. * * The stream does not support reading or seeking. */ extern FILE *fopenmalloc(char **, int *); /* * Open a stream which writes into a provided buffer, described by * pointer-and-length arguments. If the buffer fills up, any further * output attempts fail. One NUL is always appended, so the point at * which output data is lost is actually one octet less than the * specified length (the last octet gets the NUL). It is an error for * the length to be less than 1. */ extern FILE *fopensw(char *, int); #endif