Download avr-libc Reference Manual
Transcript
6.8 <stdio.h>: Standard IO facilities 6.8.2.10 54 #define FDEV_SETUP_STREAM(put, get, rwflag) Initializer for a user-supplied stdio stream. This macro acts similar to fdev_setup_stream(), but it is to be used as the initializer of a variable of type FILE. The remaining arguments are to be used as explained in fdev_setup_stream(). 6.8.2.11 #define fdev_setup_stream(stream, put, get, rwflag) Setup a user-supplied buffer as an stdio stream. This macro takes a user-supplied buffer stream, and sets it up as a stream that is valid for stdio operations, similar to one that has been obtained dynamically from fdevopen(). The buffer to setup must be of type FILE. The arguments put and get are identical to those that need to be passed to fdevopen(). The rwflag argument can take one of the values _FDEV_SETUP_READ, _FDEV_SETUP_WRITE, or _FDEV_SETUP_RW, for read, write, or read/write intent, respectively. Note: No assignments to the standard streams will be performed by fdev_setup_stream(). If standard streams are to be used, these need to be assigned by the user. See also under Running stdio without malloc(). 6.8.2.12 #define FILE struct __file FILE is the opaque structure that is passed around between the various standard IO functions. 6.8.2.13 #define getc(__stream) fgetc(__stream) The macro getc used to be a "fast" macro implementation with a functionality identical to fgetc(). For space constraints, in avr-libc, it is just an alias for fgetc. 6.8.2.14 #define getchar(void) fgetc(stdin) The macro getchar reads a character from stdin. Return values and error handling is identical to fgetc(). 6.8.2.15 #define putc(__c, __stream) fputc(__c, __stream) Generated on Tue May 15 14:56:11 2007 for avr-libc by Doxygen