XenevaOS
Loading...
Searching...
No Matches
clib.h
Go to the documentation of this file.
1
30#ifndef __CLIB_H__
31#define __CLIB_H__
32
33
34#include <stdint.h>
35
36#ifdef __cplusplus
37extern "C"
38{
39#endif
40
41
42 typedef unsigned char* va_list;
43
44#define STACKITEM 8
45
46#define VA_SIZE(TYPE) \
47 ((sizeof(TYPE) + sizeof(STACKITEM) - 1) \
48 & ~(sizeof(STACKITEM) - 1))
49
50#define va_start(AP, LASTARG) \
51 (AP=((va_list)&(LASTARG) + VA_SIZE(LASTARG)))
52
53#define va_end(AP)
54
55#define va_arg(AP, TYPE) \
56 (AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
57
58
59
60#ifdef __cplusplus
61}
62#endif
63
64
65extern void memset(void* targ, uint8_t val, uint32_t len);
66extern void memcpy(void* targ, void* src, uint32_t len);
67extern wchar_t* wstrchr(wchar_t* s, int c);
68extern int wstrlen(wchar_t* s);
69extern uint32_t wstrsize(wchar_t* s);
70extern int to_upper(int c);
71extern int to_lower(int c);
72extern int is_digit(int c);
73extern char* sztoa(size_t value, char* str, int base);
74extern size_t strlen(const char* s);
75#endif
76
77
unsigned char * va_list
Definition clib.h:42
uint32_t wstrsize(wchar_t *s)
Definition clib.cpp:84
char * sztoa(size_t value, char *str, int base)
Definition clib.cpp:107
void memset(void *targ, uint8_t val, uint32_t len)
Definition clib.cpp:34
int to_lower(int c)
Definition clib.cpp:94
size_t strlen(const char *s)
Definition utclib.c:379
void memcpy(void *targ, void *src, uint32_t len)
Definition clib.cpp:58
wchar_t * wstrchr(wchar_t *s, int c)
Definition clib.cpp:66
int is_digit(int c)
Definition clib.cpp:100
int wstrlen(wchar_t *s)
Definition clib.cpp:77
int to_upper(int c)
Definition clib.cpp:88
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161