| stdio.h | Header File

Header File Index

ANSI-compatible file and TTY input/output routines

Functions

cbprintf
  Callback printing function.
cbscanf
  Callback parsing function.
clearerr
  Resets error indication.
clrscr
  Clears the screen and resets the print position.
fclose
  Closes a stream.
feof
  Tests a stream for an end-of-file indicator.
ferror
  Tests a stream for a read or write error.
fflush
  Flushes a stream.
fgetc
  Function version of fgetc.
fgetchar
  Function version of getchar.
fgetpos
  Gets the current file pointer position.
fgets
  Gets a string from a stream.
fopen
  Opens a stream.
fprintf
  Sends formatted output to a stream.
fputc
  Function version of fputc.
fputchar
  Function version of putchar.
fputs
  Outputs a string to a stream.
fread
  Reads data from a stream.
freopen
  Associates a new file with an open stream.
fscanf
  File parsing function.
fseek
  Repositions the file pointer of a stream.
fsetbufsize
  Sets the buffer size of a file.
fsetpos
  Positions the file pointer of a stream.
ftell
  Returns the current file pointer.
fwrite
  Writes data to a stream.
getc
  Gets a character from a stream.
getchar
  Gets a character from the keyboard (with echoing to the screen).
gets
  Gets a string from the keyboard.
getsn
  Gets a string from the keyboard avoiding buffer overflows.
printf_xy
  Sends formatted output to the fixed place on the screen.
printf
  Sends formatted output to the screen.
putc
  Writes a character to a stream.
putchar
  Outputs a character to the screen in TTY mode.
puts
  Outputs a string to the screen in TTY mode.
remove
  Macro that removes a file.
rename
  Renames a file.
rewind
  Repositions file pointer to stream's beginning.
scanf
  Console input parsing function.
sprintf
  Sends formatted output to a string.
sscanf
  String parsing function.
strerror
  Gives an error message string.
strputchar
  Default vcbprintf callback function used in sprintf.
tmpnam
  Produces a unique random file name.
ungetc
  Pushes a character back into input stream.
unlink
  Deletes a file.
vcbprintf
  Virtual callback printing function.
vcbscanf
  Virtual callback parsing function.
vfprintf
  Sends formatted output to a stream using argument list.
vfscanf
  File parsing function using argument list.
vprintf
  Sends formatted output to the screen using argument list.
vscanf
  Console input parsing function using argument list.
vsprintf
  Sends formatted output to a string using argument list.
vsscanf
  String parsing function using argument list.

Constants

EOF
  Indicates that the end of a file has been reached.
NULL
  A null-pointer value.
TMP_MAX
  Contains the maximum number of temporary file names.

Predefined Types

FILE
  A structure describing an opened file.
FileFlags
  An enumeration describing internal flags for file handling.
fpos_t
  A type describing the current position in a file.
SeekModes
  An enumeration for describing possible modes used in fseek.
size_t
  A type to define sizes of strings and memory blocks.
va_list
  A void pointer which can be interpreted as an argument list.
vcbprintf_Callback_t
  Describes a callback function for vcbprintf.
vcbscanf_get_Callback_t
  Describes the first callback function for vcbscanf.
vcbscanf_unget_Callback_t
  Describes the second callback function for vcbscanf.

Note: This implementation of stdio.h is 90% compatible with the ANSI standard. I tried to make all functions to be as close to ANSI as possible, without introducing a too large overload in the generated code. The main difference is the fact that there are no terminal-associated file streams like stdin and stdout which may be redirected. However, functions from this header file are mostly not TIOS functions - they are completely written by us, so they are not embedded in the TIOS. That's why their use may cause your program to be larger than if you don't use functions from this header file. The typical increase in size is 300-2000 bytes, depending on which functions and how many different functions from this header file are used in the program. Functions from the scanf family are the worst offenders, using any of them takes about 1500 bytes. So, although functions from this header file are much more "standard" than TIOS-specific functions, it is better to avoid functions like fopen etc. Instead, use "non-standard" functions from the vat.h header file. Also avoid using scanf family functions if you don't really have to. Prefer getsn for input, and atoi family functions for parsing. Of course, functions from this header file may be very useful for porting a program from a "standard" computer to the TI. But I will repeat again: it is better to avoid them.