vcbscanf Function* (tigcc.a)

stdio.h

short vcbscanf (vcbscanf_get_Callback_t getfun, vcbscanf_unget_Callback_t ungetfun, void *param, const char *format, va_list arglist);

Virtual callback parsing function.

vcbscanf is an auxiliary function which is the heart of all scanf family functions. arglist is a pointer to the list of arguments (see stdarg.h for more info about argument lists), and format is the format string, as usually (see sscanf). vcbscanf gets its characters using the getfun callback. If it reads a character it can't handle, it ungets it using the ungetfun callback. Also, the parameter param of vcbscanf is passed as the second parameter to the callback function. This allows for much more flexibility, because a callback function usually needs more info than a simple character to be processed. The callback function for example can get characters from to a stream, so in this case param would probably be a pointer to the stream structure. The formatted data is parsed according to the format string, as described for sscanf.


Used by: vfscanf, vsscanf