MOS Source Code
Loading...
Searching...
No Matches
libs.Stdlib

Some standard library functions. More...

+ Collaboration diagram for libs.Stdlib:

Macros

#define MIN(a, b)
 
#define MAX(a, b)
 

Functions

MOSAPI unsigned char tolower (unsigned char c)
 
MOSAPI s32 abs (s32 x)
 
MOSAPI long labs (long x)
 
MOSAPI s64 llabs (s64 x)
 
MOSAPI s32 atoi (const char *nptr)
 
MOSAPI unsigned long strtoul (const char *nptr, char **endptr, int base)
 
MOSAPI s64 strtoll (const char *str, char **endptr, int base)
 
MOSAPI s64 strntoll (const char *str, char **endptr, int base, size_t n)
 
MOSAPI void format_size (char *buf, size_t buf_size, u64 size)
 
MOSAPI char * string_trim (char *in)
 
MOSAPI void exit (int status) __attribute__((noreturn))
 
MOSAPI int atexit (void(*func)(void))
 
MOSAPI tid_t start_thread (const char *name, thread_entry_t entry, void *arg)
 
MOSAPI void abort (void) __attribute__((noreturn))
 

Detailed Description

Some standard library functions.

Macro Definition Documentation

◆ MIN

#define MIN ( a,
b )
Value:
__extension__ ({ const auto _a = (a); __auto_type _b = (b); _a < _b ? _a : _b; })

Definition at line 36 of file mos_stdlib.hpp.

◆ MAX

#define MAX ( a,
b )
Value:
__extension__ ({ const auto _a = (a); __auto_type _b = (b); _a > _b ? _a : _b; })

Definition at line 37 of file mos_stdlib.hpp.

Function Documentation

◆ tolower()

MOSAPI unsigned char tolower ( unsigned char c)

Definition at line 13 of file mos_stdlib.cpp.

Referenced by strncasecmp().

◆ abs()

MOSAPI s32 abs ( s32 x)

Definition at line 25 of file mos_stdlib.cpp.

◆ labs()

MOSAPI long labs ( long x)

Definition at line 30 of file mos_stdlib.cpp.

◆ llabs()

MOSAPI s64 llabs ( s64 x)

Definition at line 35 of file mos_stdlib.cpp.

◆ atoi()

MOSAPI s32 atoi ( const char * nptr)

Definition at line 40 of file mos_stdlib.cpp.

Referenced by encode_dictionary(), encode_tree(), and main().

+ Here is the call graph for this function:

◆ strtoul()

MOSAPI unsigned long strtoul ( const char * nptr,
char ** endptr,
int base )

Referenced by main(), and overlay_fixup_phandle().

◆ strtoll()

MOSAPI s64 strtoll ( const char * str,
char ** endptr,
int base )

Definition at line 72 of file mos_stdlib.cpp.

Referenced by strtoul().

+ Here is the call graph for this function:

◆ strntoll()

MOSAPI s64 strntoll ( const char * str,
char ** endptr,
int base,
size_t n )

◆ format_size()

MOSAPI void format_size ( char * buf,
size_t buf_size,
u64 size )

Definition at line 107 of file mos_stdlib.cpp.

Referenced by mmstat_sysfs_stat().

+ Here is the call graph for this function:

◆ string_trim()

MOSAPI char * string_trim ( char * in)

Definition at line 128 of file mos_stdlib.cpp.

+ Here is the call graph for this function:

◆ exit()

MOSAPI void exit ( int status)

◆ atexit()

MOSAPI int atexit ( void(* func )(void))

◆ start_thread()

MOSAPI tid_t start_thread ( const char * name,
thread_entry_t entry,
void * arg )

◆ abort()

MOSAPI void abort ( void )

Definition at line 28 of file cpp_support.cpp.