libc: Document the functions in stdio.h
This commit is contained in:
parent
ffc223c2cf
commit
6aabe19fb4
@ -13,8 +13,8 @@ typedef struct
|
|||||||
int f_err;
|
int f_err;
|
||||||
} FILE;
|
} FILE;
|
||||||
|
|
||||||
extern FILE* __stderr;
|
extern FILE* __stderr; // The standard error stream.
|
||||||
extern FILE* __stdout;
|
extern FILE* __stdout; // The standard output stream.
|
||||||
#define stderr __stderr
|
#define stderr __stderr
|
||||||
#define stdout __stdout
|
#define stdout __stdout
|
||||||
|
|
||||||
@ -22,31 +22,80 @@ extern FILE* __stdout;
|
|||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
int fclose(FILE*);
|
|
||||||
int fflush(FILE*);
|
/* Closes the file handle stream. */
|
||||||
FILE* fopen(const char*, const char*);
|
int fclose(FILE* stream);
|
||||||
int fprintf(FILE*, const char*, ...);
|
|
||||||
size_t fread(void*, size_t, size_t, FILE*);
|
/* Does not do anything for now, since buffered IO is not implemented yet. */
|
||||||
|
int fflush(FILE* stream);
|
||||||
|
|
||||||
|
/* Opens the file at pathname according to the mode string. Returns the file handle on success, or NULL on error. */
|
||||||
|
FILE* fopen(const char* pathname, const char* mode);
|
||||||
|
|
||||||
|
/* Writes formatted output according to the string format to the file stream. */
|
||||||
|
int fprintf(FILE* stream, const char* format, ...);
|
||||||
|
|
||||||
|
/* Reads nmemb items of size size from the file stream into buf. */
|
||||||
|
size_t fread(void* buf, size_t size, size_t nmemb, FILE* stream);
|
||||||
|
|
||||||
int fseek(FILE*, long, int); // Not implemented.
|
int fseek(FILE*, long, int); // Not implemented.
|
||||||
long ftell(FILE*); // Not implemented.
|
long ftell(FILE*); // Not implemented.
|
||||||
size_t fwrite(const void*, size_t, size_t, FILE*);
|
|
||||||
int ferror(FILE*);
|
/* Writes nmemb items of size size from buf into the file stream. */
|
||||||
int feof(FILE*);
|
size_t fwrite(const void* buf, size_t size, size_t nmemb, FILE* stream);
|
||||||
void clearerr(FILE*);
|
|
||||||
|
/* Returns nonzero if the error flag in stream was set. */
|
||||||
|
int ferror(FILE* stream);
|
||||||
|
|
||||||
|
/* Returns nonzero if the end-of-file flag in stream was set. */
|
||||||
|
int feof(FILE* stream);
|
||||||
|
|
||||||
|
/* Clears the error and end-of-file flags from stream. */
|
||||||
|
void clearerr(FILE* stream);
|
||||||
|
|
||||||
void setbuf(FILE*, char*); // Not implemented.
|
void setbuf(FILE*, char*); // Not implemented.
|
||||||
int vfprintf(FILE*, const char*, va_list);
|
|
||||||
int printf(const char*, ...);
|
/* Writes formatted output according to the string format to the file stream. */
|
||||||
int vprintf(const char*, va_list);
|
int vfprintf(FILE* stream, const char* format, va_list ap);
|
||||||
int sprintf(char*, const char*, ...);
|
|
||||||
int snprintf(char*, size_t, const char*, ...);
|
/* Writes formatted output according to the string format to standard output. */
|
||||||
int vsprintf(char*, const char*, va_list);
|
int printf(const char* format, ...);
|
||||||
int vsnprintf(char*, size_t, const char*, va_list);
|
|
||||||
int puts(const char*);
|
/* Writes formatted output according to the string format to standard output. */
|
||||||
int fputs(const char*, FILE*);
|
int vprintf(const char* format, va_list ap);
|
||||||
int fputc(int, FILE*);
|
|
||||||
int putc(int, FILE*);
|
/* Writes formatted output according to the string format to the string str. This function is unsafe, use snprintf
|
||||||
int putchar(int);
|
* instead. */
|
||||||
void perror(const char*);
|
int sprintf(char* str, const char* format, ...);
|
||||||
|
|
||||||
|
/* Writes at most max bytes of formatted output according to the string format to the string str.*/
|
||||||
|
int snprintf(char* str, size_t max, const char* format, ...);
|
||||||
|
|
||||||
|
/* Writes formatted output according to the string format to the string str. This function is unsafe, use vsnprintf
|
||||||
|
* instead. */
|
||||||
|
int vsprintf(char* str, const char* format, va_list ap);
|
||||||
|
|
||||||
|
/* Writes at most max bytes of formatted output according to the string format to the string str. */
|
||||||
|
int vsnprintf(char* str, size_t max, const char* format, va_list ap);
|
||||||
|
|
||||||
|
/* Writes the string str followed by a trailing newline to stdout. */
|
||||||
|
int puts(const char* str);
|
||||||
|
|
||||||
|
/* Writes the string str to the file stream. */
|
||||||
|
int fputs(const char* str, FILE* stream);
|
||||||
|
|
||||||
|
/* Writes the character c to the file stream. */
|
||||||
|
int fputc(int c, FILE* stream);
|
||||||
|
|
||||||
|
/* Writes the character c to the file stream. */
|
||||||
|
int putc(int c, FILE* stream);
|
||||||
|
|
||||||
|
/* Writes the character c to standard output. */
|
||||||
|
int putchar(int c);
|
||||||
|
|
||||||
|
/* Prints a message to standard error consisting of the string str followed by a colon and the string representation
|
||||||
|
* of the last error encountered during a call to a system or library function. */
|
||||||
|
void perror(const char* str);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user