PatchworkOS  c9fea19
A non-POSIX operating system.
Loading...
Searching...
No Matches
stdio.h File Reference
#include <stdarg.h>
#include "_internal/MAX_PATH.h"
#include "_internal/NULL.h"
#include "_internal/SEEK.h"
#include "_internal/config.h"
#include "_internal/fd_t.h"
#include "_internal/size_t.h"
Include dependency graph for stdio.h:

Go to the source code of this file.

Macros

#define _IOFBF   (1u << 0)
 
#define _IOLBF   (1u << 1)
 
#define _IONBF   (1u << 2)
 
#define EOF   (-1)
 
#define BUFSIZ   1024
 
#define FOPEN_MAX   8
 
#define FILENAME_MAX   MAX_PATH
 
#define L_tmpnam   46
 
#define TMP_MAX   50
 

Typedefs

typedef struct fpos fpos_t
 

Functions

_PUBLIC int remove (const char *filename)
 
_PUBLIC int rename (const char *oldpath, const char *newpath)
 
_PUBLIC FILEtmpfile (void)
 
_PUBLIC char * tmpnam (char *s)
 
_PUBLIC int fclose (FILE *stream)
 
_PUBLIC int fflush (FILE *stream)
 
_PUBLIC FILEfopen (const char *_RESTRICT filename, const char *_RESTRICT mode)
 
_PUBLIC FILEfreopen (const char *_RESTRICT filename, const char *_RESTRICT mode, FILE *_RESTRICT stream)
 
_PUBLIC void setbuf (FILE *_RESTRICT stream, char *_RESTRICT buf)
 
_PUBLIC int setvbuf (FILE *_RESTRICT stream, char *_RESTRICT buf, int mode, size_t size)
 
_PUBLIC int fprintf (FILE *_RESTRICT stream, const char *_RESTRICT format,...)
 
_PUBLIC int fscanf (FILE *_RESTRICT stream, const char *_RESTRICT format,...)
 
_PUBLIC int printf (const char *_RESTRICT format,...)
 
_PUBLIC int scanf (const char *_RESTRICT format,...)
 
_PUBLIC int snprintf (char *_RESTRICT s, size_t n, const char *_RESTRICT format,...)
 
_PUBLIC int sprintf (char *_RESTRICT s, const char *_RESTRICT format,...)
 
_PUBLIC int sscanf (const char *_RESTRICT s, const char *_RESTRICT format,...)
 
_PUBLIC int vfprintf (FILE *_RESTRICT stream, const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vfscanf (FILE *_RESTRICT stream, const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vprintf (const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vscanf (const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vsnprintf (char *_RESTRICT s, size_t n, const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vsprintf (char *_RESTRICT s, const char *_RESTRICT format, va_list arg)
 
_PUBLIC int vsscanf (const char *_RESTRICT s, const char *_RESTRICT format, va_list arg)
 
_PUBLIC int fgetc (FILE *stream)
 
_PUBLIC char * fgets (char *_RESTRICT s, int n, FILE *_RESTRICT stream)
 
_PUBLIC int fputc (int c, FILE *stream)
 
_PUBLIC int fputs (const char *_RESTRICT s, FILE *_RESTRICT stream)
 
_PUBLIC int getc (FILE *stream)
 
_PUBLIC int getchar (void)
 
_PUBLIC int putc (int c, FILE *stream)
 
_PUBLIC int putchar (int c)
 
_PUBLIC int puts (const char *s)
 
_PUBLIC int ungetc (int c, FILE *stream)
 
_PUBLIC size_t fread (void *_RESTRICT ptr, size_t size, size_t nmemb, FILE *_RESTRICT stream)
 
_PUBLIC size_t fwrite (const void *_RESTRICT ptr, size_t size, size_t nmemb, FILE *_RESTRICT stream)
 
_PUBLIC int fgetpos (FILE *_RESTRICT stream, fpos_t *_RESTRICT pos)
 
_PUBLIC int fseek (FILE *stream, long int offset, int whence)
 
_PUBLIC int fsetpos (FILE *stream, const fpos_t *pos)
 
_PUBLIC long int ftell (FILE *stream)
 
_PUBLIC void rewind (FILE *stream)
 
_PUBLIC void clearerr (FILE *stream)
 
_PUBLIC int feof (FILE *stream)
 
_PUBLIC int ferror (FILE *stream)
 
_PUBLIC void perror (const char *s)
 

Variables

FILEstdin
 
FILEstdout
 
FILEstderr
 

Macro Definition Documentation

◆ _IOFBF

#define _IOFBF   (1u << 0)

Definition at line 18 of file stdio.h.

◆ _IOLBF

#define _IOLBF   (1u << 1)

Definition at line 19 of file stdio.h.

◆ _IONBF

#define _IONBF   (1u << 2)

Definition at line 20 of file stdio.h.

◆ EOF

#define EOF   (-1)

Definition at line 25 of file stdio.h.

◆ BUFSIZ

#define BUFSIZ   1024

Definition at line 26 of file stdio.h.

◆ FOPEN_MAX

#define FOPEN_MAX   8

Definition at line 27 of file stdio.h.

◆ FILENAME_MAX

#define FILENAME_MAX   MAX_PATH

Definition at line 28 of file stdio.h.

◆ L_tmpnam

#define L_tmpnam   46

Definition at line 30 of file stdio.h.

◆ TMP_MAX

#define TMP_MAX   50

Definition at line 31 of file stdio.h.

Typedef Documentation

◆ fpos_t

typedef struct fpos fpos_t

Definition at line 22 of file stdio.h.

Function Documentation

◆ remove()

_PUBLIC int remove ( const char *  filename)

Definition at line 6 of file remove.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename()

_PUBLIC int rename ( const char *  oldpath,
const char *  newpath 
)

Definition at line 5 of file rename.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tmpfile()

_PUBLIC FILE * tmpfile ( void  )

◆ tmpnam()

_PUBLIC char * tmpnam ( char *  s)

◆ fclose()

_PUBLIC int fclose ( FILE stream)

Definition at line 7 of file fclose.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fflush()

_PUBLIC int fflush ( FILE stream)

Definition at line 6 of file fflush.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fopen()

_PUBLIC FILE * fopen ( const char *_RESTRICT  filename,
const char *_RESTRICT  mode 
)

Definition at line 27 of file fopen.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freopen()

_PUBLIC FILE * freopen ( const char *_RESTRICT  filename,
const char *_RESTRICT  mode,
FILE *_RESTRICT  stream 
)

◆ setbuf()

_PUBLIC void setbuf ( FILE *_RESTRICT  stream,
char *_RESTRICT  buf 
)

◆ setvbuf()

_PUBLIC int setvbuf ( FILE *_RESTRICT  stream,
char *_RESTRICT  buf,
int  mode,
size_t  size 
)

◆ fprintf()

_PUBLIC int fprintf ( FILE *_RESTRICT  stream,
const char *_RESTRICT  format,
  ... 
)

Definition at line 5 of file fprintf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fscanf()

_PUBLIC int fscanf ( FILE *_RESTRICT  stream,
const char *_RESTRICT  format,
  ... 
)

Definition at line 4 of file fscanf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printf()

_PUBLIC int printf ( const char *_RESTRICT  format,
  ... 
)

Definition at line 5 of file printf.c.

Here is the call graph for this function:

◆ scanf()

_PUBLIC int scanf ( const char *_RESTRICT  format,
  ... 
)

◆ snprintf()

_PUBLIC int snprintf ( char *_RESTRICT  s,
size_t  n,
const char *_RESTRICT  format,
  ... 
)

Definition at line 3 of file snprintf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sprintf()

_PUBLIC int sprintf ( char *_RESTRICT  s,
const char *_RESTRICT  format,
  ... 
)

Definition at line 5 of file sprintf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sscanf()

_PUBLIC int sscanf ( const char *_RESTRICT  s,
const char *_RESTRICT  format,
  ... 
)

Definition at line 4 of file sscanf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfprintf()

_PUBLIC int vfprintf ( FILE *_RESTRICT  stream,
const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 8 of file vfprintf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfscanf()

_PUBLIC int vfscanf ( FILE *_RESTRICT  stream,
const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 8 of file vfscanf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vprintf()

_PUBLIC int vprintf ( const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 5 of file vprintf.c.

Here is the call graph for this function:

◆ vscanf()

_PUBLIC int vscanf ( const char *_RESTRICT  format,
va_list  arg 
)

◆ vsnprintf()

_PUBLIC int vsnprintf ( char *_RESTRICT  s,
size_t  n,
const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 5 of file vsnprintf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vsprintf()

_PUBLIC int vsprintf ( char *_RESTRICT  s,
const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 5 of file vsprintf.c.

Here is the call graph for this function:

◆ vsscanf()

_PUBLIC int vsscanf ( const char *_RESTRICT  s,
const char *_RESTRICT  format,
va_list  arg 
)

Definition at line 7 of file vsscanf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fgetc()

_PUBLIC int fgetc ( FILE stream)

Definition at line 7 of file fgetc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fgets()

_PUBLIC char * fgets ( char *_RESTRICT  s,
int  n,
FILE *_RESTRICT  stream 
)

Definition at line 5 of file fgets.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fputc()

_PUBLIC int fputc ( int  c,
FILE stream 
)

Definition at line 7 of file fputc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fputs()

_PUBLIC int fputs ( const char *_RESTRICT  s,
FILE *_RESTRICT  stream 
)

Definition at line 5 of file fputs.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getc()

_PUBLIC int getc ( FILE stream)

Definition at line 7 of file getc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getchar()

_PUBLIC int getchar ( void  )

Definition at line 7 of file getchar.c.

Here is the call graph for this function:

◆ putc()

_PUBLIC int putc ( int  c,
FILE stream 
)

Definition at line 7 of file putc.c.

Here is the call graph for this function:

◆ putchar()

_PUBLIC int putchar ( int  c)

Definition at line 7 of file putchar.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ puts()

_PUBLIC int puts ( const char *  s)

◆ ungetc()

_PUBLIC int ungetc ( int  c,
FILE stream 
)

Definition at line 5 of file ungetc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fread()

_PUBLIC size_t fread ( void *_RESTRICT  ptr,
size_t  size,
size_t  nmemb,
FILE *_RESTRICT  stream 
)
Todo:
For better performance, read block-wise, not byte-wise.

Definition at line 7 of file fread.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fwrite()

_PUBLIC size_t fwrite ( const void *_RESTRICT  ptr,
size_t  size,
size_t  nmemb,
FILE *_RESTRICT  stream 
)
Todo:
For better performance, write block-wise, not byte-wise.

Definition at line 8 of file fwrite.c.

Here is the call graph for this function:

◆ fgetpos()

_PUBLIC int fgetpos ( FILE *_RESTRICT  stream,
fpos_t *_RESTRICT  pos 
)

◆ fseek()

_PUBLIC int fseek ( FILE stream,
long int  offset,
int  whence 
)

◆ fsetpos()

_PUBLIC int fsetpos ( FILE stream,
const fpos_t pos 
)

◆ ftell()

_PUBLIC long int ftell ( FILE stream)

Definition at line 7 of file ftell.c.

Here is the call graph for this function:

◆ rewind()

_PUBLIC void rewind ( FILE stream)

◆ clearerr()

_PUBLIC void clearerr ( FILE stream)

Definition at line 5 of file clearerr.c.

◆ feof()

_PUBLIC int feof ( FILE stream)

Definition at line 5 of file feof.c.

Here is the caller graph for this function:

◆ ferror()

_PUBLIC int ferror ( FILE stream)

Definition at line 5 of file ferror.c.

Here is the caller graph for this function:

◆ perror()

_PUBLIC void perror ( const char *  s)

Definition at line 5 of file perror.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ stdin

FILE* stdin
extern

Definition at line 17 of file std_streams.c.

◆ stdout

FILE* stdout
extern

Definition at line 18 of file std_streams.c.

◆ stderr

FILE* stderr
extern

Definition at line 19 of file std_streams.c.