Modular C
+ Collaboration diagram for C◼io:

Modules

 C◼io◼buf Interfaces to handle stream buffers.
 
 C◼io◼error
 
 C◼io◼open
 
 C◼io◼pos
 
 C◼io◼seek
 
 Platform features used by module C◼io
 Some features are recovered or pre-computed specifically for the target platform by looking into the C include files:
 
 Specific macros to deal with the structure of module C◼io.
 

Macros

#define C◼io◼NULL   C◼NULL
 
#define C◼io◼printf(...)   _Generic(C◼macro◼ARG0(__VA_ARGS__), char const*: C◼io◼printf, char*: C◼io◼printf, C◼io*: C◼io◼fprintf)(__VA_ARGS__)
 The macro is a convenient interface to printf and fprintf. More...
 
#define C◼io◼scanf(...)   _Generic(C◼macro◼ARG0(__VA_ARGS__), char const*: C◼io◼scanf, char const*: C◼io◼scanf, C◼io*: C◼io◼fscanf)(__VA_ARGS__)
 The macro is a convenient interface to scanf and fscanf. More...
 
#define C◼io◼putc(...)   _Generic(C◼macro◼ARG1(__VA_ARGS__, (C◼macro◼incomp0*)0, 0), C◼macro◼incomp0*: __putc_internal(C◼macro◼ARG0(__VA_ARGS__), C◼io◼out), C◼io*: __putc_internal(C◼macro◼ARG0(__VA_ARGS__), C◼macro◼ARG1(__VA_ARGS__, (C◼io*)0)))
 The macro is a convenient interface to putc and putchar. More...
 
#define C◼io◼open(...)   _Generic(C◼macro◼ARG2(__VA_ARGS__, (C◼macro◼incomp0*)0), C◼macro◼incomp0*: C◼io◼open, default: C◼io◼reopen)(__VA_ARGS__)
 The macro is a convenient interface to open and reopen. More...
 
#define C◼io◼gets(_0, ...)   C◼io◼_Gets(_0, __VA_ARGS__, C◼io◼in, 0)
 Replaces the ancient gets function (which was removed), as a convenient interface to fgets with 2 or 3 arguments. More...
 
#define C◼io◼_Gets(_0, _1, _2, ...)   C◼io◼fgets(_0, _1, _2)
 

Typedefs

typedef struct C◼io◼pos C◼io◼pos
 
typedef C◼size C◼io◼size
 

Functions

C◼ioC◼io◼open (const char *restrict, const char *restrict)
 
C◼ioC◼io◼reopen (const char *restrict, const char *restrict, C◼io *restrict)
 
int C◼io◼close (C◼io *)
 
int C◼io◼flush (C◼io *)
 
int C◼io◼seek (C◼io *, long, int)
 
long C◼io◼tell (C◼io *)
 
void C◼io◼rewind (C◼io *)
 
C◼io◼size C◼io◼fread (void *restrict, C◼io◼size, C◼io◼size, C◼io *restrict)
 
C◼io◼size C◼io◼fwrite (const void *restrict, C◼io◼size, C◼io◼size, C◼io *restrict)
 
int C◼io◼fgetc (C◼io *)
 
int C◼io◼getc (C◼io *)
 
int C◼io◼getchar (void)
 This aliases symbol getchar. More...
 
int C◼io◼ungetc (int, C◼io *)
 
int C◼io◼fputc (int, C◼io *)
 
int C◼io◼putc (int, C◼io *)
 
int C◼io◼putchar (int)
 
char * C◼io◼fgets (char *restrict, int, C◼io *restrict)
 
int C◼io◼fputs (const char *restrict, C◼io *restrict)
 
int C◼io◼puts (const char *)
 
int() C◼io◼printf (const char *restrict,...)
 
int C◼io◼fprintf (C◼io *restrict, const char *restrict,...)
 
int C◼io◼sprintf (char *restrict, const char *restrict,...)
 
int C◼io◼snprintf (char *restrict, C◼io◼size, const char *restrict,...)
 
int C◼io◼vprintf (const char *restrict, C◼va)
 
int C◼io◼vfprintf (C◼io *restrict, const char *restrict, C◼va)
 
int C◼io◼vsprintf (char *restrict, const char *restrict, C◼va)
 
int C◼io◼vsnprintf (char *restrict, C◼io◼size, const char *restrict, C◼va)
 
int() C◼io◼scanf (const char *restrict,...)
 
int C◼io◼fscanf (C◼io *restrict, const char *restrict,...)
 
int C◼io◼sscanf (const char *restrict, const char *restrict,...)
 
int C◼io◼vscanf (const char *restrict, C◼va)
 
int C◼io◼vfscanf (C◼io *restrict, const char *restrict, C◼va)
 
int C◼io◼vsscanf (const char *restrict, const char *restrict, C◼va)
 
void C◼io◼perror (const char *)
 
C◼ioC◼io◼tmp (void)
 This aliases symbol tmpfile. More...
 
int C◼io◼_IO_putc (int, C◼io *)
 
C◼size C◼io◼read (C◼io *s, void *b, C◼size C◼io◼size)
 read at most size bytes into buffer b More...
 
C◼size C◼io◼write (C◼io *s, void const *b, C◼size C◼io◼size)
 write at most size bytes from buffer b More...
 
void C◼io◼sync (void)
 Synchronize all buffered write data of IO streams. More...
 

Variables

C◼ioC◼io◼in
 This aliases symbol stdin. More...
 
C◼ioC◼io◼out
 This aliases symbol stdout. More...
 
C◼ioC◼io◼err
 This aliases symbol stderr. More...
 

Detailed Description

Macro Definition Documentation

§ C◼io◼_Gets

#define C◼io◼_Gets (   _0,
  _1,
  _2,
  ... 
)    C◼io◼fgets(_0, _1, _2)

Definition at line 364 of file C-io.c.

§ C◼io◼gets

#define C◼io◼gets (   _0,
  ... 
)    C◼io◼_Gets(_0, __VA_ARGS__, C◼io◼in, 0)

Replaces the ancient gets function (which was removed), as a convenient interface to fgets with 2 or 3 arguments.

Reads from io¯in if the 3rd argument is omitted.

Definition at line 363 of file C-io.c.

§ C◼io◼NULL

#define C◼io◼NULL   C◼NULL

Definition at line 286 of file C-io.c.

§ C◼io◼open

#define C◼io◼open (   ...)    _Generic(C◼macro◼ARG2(__VA_ARGS__, (C◼macro◼incomp0*)0), C◼macro◼incomp0*: C◼io◼open, default: C◼io◼reopen)(__VA_ARGS__)

The macro is a convenient interface to open and reopen.

Definition at line 356 of file C-io.c.

§ C◼io◼printf

#define C◼io◼printf (   ...)    _Generic(C◼macro◼ARG0(__VA_ARGS__), char const*: C◼io◼printf, char*: C◼io◼printf, C◼io*: C◼io◼fprintf)(__VA_ARGS__)

The macro is a convenient interface to printf and fprintf.

Definition at line 341 of file C-io.c.

§ C◼io◼putc

#define C◼io◼putc (   ...)    _Generic(C◼macro◼ARG1(__VA_ARGS__, (C◼macro◼incomp0*)0, 0), C◼macro◼incomp0*: __putc_internal(C◼macro◼ARG0(__VA_ARGS__), C◼io◼out), C◼io*: __putc_internal(C◼macro◼ARG0(__VA_ARGS__), C◼macro◼ARG1(__VA_ARGS__, (C◼io*)0)))

The macro is a convenient interface to putc and putchar.

Definition at line 350 of file C-io.c.

§ C◼io◼scanf

#define C◼io◼scanf (   ...)    _Generic(C◼macro◼ARG0(__VA_ARGS__), char const*: C◼io◼scanf, char const*: C◼io◼scanf, C◼io*: C◼io◼fscanf)(__VA_ARGS__)

The macro is a convenient interface to scanf and fscanf.

Definition at line 343 of file C-io.c.

Typedef Documentation

§ C◼io◼pos

typedef struct C◼io◼pos C◼io◼pos

Definition at line 283 of file C-io.c.

§ C◼io◼size

Definition at line 285 of file C-io.c.

Function Documentation

§ C◼io◼_IO_putc()

int C◼io◼_IO_putc ( int  ,
C◼io  
)

§ C◼io◼close()

int C◼io◼close ( C◼io )

§ C◼io◼fgetc()

int C◼io◼fgetc ( C◼io )

§ C◼io◼fgets()

char* C◼io◼fgets ( char *  restrict,
int  ,
C◼io restrict 
)

§ C◼io◼flush()

int C◼io◼flush ( C◼io )

Referenced by C◼io◼sync().

+ Here is the caller graph for this function:

§ C◼io◼fprintf()

int C◼io◼fprintf ( C◼io restrict,
const char *  restrict,
  ... 
)

§ C◼io◼fputc()

int C◼io◼fputc ( int  ,
C◼io  
)

§ C◼io◼fputs()

int C◼io◼fputs ( const char *  restrict,
C◼io restrict 
)

§ C◼io◼fread()

C◼io◼size C◼io◼fread ( void *  restrict,
C◼io◼size  ,
C◼io◼size  ,
C◼io restrict 
)

Referenced by C◼io◼read().

+ Here is the caller graph for this function:

§ C◼io◼fscanf()

int C◼io◼fscanf ( C◼io restrict,
const char *  restrict,
  ... 
)

§ C◼io◼fwrite()

C◼io◼size C◼io◼fwrite ( const void *  restrict,
C◼io◼size  ,
C◼io◼size  ,
C◼io restrict 
)

Referenced by C◼io◼write().

+ Here is the caller graph for this function:

§ C◼io◼getc()

int C◼io◼getc ( C◼io )

§ C◼io◼getchar()

int C◼io◼getchar ( void  )

This aliases symbol getchar.

§ C◼io◼open()

C◼io* C◼io◼open ( const char *  restrict,
const char *  restrict 
)

§ C◼io◼perror()

void C◼io◼perror ( const char *  )

§ C◼io◼printf()

int() C◼io◼printf ( const char *  restrict,
  ... 
)

Referenced by C◼F257◼main(), C◼mod◼stats◼print(), and C◼string◼main().

+ Here is the caller graph for this function:

§ C◼io◼putc()

int C◼io◼putc ( int  ,
C◼io  
)

§ C◼io◼putchar()

int C◼io◼putchar ( int  )

§ C◼io◼puts()

int C◼io◼puts ( const char *  )

§ C◼io◼read()

C◼size C◼io◼read ( C◼io s,
void *  b,
C◼size  C◼io◼size 
)
inline

read at most size bytes into buffer b

This is an extension of the current C library that is better in line with other IO functions, namely to have the stream as first argument and operating just on bytes.

Definition at line 384 of file C-io.c.

References C◼io◼fread().

384  {
385 #line 158 "/home/gustedt/build/cmod/C/C-io.X"
386  return C◼io◼fread(b, 1, C◼io◼size, s);
387 }
C◼io◼size C◼io◼fread(void *restrict, C◼io◼size, C◼io◼size, C◼io *restrict)
C◼size C◼io◼size
Definition: C-io.c:285
+ Here is the call graph for this function:

§ C◼io◼reopen()

C◼io* C◼io◼reopen ( const char *  restrict,
const char *  restrict,
C◼io restrict 
)

§ C◼io◼rewind()

void C◼io◼rewind ( C◼io )

§ C◼io◼scanf()

int() C◼io◼scanf ( const char *  restrict,
  ... 
)

§ C◼io◼seek()

int C◼io◼seek ( C◼io ,
long  ,
int   
)

§ C◼io◼snprintf()

int C◼io◼snprintf ( char *  restrict,
C◼io◼size  ,
const char *  restrict,
  ... 
)

§ C◼io◼sprintf()

int C◼io◼sprintf ( char *  restrict,
const char *  restrict,
  ... 
)

§ C◼io◼sscanf()

int C◼io◼sscanf ( const char *  restrict,
const char *  restrict,
  ... 
)

Referenced by C◼mod◼undump8◼five().

+ Here is the caller graph for this function:

§ C◼io◼sync()

void C◼io◼sync ( void  )
inline

Synchronize all buffered write data of IO streams.

Definition at line 404 of file C-io.c.

References C◼io◼flush(), C◼MODULE_ABI, and C◼MODULE_FEATURES.

404  {
405 #line 176 "/home/gustedt/build/cmod/C/C-io.X"
406  C◼io◼flush(0);
407 }
int C◼io◼flush(C◼io *)
+ Here is the call graph for this function:

§ C◼io◼tell()

long C◼io◼tell ( C◼io )

§ C◼io◼tmp()

int C◼io◼tmp ( void  )

This aliases symbol tmpfile.

§ C◼io◼ungetc()

int C◼io◼ungetc ( int  ,
C◼io  
)

§ C◼io◼vfprintf()

int C◼io◼vfprintf ( C◼io restrict,
const char *  restrict,
C◼va   
)

§ C◼io◼vfscanf()

int C◼io◼vfscanf ( C◼io restrict,
const char *  restrict,
C◼va   
)

§ C◼io◼vprintf()

int C◼io◼vprintf ( const char *  restrict,
C◼va   
)

§ C◼io◼vscanf()

int C◼io◼vscanf ( const char *  restrict,
C◼va   
)

§ C◼io◼vsnprintf()

int C◼io◼vsnprintf ( char *  restrict,
C◼io◼size  ,
const char *  restrict,
C◼va   
)

§ C◼io◼vsprintf()

int C◼io◼vsprintf ( char *  restrict,
const char *  restrict,
C◼va   
)

§ C◼io◼vsscanf()

int C◼io◼vsscanf ( const char *  restrict,
const char *  restrict,
C◼va   
)

§ C◼io◼write()

C◼size C◼io◼write ( C◼io s,
void const *  b,
C◼size  C◼io◼size 
)
inline

write at most size bytes from buffer b

See also
read

Definition at line 395 of file C-io.c.

References C◼io◼fwrite().

395  {
396 #line 168 "/home/gustedt/build/cmod/C/C-io.X"
397  return C◼io◼fwrite(b, 1, C◼io◼size, s);
398 }
C◼io◼size C◼io◼fwrite(const void *restrict, C◼io◼size, C◼io◼size, C◼io *restrict)
C◼size C◼io◼size
Definition: C-io.c:285
+ Here is the call graph for this function:

Variable Documentation

§ C◼io◼err

int C◼io◼err

This aliases symbol stderr.

§ C◼io◼in

int C◼io◼in

This aliases symbol stdin.

§ C◼io◼out

int C◼io◼out

This aliases symbol stdout.

Referenced by C◼mod◼timer◼test().