aboutsummaryrefslogtreecommitdiffstats
path: root/libosmocore/src/utils.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-28 09:44:26 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-28 09:44:26 +0200
commitbf51438a8aeaa67076e209587b83cafe6c4fa4d2 (patch)
tree23ccc827f6ad1a3fddd97fe66ed9b45342ea8df0 /libosmocore/src/utils.c
parent900aeaf41539a0577f33b501b2cc0c525ce4ce34 (diff)
remove libosmocore from openbsc.git
The idea was great, but it never really worked in reality...
Diffstat (limited to 'libosmocore/src/utils.c')
-rw-r--r--libosmocore/src/utils.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/libosmocore/src/utils.c b/libosmocore/src/utils.c
deleted file mode 100644
index 4dab06455..000000000
--- a/libosmocore/src/utils.c
+++ /dev/null
@@ -1,50 +0,0 @@
-
-#include <string.h>
-#include <stdint.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include <osmocore/utils.h>
-
-static char namebuf[255];
-const char *get_value_string(const struct value_string *vs, uint32_t val)
-{
- int i;
-
- for (i = 0;; i++) {
- if (vs[i].value == 0 && vs[i].str == NULL)
- break;
- if (vs[i].value == val)
- return vs[i].str;
- }
-
- snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val);
- return namebuf;
-}
-
-int get_string_value(const struct value_string *vs, const char *str)
-{
- int i;
-
- for (i = 0;; i++) {
- if (vs[i].value == 0 && vs[i].str == NULL)
- break;
- if (!strcasecmp(vs[i].str, str))
- return vs[i].value;
- }
- return -EINVAL;
-}
-
-char bcd2char(uint8_t bcd)
-{
- if (bcd < 0xa)
- return '0' + bcd;
- else
- return 'A' + (bcd - 0xa);
-}
-
-/* only works for numbers in ascci */
-uint8_t char2bcd(char c)
-{
- return c - 0x30;
-}