1 | #ifndef OSCAM_STRING_H_
|
---|
2 | #define OSCAM_STRING_H_
|
---|
3 |
|
---|
4 | bool cs_malloc(void *result, size_t size) MUST_CHECK_RESULT;
|
---|
5 | bool cs_realloc(void *result, size_t size) MUST_CHECK_RESULT;
|
---|
6 | char *cs_strdup(const char *str);
|
---|
7 |
|
---|
8 | void cs_strncpy(char *destination, const char *source, size_t num);
|
---|
9 | char *strtolower(char *txt);
|
---|
10 | char *strtoupper(char *txt);
|
---|
11 | char *trim(char *txt);
|
---|
12 | char *remove_white_chars(char *txt);
|
---|
13 | bool streq(const char *s1, const char *s2);
|
---|
14 |
|
---|
15 | char *cs_hexdump(int32_t m, const uchar *buf, int32_t n, char *target, int32_t len);
|
---|
16 |
|
---|
17 | int32_t gethexval(char c);
|
---|
18 |
|
---|
19 | int32_t cs_atob(uchar *buf, char *asc, int32_t n);
|
---|
20 | uint32_t cs_atoi(char *asc, int32_t l, int32_t val_on_err);
|
---|
21 | int32_t byte_atob(char *asc);
|
---|
22 | int32_t word_atob(char *asc);
|
---|
23 | int32_t dyn_word_atob(char *asc);
|
---|
24 | int32_t key_atob_l(char *asc, uchar *bin, int32_t l);
|
---|
25 | uint32_t b2i(int32_t n, const uchar *b);
|
---|
26 | uint64_t b2ll(int32_t n, uchar *b);
|
---|
27 | uchar *i2b_buf(int32_t n, uint32_t i, uchar *b);
|
---|
28 | uint32_t a2i(char *asc, int32_t bytes);
|
---|
29 |
|
---|
30 | int32_t boundary(int32_t exp, int32_t n);
|
---|
31 |
|
---|
32 | int32_t check_filled(uchar *value, int32_t length);
|
---|
33 |
|
---|
34 | void get_random_bytes_init(void);
|
---|
35 | void get_random_bytes(uint8_t *dst, uint32_t dst_len);
|
---|
36 |
|
---|
37 | unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len);
|
---|
38 | uint32_t jhash(const char *key, size_t len);
|
---|
39 |
|
---|
40 | char to_hex(char code);
|
---|
41 | void char_to_hex(const unsigned char *p_array, uint32_t p_array_len, unsigned char *result);
|
---|
42 |
|
---|
43 | #endif
|
---|