Go to the documentation of this file.
5 #if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
10 # define __attribute__(_arg_)
11 # define __deprecated__
22 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
24 #define OSMO_MAX(a, b) ((a) >= (b) ? (a) : (b))
26 #define OSMO_MIN(a, b) ((a) >= (b) ? (b) : (a))
30 #define OSMO_STRINGIFY(x) #x
32 #define OSMO_STRINGIFY_VAL(x) OSMO_STRINGIFY(x)
34 #define OSMO_VALUE_STRING(x) { x, #x }
36 #define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8)
58 int osmo_hexparse(
const char *str, uint8_t *b,
int max_len);
65 #define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1] __attribute__((__unused__));
70 #define OSMO_SNPRINTF_RET(ret, rem, offset, len) \
84 #define OSMO_ASSERT(exp) \
86 fprintf(stderr, "Assert failed %s %s:%d\n", #exp, __BASE_FILE__, __LINE__); \
bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, bool require_even)
uint8_t osmo_char2bcd(char c)
char * osmo_osmo_hexdump_nospc(const unsigned char *buf, int len) __attribute__((__deprecated__))
void osmo_str2lower(char *out, const char *in)
uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len)
enum gsm48_chan_mode __attribute__
bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars)
const char * osmo_escape_str(const char *str, int len)
int get_string_value(const struct value_string *vs, const char *str)
size_t osmo_strlcpy(char *dst, const char *src, size_t siz)
unsigned int value
Definition: utils.h:44
const char * get_value_string_or_null(const struct value_string *vs, uint32_t val)
char * osmo_ubit_dump(const uint8_t *bits, unsigned int len)
const char * str
Definition: utils.h:45
char * osmo_hexdump_nospc(const unsigned char *buf, int len)
bool osmo_identifier_valid(const char *str)
char osmo_bcd2char(uint8_t bcd)
const char * osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize)
uint8_t data[0]
Definition: gsm_04_08.h:3
char * osmo_hexdump(const unsigned char *buf, int len)
int osmo_constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count)
void osmo_str2upper(char *out, const char *in)
uint8_t * osmo_encode_big_endian(uint64_t value, size_t data_len)