Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
stdio.h File Reference
#include <printf.h>
#include <stdarg.h>
#include <stddef.h>
#include <wctype.h>
Include dependency graph for stdio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  _G_fpos64_t
 
struct  __sbuf
 
struct  __sFILE_fake
 

Macros

#define EOF   (-1)
 
#define __FILE_defined
 

Typedefs

typedef union _G_fpos64_t fpos_t
 
typedef struct __sFILE_fake FILE
 

Functions

int putchar (int c)
 Requires a definition of _putchar() for your platform. More...
 
int puts (const char *)
 
int fseek (FILE *, long, int)
 
long ftell (FILE *)
 
void rewind (FILE *)
 
int fgetpos (FILE *__restrict, fpos_t *__restrict)
 
int fsetpos (FILE *, const fpos_t *)
 
size_t fread (void *__restrict, size_t, size_t, FILE *__restrict)
 
size_t fwrite (const void *__restrict, size_t, size_t, FILE *__restrict)
 
char * fgets (char *__restrict, int, FILE *__restrict)
 
char * gets (char *)
 
int fputc (int, FILE *)
 
int putc (int, FILE *)
 
wchar_t * fgetws (wchar_t *__restrict, int, FILE *__restrict)
 
int fputws (const wchar_t *__restrict, FILE *__restrict)
 
int fgetc (FILE *)
 
int getc (FILE *)
 
int getchar (void)
 
int ungetc (int, FILE *)
 
wint_t fgetwc (FILE *)
 
wint_t getwc (FILE *)
 
wint_t getwchar (void)
 
wint_t ungetwc (wint_t, FILE *)
 
wint_t fputwc (wchar_t, FILE *)
 
wint_t putwc (wchar_t, FILE *)
 
wint_t putwchar (wchar_t)
 
char * tmpnam (char *)
 
FILEtmpfile (void)
 
int fwide (FILE *, int)
 
int fputs (const char *__restrict, FILE *__restrict)
 
FILEfopen (const char *__restrict, const char *__restrict)
 
FILEfreopen (const char *__restrict, const char *__restrict, FILE *__restrict)
 
int fclose (FILE *)
 
int feof (FILE *)
 
int ferror (FILE *)
 
int fflush (FILE *)
 
void clearerr (FILE *)
 
int remove (const char *)
 
int rename (const char *, const char *)
 
int setvbuf (FILE *__restrict, char *__restrict, int, size_t)
 
void setbuf (FILE *__restrict, char *__restrict)
 
int scanf (const char *__restrict,...)
 
int fscanf (FILE *__restrict, const char *__restrict,...)
 
int sscanf (const char *__restrict, const char *__restrict,...)
 
int vscanf (const char *__restrict, __isoc_va_list)
 
int vfscanf (FILE *__restrict, const char *__restrict, __isoc_va_list)
 
int vsscanf (const char *__restrict, const char *__restrict, __isoc_va_list)
 
int wscanf (const wchar_t *__restrict,...)
 
int fwscanf (FILE *__restrict, const wchar_t *__restrict,...)
 
int swscanf (const wchar_t *__restrict, const wchar_t *__restrict,...)
 
int vwscanf (const wchar_t *__restrict, __isoc_va_list)
 
int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list)
 
int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list)
 
void perror (const char *)
 Unsupported printf variants. More...
 
int wprintf (const wchar_t *__restrict,...)
 
int fprintf (FILE *__restrict, const char *__restrict,...)
 
int vprintf (const char *__restrict, __isoc_va_list)
 
int vfprintf (FILE *__restrict, const char *__restrict, __isoc_va_list)
 
int vsprintf (char *__restrict, const char *__restrict, __isoc_va_list)
 
int fwprintf (FILE *__restrict, const wchar_t *__restrict,...)
 
int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict,...)
 
int vwprintf (const wchar_t *__restrict, __isoc_va_list)
 
int vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list)
 
int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list)
 

Class Documentation

◆ _G_fpos64_t

union _G_fpos64_t

Definition at line 25 of file stdio.h.

Collaboration diagram for _G_fpos64_t:
Collaboration graph
Class Members
double __align
long long __lldata
char __opaque[16]

◆ __sbuf

struct __sbuf

Definition at line 35 of file stdio.h.

Collaboration diagram for __sbuf:
Collaboration graph
Class Members
unsigned char * _base
int _size

◆ __sFILE_fake

struct __sFILE_fake

Definition at line 46 of file stdio.h.

Collaboration diagram for __sFILE_fake:
Collaboration graph
Class Members
struct __sbuf _bf
struct _reent * _data
short _file
short _flags
int _lbfsize
unsigned char * _p
int _r
int _w

Macro Definition Documentation

◆ __FILE_defined

#define __FILE_defined

Definition at line 61 of file stdio.h.

◆ EOF

#define EOF   (-1)

NOTE: The files included here are primarily stubs to get C++ compiling. If you are linking on a host machine, these functions will need to be supplied by the system library If you are linking on bare metal, these symbols will not be defined! Only the functions defined in printf.h and in the Supported Functions section below are currently safe for bare metal

Definition at line 23 of file stdio.h.

Typedef Documentation

◆ FILE

typedef struct __sFILE_fake FILE

Definition at line 60 of file stdio.h.

◆ fpos_t

typedef union _G_fpos64_t fpos_t

Function Documentation

◆ clearerr()

void clearerr ( FILE )

◆ fclose()

int fclose ( FILE )

Referenced by main().

◆ feof()

int feof ( FILE )

◆ ferror()

int ferror ( FILE )

◆ fflush()

int fflush ( FILE )

◆ fgetc()

int fgetc ( FILE )

◆ fgetpos()

int fgetpos ( FILE __restrict,
fpos_t __restrict 
)

◆ fgets()

char* fgets ( char *  __restrict,
int  ,
FILE __restrict 
)

◆ fgetwc()

wint_t fgetwc ( FILE )

◆ fgetws()

wchar_t* fgetws ( wchar_t *  __restrict,
int  ,
FILE __restrict 
)

◆ fopen()

FILE* fopen ( const char *  __restrict,
const char *  __restrict 
)

Referenced by main().

◆ fprintf()

int fprintf ( FILE __restrict,
const char *  __restrict,
  ... 
)

Referenced by main().

◆ fputc()

int fputc ( int  ,
FILE  
)

◆ fputs()

int fputs ( const char *  __restrict,
FILE __restrict 
)

◆ fputwc()

wint_t fputwc ( wchar_t  ,
FILE  
)

◆ fputws()

int fputws ( const wchar_t *  __restrict,
FILE __restrict 
)

◆ fread()

size_t fread ( void *  __restrict,
size_t  ,
size_t  ,
FILE __restrict 
)

◆ freopen()

FILE* freopen ( const char *  __restrict,
const char *  __restrict,
FILE __restrict 
)

◆ fscanf()

int fscanf ( FILE __restrict,
const char *  __restrict,
  ... 
)

◆ fseek()

int fseek ( FILE ,
long  ,
int   
)

◆ fsetpos()

int fsetpos ( FILE ,
const fpos_t  
)

◆ ftell()

long ftell ( FILE )

◆ fwide()

int fwide ( FILE ,
int   
)

◆ fwprintf()

int fwprintf ( FILE __restrict,
const wchar_t *  __restrict,
  ... 
)

◆ fwrite()

size_t fwrite ( const void *  __restrict,
size_t  ,
size_t  ,
FILE __restrict 
)

◆ fwscanf()

int fwscanf ( FILE __restrict,
const wchar_t *  __restrict,
  ... 
)

◆ getc()

int getc ( FILE )

◆ getchar()

int getchar ( void  )

◆ gets()

char* gets ( char *  )

◆ getwc()

wint_t getwc ( FILE )

◆ getwchar()

wint_t getwchar ( void  )

◆ perror()

void perror ( const char *  )

Unsupported printf variants.

◆ putc()

int putc ( int  ,
FILE  
)

◆ putchar()

int putchar ( int  c)

Requires a definition of _putchar() for your platform.

Definition at line 4 of file putchar.c.

5 {
6  _putchar((char)c);
7  return c;
8 }
void _putchar(char ch)
Definition: putchar_native.c:6

References _putchar().

Referenced by puts().

Here is the caller graph for this function:

◆ puts()

int puts ( const char *  )

Definition at line 3 of file puts.c.

4 {
5  int r = 0;
6 
7  for(const char* c = str; *c != 0; c++)
8  {
9  putchar((int)*c);
10  r++;
11  }
12 
13  // puts adds a newline
14  if(r)
15  {
16  putchar('\n');
17  r++;
18  }
19 
20  return r ? r : EOF;
21 }
int putchar(int c)
Requires a definition of _putchar() for your platform.
Definition: putchar.c:4
#define EOF
Definition: stdio.h:23

References EOF, and putchar().

◆ putwc()

wint_t putwc ( wchar_t  ,
FILE  
)

◆ putwchar()

wint_t putwchar ( wchar_t  )

◆ remove()

int remove ( const char *  )

◆ rename()

int rename ( const char *  ,
const char *   
)

◆ rewind()

void rewind ( FILE )

◆ scanf()

int scanf ( const char *  __restrict,
  ... 
)

◆ setbuf()

void setbuf ( FILE __restrict,
char *  __restrict 
)

◆ setvbuf()

int setvbuf ( FILE __restrict,
char *  __restrict,
int  ,
size_t   
)

◆ sscanf()

int sscanf ( const char *  __restrict,
const char *  __restrict,
  ... 
)

◆ swprintf()

int swprintf ( wchar_t *  __restrict,
size_t  ,
const wchar_t *  __restrict,
  ... 
)

◆ swscanf()

int swscanf ( const wchar_t *  __restrict,
const wchar_t *  __restrict,
  ... 
)

◆ tmpfile()

FILE* tmpfile ( void  )

◆ tmpnam()

char* tmpnam ( char *  )

◆ ungetc()

int ungetc ( int  ,
FILE  
)

◆ ungetwc()

wint_t ungetwc ( wint_t  ,
FILE  
)

◆ vfprintf()

int vfprintf ( FILE __restrict,
const char *  __restrict,
__isoc_va_list   
)

◆ vfscanf()

int vfscanf ( FILE __restrict,
const char *  __restrict,
__isoc_va_list   
)

◆ vfwprintf()

int vfwprintf ( FILE __restrict,
const wchar_t *  __restrict,
__isoc_va_list   
)

◆ vfwscanf()

int vfwscanf ( FILE __restrict,
const wchar_t *  __restrict,
__isoc_va_list   
)

◆ vprintf()

int vprintf ( const char *  __restrict,
__isoc_va_list   
)

◆ vscanf()

int vscanf ( const char *  __restrict,
__isoc_va_list   
)

◆ vsprintf()

int vsprintf ( char *  __restrict,
const char *  __restrict,
__isoc_va_list   
)

◆ vsscanf()

int vsscanf ( const char *  __restrict,
const char *  __restrict,
__isoc_va_list   
)

◆ vswprintf()

int vswprintf ( wchar_t *  __restrict,
size_t  ,
const wchar_t *  __restrict,
__isoc_va_list   
)

◆ vswscanf()

int vswscanf ( const wchar_t *  __restrict,
const wchar_t *  __restrict,
__isoc_va_list   
)

◆ vwprintf()

int vwprintf ( const wchar_t *  __restrict,
__isoc_va_list   
)

◆ vwscanf()

int vwscanf ( const wchar_t *  __restrict,
__isoc_va_list   
)

◆ wprintf()

int wprintf ( const wchar_t *  __restrict,
  ... 
)

◆ wscanf()

int wscanf ( const wchar_t *  __restrict,
  ... 
)