Download Server/Loader User Manual
Transcript
fwrite size_t fwrite(void *ptr, size_t size, size_t nobj,FILE *s); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib fwrite writes nobj objects each of size characters in length from the memory pointed to by ptr to the specified stream. It returns the number of characters successfully written. Zero is returned if end of file is encountered or if an error occurs. NOTE: The size of 'C4x objects may vary from the size of objects on the host machine. 'C4x types are all 32bits in size (floats are 40 bits in size), and therefore the size of an int or a character is 4 bytes. getc int getc(FILE *stream); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib getc returns the next character from the specified stream. It is implemented as a macro. It returns EOF is an end of file is encountered or if a read error occurs. getchar int getchar(void); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib getchar is identical to getc(stdin). It returns the next character from the stdin stream. It is implemented as a macro. It returns EOF if an end of file is encountered or if a read error occurs. gets char *gets(char *s); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib gets reads a string from stdin stream to str. The string read is terminated by a newline character, which is replaced in str by a NUL character. If an end of file is encountered or an error occurs the function returns NULL else it returns its argument. perror void perror(char *str); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib perror prints a textual message to the stderr stream, according to the value of the global variable errno. The string argument str is first printed if it is not a null pointer, and is then followed by a colon and a space. The output is then appended by a message that corresponds to the value of errno. printf int printf(char *format, ...); TI C4x Library: stdio_xx.lib TI C6x Library: stioxxxx.lib printf writes output to the stdout stream. It returns the number of characters which have been written to the output stream, or returns a negative value if an error occurred. The arguments have the same meaning as those for the function fprintf. 100 HUNT ENGINEERING Server/Loader USER MANUAL