*
*/
-#include <osmocore/msgfile.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/msgfile.h>
+#include <osmocom/core/talloc.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
-static struct msg_entry *alloc_entry(struct msg_entries *entries,
- const char *mcc, const char *mnc,
- const char *option, const char *text)
+static struct osmo_config_entry *
+alloc_entry(struct osmo_config_list *entries,
+ const char *mcc, const char *mnc,
+ const char *option, const char *text)
{
- struct msg_entry *entry = talloc_zero(entries, struct msg_entry);
+ struct osmo_config_entry *entry =
+ talloc_zero(entries, struct osmo_config_entry);
if (!entry)
return NULL;
return entry;
}
-static struct msg_entries *alloc_entries(void *ctx)
+static struct osmo_config_list *alloc_entries(void *ctx)
{
- struct msg_entries *entries;
+ struct osmo_config_list *entries;
- entries = talloc_zero(ctx, struct msg_entries);
+ entries = talloc_zero(ctx, struct osmo_config_list);
if (!entries)
return NULL;
/*
* split a line like 'foo:Text'.
*/
-static void handle_line(struct msg_entries *entries, char *line)
+static void handle_line(struct osmo_config_list *entries, char *line)
{
int i;
const int len = strlen(line);
char *items[3];
int last_item = 0;
+ /* Skip comments from the file */
+ if (line[0] == '#')
+ return;
+
for (i = 0; i < len; ++i) {
if (line[i] == '\n' || line[i] == '\r')
line[i] = '\0';
/* nothing found */
}
-struct msg_entries *msg_entry_parse(void *ctx, const char *filename)
+struct osmo_config_list *osmo_config_list_parse(void *ctx, const char *filename)
{
- struct msg_entries *entries;
+ struct osmo_config_list *entries;
size_t n;
char *line;
FILE *file;