(my)TinyLibC 0.0.1
little tiny pretty lib c
Loading...
Searching...
No Matches
tlcstdios.h File Reference
#include <stdbool.h>
#include <stdarg.h>

Go to the source code of this file.

Functions

int x_putc (char c, bool newline)
 put c to stdout
 
int x_puts (const char *str, bool newline)
 put str to stdout (nothing if str = 0)
 
int x_printf (const char *format,...)
 put a formated string to stdout (nothing if format = 0)
 
char * x_sprintf (const char *format,...)
 like printf but not output the string to stdout, put it in a string
 
char * x_vsprintf (const char *format, va_list ap)
 same as x_sprintf but take a va_list
 
int x_putsd (int fd, const char *str, bool newline)
 Print to fd the str and put newline if bool true.
 
int x_putcd (int fd, char c, bool newline)
 Print to fd the c and put newline if bool true.
 
int x_dprintf (int fd, const char *format,...)
 Print to fd the str format and put newline if bool true.
 

Function Documentation

◆ x_dprintf()

int x_dprintf ( int  fd,
const char *  format,
  ... 
)

Print to fd the str format and put newline if bool true.

Parameters
fdfile descriptor
formatformat as printf
...
Returns
number of character put

◆ x_printf()

int x_printf ( const char *  format,
  ... 
)

put a formated string to stdout (nothing if format = 0)

in formated string: va arg: output %% : (nothing) : % d : int : (the number) i : int : (the number) x : int : (the number in hexa lower case) X : int : (the number in hexa upper case) s : char * : (the string) c : char : (the character) p : void * : (the ptr address in hexa lower case)

Parameters
formatformated string
...(va arg)
Returns

◆ x_putc()

int x_putc ( char  c,
bool  newline 
)

put c to stdout

Parameters
ccharacter to put
newlineif put a newline after c
Returns
number of character put

◆ x_putcd()

int x_putcd ( int  fd,
char  c,
bool  newline 
)

Print to fd the c and put newline if bool true.

Parameters
fdfile descriptor
ccharacter
newlineput newline ?
Returns
number of character put

◆ x_puts()

int x_puts ( const char *  str,
bool  newline 
)

put str to stdout (nothing if str = 0)

Parameters
strstring to put
newlineif put a newline after str
Returns
number of character put

◆ x_putsd()

int x_putsd ( int  fd,
const char *  str,
bool  newline 
)

Print to fd the str and put newline if bool true.

Parameters
fdfile descriptor
strstring
newlineneed to put newline ?
Returns
number of character put

◆ x_sprintf()

char * x_sprintf ( const char *  format,
  ... 
)

like printf but not output the string to stdout, put it in a string

same format as x_printf()

Parameters
format(like x_printf())
...(like x_printf())
Returns
NULL if format = 0;; the string formated

◆ x_vsprintf()

char * x_vsprintf ( const char *  format,
va_list  ap 
)

same as x_sprintf but take a va_list

same format as x_printf()

Parameters
format(like x_printf())
apva_list from stdarg.h
Returns
NULL if format = 0;; the string formated