2023-01-07 10:39:15 +00:00
|
|
|
/* stdio.h: Standard input/output. */
|
2023-01-06 19:02:07 +00:00
|
|
|
|
2023-01-06 12:31:14 +00:00
|
|
|
#ifndef _STDIO_H
|
|
|
|
#define _STDIO_H
|
|
|
|
|
2023-01-06 16:35:07 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int __unused;
|
|
|
|
} FILE;
|
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
|
|
|
|
extern FILE* stderr;
|
|
|
|
#define stderr stderr
|
|
|
|
|
2023-01-06 12:31:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2023-01-06 16:35:07 +00:00
|
|
|
int fflush(FILE*);
|
|
|
|
|
|
|
|
FILE* fopen(const char*, const char*);
|
|
|
|
int fclose(FILE*);
|
|
|
|
|
|
|
|
size_t fread(void*, size_t, size_t, FILE*);
|
|
|
|
size_t fwrite(const void*, size_t, size_t, FILE*);
|
|
|
|
|
|
|
|
int fseek(FILE*, long, int);
|
|
|
|
long ftell(FILE*);
|
|
|
|
|
|
|
|
void setbuf(FILE*, char*);
|
|
|
|
|
|
|
|
int fprintf(FILE*, const char*, ...);
|
|
|
|
int vfprintf(FILE*, const char*, va_list);
|
2023-01-06 19:15:43 +00:00
|
|
|
|
|
|
|
/* Write formatted output into a buffer. */
|
|
|
|
int sprintf(char* buf, const char* format, ...);
|
|
|
|
|
|
|
|
/* Write up to max bytes of formatted output into a buffer. */
|
|
|
|
int snprintf(char* buf, size_t max, const char* format, ...);
|
|
|
|
|
|
|
|
/* Write formatted output into a buffer. */
|
|
|
|
int vsprintf(char*, const char*, va_list);
|
|
|
|
|
|
|
|
/* Write up to max bytes of formatted output into a buffer. */
|
|
|
|
int vsnprintf(char*, size_t, const char*, va_list);
|
2023-01-06 16:35:07 +00:00
|
|
|
|
2023-01-07 00:49:26 +00:00
|
|
|
/* Write formatted output to standard output. */
|
|
|
|
int printf(const char*, ...);
|
|
|
|
|
|
|
|
/* Write a string followed by a newline to standard output. */
|
|
|
|
int puts(const char* s);
|
|
|
|
|
2023-01-06 19:02:07 +00:00
|
|
|
/* Output a message to the console. */
|
2023-01-07 00:49:26 +00:00
|
|
|
int console_write(const char* msg, size_t size);
|
2023-01-06 12:31:14 +00:00
|
|
|
|
2023-01-13 20:08:10 +00:00
|
|
|
/* Write an error message to standard error. */
|
|
|
|
void perror(const char* s);
|
|
|
|
|
2023-01-06 12:31:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|