#ifndef _STDIO_UTIL_H_b20d21bf_ #define _STDIO_UTIL_H_b20d21bf_ #include /* * Open an accumulator. Stuff written to the FILE * gets accumulated. * When it's closed, the accumulated string is written through the * char ** argument and the length is written through the int * * argument. * * If an argument is nil, that item is not stored. (Both may be nil, * but then it's not very useful, except possibly as a FILE * that * just sinks data without doing anything with it.) */ extern FILE *open_accum(char **, int *); /* * Open a list of strings for reading. The arglist consists of * alternating data pointers and lengths; a length may be OSR_STRLEN * to indicate that the relevant length is what strlen returns on the * given pointer. The arglist must be terminated with a `pointer' of * OSR_END; this does not have a length value following it. * * OSR_STRLEN can be anything that can't be a real length. My first * tendency is to use -1, but that is too likely to occur by accident. * Note that the length used is the length as of the time * open_strings_r is called; if the string is changed before it gets * read, the original length is the one that will be used. */ extern FILE *open_strings_r(const char *, ...); extern const char open_strings_r_end; #define OSR_STRLEN (-12345) #define OSR_END (&open_strings_r_end) #endif