|
XenevaOS
|


Go to the source code of this file.
Classes | |
| struct | DynBuf |
Macros | |
| #define | likely(x) __builtin_expect(!!(x), 1) |
| #define | unlikely(x) __builtin_expect(!!(x), 0) |
| #define | force_inline inline __attribute__((always_inline)) |
| #define | no_inline __attribute__((noinline)) |
| #define | __maybe_unused __attribute__((unused)) |
| #define | xglue(x, y) x ## y |
| #define | glue(x, y) xglue(x, y) |
| #define | stringify(s) tostring(s) |
| #define | tostring(s) #s |
| #define | offsetof(type, field) ((size_t) &((type *)0)->field) |
| #define | countof(x) (sizeof(x) / sizeof((x)[0])) |
| #define | container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member))) |
| #define | minimum_length(n) n |
| #define | UTF8_CHAR_LEN_MAX 6 |
Typedefs | |
| typedef int | BOOL |
| typedef void * | DynBufReallocFunc(void *opaque, void *ptr, size_t size) |
| typedef struct DynBuf | DynBuf |
Enumerations | |
| enum | { FALSE = 0 , TRUE = 1 } |
Functions | |
| void | pstrcpy (char *buf, int buf_size, const char *str) |
| char * | pstrcat (char *buf, int buf_size, const char *s) |
| int | strstart (const char *str, const char *val, const char **ptr) |
| int | has_suffix (const char *str, const char *suffix) |
| struct | __attribute__ ((packed)) packed_u64 |
| void | dbuf_init (DynBuf *s) |
| void | dbuf_init2 (DynBuf *s, void *opaque, DynBufReallocFunc *realloc_func) |
| int | dbuf_claim (DynBuf *s, size_t len) |
| int | dbuf_put (DynBuf *s, const uint8_t *data, size_t len) |
| int | dbuf_put_self (DynBuf *s, size_t offset, size_t len) |
| int | dbuf_putstr (DynBuf *s, const char *str) |
| int | __dbuf_putc (DynBuf *s, uint8_t c) |
| int | __dbuf_put_u16 (DynBuf *s, uint16_t val) |
| int | __dbuf_put_u32 (DynBuf *s, uint32_t val) |
| int | __dbuf_put_u64 (DynBuf *s, uint64_t val) |
| int | __attribute__ ((format(printf, 2, 3))) dbuf_printf(DynBuf *s |
| int const char void | dbuf_free (DynBuf *s) |
| int | unicode_to_utf8 (uint8_t *buf, unsigned int c) |
| int | unicode_from_utf8 (const uint8_t *p, int max_len, const uint8_t **pp) |
| void | rqsort (void *base, size_t nmemb, size_t size, int(*cmp)(const void *, const void *, void *), void *arg) |
Variables | |
| int const char * | fmt |
| #define __maybe_unused __attribute__((unused)) |
| #define countof | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
| #define force_inline inline __attribute__((always_inline)) |
| #define glue | ( | x, | |
| y | |||
| ) | xglue(x, y) |
| #define likely | ( | x | ) | __builtin_expect(!!(x), 1) |
| #define minimum_length | ( | n | ) | n |
| #define no_inline __attribute__((noinline)) |
| #define offsetof | ( | type, | |
| field | |||
| ) | ((size_t) &((type *)0)->field) |
| #define stringify | ( | s | ) | tostring(s) |
| #define tostring | ( | s | ) | #s |
| #define unlikely | ( | x | ) | __builtin_expect(!!(x), 0) |
| #define UTF8_CHAR_LEN_MAX 6 |
| #define xglue | ( | x, | |
| y | |||
| ) | x ## y |
| typedef int BOOL |
| struct __attribute__ | ( | (packed) | ) |
BSD 2-Clause License
Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| int const char void dbuf_free | ( | DynBuf * | s | ) |
| void dbuf_init | ( | DynBuf * | s | ) |
| void dbuf_init2 | ( | DynBuf * | s, |
| void * | opaque, | ||
| DynBufReallocFunc * | realloc_func | ||
| ) |
| int dbuf_putstr | ( | DynBuf * | s, |
| const char * | str | ||
| ) |
| int has_suffix | ( | const char * | str, |
| const char * | suffix | ||
| ) |
| char * pstrcat | ( | char * | buf, |
| int | buf_size, | ||
| const char * | s | ||
| ) |
| void pstrcpy | ( | char * | buf, |
| int | buf_size, | ||
| const char * | str | ||
| ) |
| void rqsort | ( | void * | base, |
| size_t | nmemb, | ||
| size_t | size, | ||
| int(*)(const void *, const void *, void *) | cmp, | ||
| void * | arg | ||
| ) |
| int strstart | ( | const char * | str, |
| const char * | val, | ||
| const char ** | ptr | ||
| ) |
| int unicode_to_utf8 | ( | uint8_t * | buf, |
| unsigned int | c | ||
| ) |
| int const char* fmt |