2011-02-12 05:22:29 +00:00
|
|
|
#ifndef _STDIO_H
|
|
|
|
#define _STDIO_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __NEED_FILE
|
|
|
|
#define __NEED_va_list
|
|
|
|
#define __NEED_size_t
|
2011-02-14 10:10:10 +00:00
|
|
|
|
|
|
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
2012-05-23 01:52:08 +00:00
|
|
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
|
|
|
|| defined(_BSD_SOURCE)
|
2011-02-12 05:22:29 +00:00
|
|
|
#define __NEED_ssize_t
|
|
|
|
#define __NEED_off_t
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
|
|
|
#undef NULL
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define NULL 0
|
|
|
|
#else
|
|
|
|
#define NULL ((void*)0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef EOF
|
|
|
|
#define EOF (-1)
|
|
|
|
|
|
|
|
#undef SEEK_SET
|
|
|
|
#undef SEEK_CUR
|
|
|
|
#undef SEEK_END
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
|
|
|
|
|
|
|
#define _IOFBF 0
|
|
|
|
#define _IOLBF 1
|
|
|
|
#define _IONBF 2
|
|
|
|
|
2011-02-16 00:47:22 +00:00
|
|
|
#define BUFSIZ 1024
|
|
|
|
#define FILENAME_MAX 4095
|
|
|
|
#define FOPEN_MAX 1000
|
|
|
|
#define TMP_MAX 10000
|
|
|
|
#define L_tmpnam 20
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
typedef union {
|
|
|
|
char __opaque[16];
|
|
|
|
double __align;
|
|
|
|
} fpos_t;
|
|
|
|
|
|
|
|
extern FILE *const stdin;
|
|
|
|
extern FILE *const stdout;
|
|
|
|
extern FILE *const stderr;
|
|
|
|
|
|
|
|
#define stdin (stdin)
|
|
|
|
#define stdout (stdout)
|
|
|
|
#define stderr (stderr)
|
|
|
|
|
|
|
|
FILE *fopen(const char *, const char *);
|
|
|
|
FILE *freopen(const char *, const char *, FILE *);
|
|
|
|
int fclose(FILE *);
|
|
|
|
|
|
|
|
int remove(const char *);
|
|
|
|
int rename(const char *, const char *);
|
|
|
|
|
|
|
|
int feof(FILE *);
|
|
|
|
int ferror(FILE *);
|
|
|
|
int fflush(FILE *);
|
|
|
|
void clearerr(FILE *);
|
|
|
|
|
|
|
|
int fseek(FILE *, long, int);
|
|
|
|
long ftell(FILE *);
|
|
|
|
void rewind(FILE *);
|
|
|
|
|
|
|
|
int fgetpos(FILE *, fpos_t *);
|
|
|
|
int fsetpos(FILE *, const fpos_t *);
|
|
|
|
|
|
|
|
size_t fread(void *, size_t, size_t, FILE *);
|
|
|
|
size_t fwrite(const void *, size_t, size_t, FILE *);
|
|
|
|
|
|
|
|
int fgetc(FILE *);
|
|
|
|
int getc(FILE *);
|
|
|
|
int getchar(void);
|
|
|
|
int ungetc(int, FILE *);
|
|
|
|
|
|
|
|
int fputc(int, FILE *);
|
|
|
|
int putc(int, FILE *);
|
|
|
|
int putchar(int);
|
|
|
|
|
|
|
|
char *fgets(char *, int, FILE *);
|
|
|
|
char *gets(char *);
|
|
|
|
|
|
|
|
int fputs(const char *, FILE *);
|
|
|
|
int puts(const char *);
|
|
|
|
|
|
|
|
int printf(const char *, ...);
|
|
|
|
int fprintf(FILE *, const char *, ...);
|
|
|
|
int sprintf(char *, const char *, ...);
|
|
|
|
int snprintf(char *, size_t, const char *, ...);
|
|
|
|
|
|
|
|
int vprintf(const char *, va_list);
|
|
|
|
int vfprintf(FILE *, const char *, va_list);
|
|
|
|
int vsprintf(char *, const char *, va_list);
|
|
|
|
int vsnprintf(char *, size_t, const char *, va_list);
|
|
|
|
|
|
|
|
int scanf(const char *, ...);
|
|
|
|
int fscanf(FILE *, const char *, ...);
|
|
|
|
int sscanf(const char *, const char *, ...);
|
|
|
|
int vscanf(const char *, va_list);
|
|
|
|
int vfscanf(FILE *, const char *, va_list);
|
|
|
|
int vsscanf(const char *, const char *, va_list);
|
|
|
|
|
|
|
|
void perror(const char *);
|
|
|
|
|
2011-02-14 10:10:10 +00:00
|
|
|
int setvbuf(FILE *, char *, int, size_t);
|
|
|
|
void setbuf(FILE *, char *);
|
|
|
|
|
|
|
|
char *tmpnam(char *);
|
|
|
|
FILE *tmpfile(void);
|
|
|
|
|
|
|
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
2012-05-23 01:52:08 +00:00
|
|
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
|
|
|
|| defined(_BSD_SOURCE)
|
2011-09-04 03:26:17 +00:00
|
|
|
FILE *fmemopen(void *, size_t, const char *);
|
2011-09-03 04:45:21 +00:00
|
|
|
FILE *open_memstream(char **, size_t *);
|
2011-02-14 10:10:10 +00:00
|
|
|
FILE *fdopen(int, const char *);
|
|
|
|
FILE *popen(const char *, const char *);
|
|
|
|
int pclose(FILE *);
|
|
|
|
int fileno(FILE *);
|
|
|
|
int fseeko(FILE *, off_t, int);
|
|
|
|
off_t ftello(FILE *);
|
|
|
|
int dprintf(int, const char *, ...);
|
|
|
|
int vdprintf(int, const char *, va_list);
|
2011-02-12 05:22:29 +00:00
|
|
|
void flockfile(FILE *);
|
|
|
|
int ftrylockfile(FILE *);
|
|
|
|
void funlockfile(FILE *);
|
|
|
|
int getc_unlocked(FILE *);
|
|
|
|
int getchar_unlocked(void);
|
|
|
|
int putc_unlocked(int, FILE *);
|
|
|
|
int putchar_unlocked(int);
|
2011-02-14 10:10:10 +00:00
|
|
|
ssize_t getdelim(char **, size_t *, int, FILE *);
|
|
|
|
ssize_t getline(char **, size_t *, FILE *);
|
|
|
|
int renameat(int, const char *, int, const char *);
|
|
|
|
char *ctermid(char *);
|
2011-02-16 00:47:22 +00:00
|
|
|
#define L_ctermid 20
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
|
2012-05-23 01:52:08 +00:00
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
|
|
|
|| defined(_BSD_SOURCE)
|
2011-02-16 00:47:22 +00:00
|
|
|
#define P_tmpdir "/tmp"
|
2011-02-12 05:22:29 +00:00
|
|
|
char *tempnam(const char *, const char *);
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2012-05-23 01:52:08 +00:00
|
|
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
2011-02-16 00:47:22 +00:00
|
|
|
#define L_cuserid 20
|
|
|
|
char *cuserid(char *);
|
2011-04-05 16:25:31 +00:00
|
|
|
void setlinebuf(FILE *);
|
|
|
|
void setbuffer(FILE *, char *, size_t);
|
2011-09-12 02:50:02 +00:00
|
|
|
int fgetc_unlocked(FILE *);
|
|
|
|
int fputc_unlocked(int, FILE *);
|
2012-05-29 02:53:24 +00:00
|
|
|
int fflush_unlocked(FILE *);
|
|
|
|
size_t fread_unlocked(void *, size_t, size_t, FILE *);
|
|
|
|
size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
|
|
|
|
void clearerr_unlocked(FILE *);
|
|
|
|
int feof_unlocked(FILE *);
|
|
|
|
int ferror_unlocked(FILE *);
|
|
|
|
int fileno_unlocked(FILE *);
|
2012-07-04 16:18:04 +00:00
|
|
|
int getw(FILE *);
|
|
|
|
int putw(int, FILE *);
|
2012-05-29 02:53:24 +00:00
|
|
|
#endif
|
|
|
|
|
2012-08-11 22:10:38 +00:00
|
|
|
#ifdef _BSD_SOURCE
|
|
|
|
char *fgetln(FILE *, size_t *);
|
|
|
|
#endif
|
|
|
|
|
2012-05-29 02:53:24 +00:00
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
int asprintf(char **, const char *, ...);
|
|
|
|
int vasprintf(char **, const char *, va_list);
|
2011-09-12 02:50:02 +00:00
|
|
|
char *fgets_unlocked(char *, int, FILE *);
|
|
|
|
int fputs_unlocked(const char *, FILE *);
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2012-06-04 12:03:56 +00:00
|
|
|
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
2012-05-04 04:13:23 +00:00
|
|
|
#define tmpfile64 tmpfile
|
|
|
|
#define fopen64 fopen
|
|
|
|
#define freopen64 freopen
|
|
|
|
#define fseeko64 fseeko
|
|
|
|
#define ftello64 ftello
|
|
|
|
#define fgetpos64 fgetpos
|
|
|
|
#define fsetpos64 fsetpos
|
|
|
|
#define fpos64_t fpos_t
|
|
|
|
#define off64_t off_t
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|