MOS Source Code
Loading...
Searching...
No Matches
MOS Libraries

A platform-independent library of useful data structures and functions. More...

+ Collaboration diagram for MOS Libraries:

Topics

 libs.HashMap
 A simple hashmap.
 
 libs.LinkedList
 A circular, doubly-linked list.
 
 libs.RingBuffer
 A ring buffer.
 
 libs.DownStack
 A stack that grows down.
 
 libs.AnsiColors
 ANSI color codes.
 
 libs.Stdio
 Standard input/output functions.
 
 libs.Stdlib
 Some standard library functions.
 
 libs.String
 String manipulation functions, similar to the ones in the C standard library.
 

Macros

#define MOS_LIB_ASSERT(cond)
 
#define MOS_LIB_ASSERT_X(cond, msg, ...)
 
#define MOS_LIB_UNIMPLEMENTED(content)
 
#define MOS_LIB_UNREACHABLE()
 
#define mos_panic(fmt, ...)
 
#define mos_warn(fmt, ...)
 

Functions

MOSAPI void (1, 2) fatal_abort(const char *fmt
 

Detailed Description

A platform-independent library of useful data structures and functions.

Macro Definition Documentation

◆ MOS_LIB_ASSERT

#define MOS_LIB_ASSERT ( cond)
Value:
#define MOS_LIB_ASSERT_X(cond, msg,...)

Definition at line 14 of file moslib_global.h.

◆ MOS_LIB_ASSERT_X

#define MOS_LIB_ASSERT_X ( cond,
msg,
... )
Value:
do \
{ \
if (unlikely(!(cond))) \
fatal_abort("Assertion failed: '%s', " msg "\n", #cond, ##__VA_ARGS__); \
} while (0)
#define unlikely(x)
Definition mos_global.h:40

Definition at line 29 of file moslib_global.h.

◆ MOS_LIB_UNIMPLEMENTED

#define MOS_LIB_UNIMPLEMENTED ( content)
Value:
fatal_abort("Unimplemented: %s", content)

Definition at line 38 of file moslib_global.h.

Referenced by vsnprintf().

◆ MOS_LIB_UNREACHABLE

#define MOS_LIB_UNREACHABLE ( )
Value:
fatal_abort("Unreachable code reached")

Definition at line 39 of file moslib_global.h.

◆ mos_panic

#define mos_panic ( fmt,
... )
Value:
fatal_abort(fmt "\n", ##__VA_ARGS__)
u32 const char * fmt
Definition assert.h:36

Definition at line 40 of file moslib_global.h.

◆ mos_warn

#define mos_warn ( fmt,
... )
Value:
fprintf(stderr, "WARN: " fmt "\n", ##__VA_ARGS__)
#define stderr
Definition mos_stdio.h:32

Definition at line 41 of file moslib_global.h.

Function Documentation

◆ void()