/src/rtpproxy/external/libre/include/re_sys.h
Line | Count | Source (jump to first uncovered line) |
1 | | /** |
2 | | * @file re_sys.h Interface to system module |
3 | | * |
4 | | * Copyright (C) 2010 Creytiv.com |
5 | | */ |
6 | | |
7 | | |
8 | | #ifndef VERSION |
9 | | #define VERSION "?" |
10 | | #endif |
11 | | |
12 | | /** |
13 | | * @def ARCH |
14 | | * |
15 | | * Architecture |
16 | | */ |
17 | | #ifndef ARCH |
18 | | #define ARCH "?" |
19 | | #endif |
20 | | |
21 | | /** |
22 | | * @def OS |
23 | | * |
24 | | * Operating System |
25 | | */ |
26 | | #ifndef OS |
27 | | #ifdef WIN32 |
28 | | #define OS "win32" |
29 | | #else |
30 | | #define OS "?" |
31 | | #endif |
32 | | #endif |
33 | | |
34 | | struct re_printf; |
35 | | int sys_rel_get(uint32_t *rel, uint32_t *maj, uint32_t *min, |
36 | | uint32_t *patch); |
37 | | int sys_kernel_get(struct re_printf *pf, void *unused); |
38 | | int sys_build_get(struct re_printf *pf, void *unused); |
39 | | const char *sys_arch_get(void); |
40 | | const char *sys_os_get(void); |
41 | | const char *sys_libre_version_get(void); |
42 | | const char *sys_username(void); |
43 | | int sys_coredump_set(bool enable); |
44 | | int sys_daemon(void); |
45 | | void sys_usleep(unsigned int us); |
46 | | |
47 | | static inline void sys_msleep(unsigned int ms) |
48 | 0 | { |
49 | 0 | sys_usleep(ms * 1000); |
50 | 0 | } Unexecuted instantiation: attr.c:sys_msleep Unexecuted instantiation: cand.c:sys_msleep Unexecuted instantiation: comp.c:sys_msleep Unexecuted instantiation: endian.c:sys_msleep Unexecuted instantiation: rand.c:sys_msleep Unexecuted instantiation: stun.c:sys_msleep Unexecuted instantiation: stunsrv.c:sys_msleep Unexecuted instantiation: util.c:sys_msleep |
51 | | |
52 | | |
53 | | uint16_t sys_htols(uint16_t v); |
54 | | uint32_t sys_htoll(uint32_t v); |
55 | | uint16_t sys_ltohs(uint16_t v); |
56 | | uint32_t sys_ltohl(uint32_t v); |
57 | | uint64_t sys_htonll(uint64_t v); |
58 | | uint64_t sys_ntohll(uint64_t v); |
59 | | |
60 | | |
61 | | /* Random */ |
62 | | void rand_init(void); |
63 | | uint16_t rand_u16(void); |
64 | | uint32_t rand_u32(void); |
65 | | uint64_t rand_u64(void); |
66 | | char rand_char(void); |
67 | | void rand_str(char *str, size_t size); |
68 | | void rand_bytes(uint8_t *p, size_t size); |
69 | | |
70 | | |
71 | | /* File-System */ |
72 | | int fs_mkdir(const char *path, uint16_t mode); |
73 | | int fs_gethome(char *path, size_t sz); |