blob: 51c6f0357c86ede05d2845e1bdaedfacda2147f5 [file] [log] [blame]
Harald Weltec4362452010-03-22 22:25:13 +08001#ifndef OSMOCORE_UTIL_H
2#define OSMOCORE_UTIL_H
3
4#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
5
6#include <stdint.h>
7
8struct value_string {
9 unsigned int value;
10 const char *str;
11};
12
13const char *get_value_string(const struct value_string *vs, uint32_t val);
14int get_string_value(const struct value_string *vs, const char *str);
15
16char bcd2char(uint8_t bcd);
17/* only works for numbers in ascci */
18uint8_t char2bcd(char c);
19
20#endif