MOS Source Code
Loading...
Searching...
No Matches
mos_stdio_impl.c File Reference
#include <mos/mos_global.h>
#include <mos/moslib_global.h>
#include <mos_stdio.h>
#include <mos_stdlib.h>
#include <mos_string.h>
+ Include dependency graph for mos_stdio_impl.c:

Go to the source code of this file.

Classes

struct  printf_flags_t
 
struct  va_list_ptrwrappper_t
 

Macros

#define goto_next_char()
 
#define current   (*format)
 
#define wrap_printed(x)
 

Enumerations

enum  length_modifier_t {
  LM_none , LM_hh , LM__h , LM__l ,
  LM_ll , LM__L , LM__j , LM__z ,
  LM__t
}
 

Functions

static size_t parse_printf_flags (const char *format, printf_flags_t *pflags, va_list_ptrwrappper_t *args)
 
should_inline __nodiscard int buf_putchar (char *buf, char c, size_t *size_left)
 
static int printf_diouxX (char *buf, u64 number, printf_flags_t *pflags, char conv, size_t *size_left)
 
static int printf_cs (char *buf, const char *data, printf_flags_t *pflags, char conv, size_t *psize_left)
 
int vsnprintf (char *buf, size_t size, const char *format, va_list _args)
 

Variables

static const char *const lower_hex_digits = "0123456789abcdef"
 
static const char *const upper_hex_digits = "0123456789ABCDEF"
 

Macro Definition Documentation

◆ goto_next_char

#define goto_next_char ( )
Value:
(format++)
MOSAPI const char *__restrict format
Definition mos_stdio.h:17

Referenced by parse_printf_flags().

◆ current

◆ wrap_printed

#define wrap_printed ( x)
Value:
do \
{ \
const size_t _printed = x; \
buf += _printed, ret += _printed; \
} while (0)

Definition at line 204 of file mos_stdio_impl.c.

Referenced by printf_cs(), printf_diouxX(), and vsnprintf().

Enumeration Type Documentation

◆ length_modifier_t

Enumerator
LM_none 
LM_hh 
LM__h 
LM__l 
LM_ll 
LM__L 
LM__j 
LM__z 
LM__t 

Definition at line 9 of file mos_stdio_impl.c.

Function Documentation

◆ parse_printf_flags()

static size_t parse_printf_flags ( const char * format,
printf_flags_t * pflags,
va_list_ptrwrappper_t * args )
static

Definition at line 67 of file mos_stdio_impl.c.

Referenced by vsnprintf().

◆ buf_putchar()

should_inline __nodiscard int buf_putchar ( char * buf,
char c,
size_t * size_left )

Definition at line 190 of file mos_stdio_impl.c.

Referenced by printf_cs(), printf_diouxX(), and vsnprintf().

◆ printf_diouxX()

static int printf_diouxX ( char * buf,
u64 number,
printf_flags_t * pflags,
char conv,
size_t * size_left )
static

Definition at line 212 of file mos_stdio_impl.c.

Referenced by vsnprintf().

+ Here is the call graph for this function:

◆ printf_cs()

static int printf_cs ( char * buf,
const char * data,
printf_flags_t * pflags,
char conv,
size_t * psize_left )
static

Definition at line 389 of file mos_stdio_impl.c.

Referenced by vsnprintf().

+ Here is the call graph for this function:

◆ vsnprintf()

int vsnprintf ( char * buf,
size_t size,
const char * format,
va_list _args )

Definition at line 455 of file mos_stdio_impl.c.

+ Here is the call graph for this function:

Variable Documentation

◆ lower_hex_digits

const char* const lower_hex_digits = "0123456789abcdef"
static

Definition at line 201 of file mos_stdio_impl.c.

Referenced by printf_diouxX().

◆ upper_hex_digits

const char* const upper_hex_digits = "0123456789ABCDEF"
static

Definition at line 202 of file mos_stdio_impl.c.

Referenced by printf_diouxX().