Import value_string utilities and some RSL stuff from OpenBSC
authorHarald Welte <laforge@gnumonks.org>
Mon, 1 Mar 2010 20:58:31 +0000 (21:58 +0100)
committerHarald Welte <laforge@gnumonks.org>
Mon, 1 Mar 2010 22:48:43 +0000 (23:48 +0100)
include/osmocore/utils.h [new file with mode: 0644]

diff --git a/include/osmocore/utils.h b/include/osmocore/utils.h
new file mode 100644 (file)
index 0000000..cf3b460
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef OSMOCORE_UTIL_H
+#define OSMOCORE_UTIL_H
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#include <stdint.h>
+
+struct value_string {
+       unsigned int value;
+       const char *str;
+};
+
+const char *get_value_string(const struct value_string *vs, uint32_t val);
+int get_string_value(const struct value_string *vs, const char *str);
+
+
+#endif