blob: ec58816b2c026b70c56da5948f8d3affc9f73a4b [file] [log] [blame]
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +08001/*
2 * (C) 2010 by Holger Hans Peter Freyther
3 * (C) 2010 by On-Waves
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080016 */
17
Pablo Neira Ayuso83419342011-03-22 16:36:13 +010018#include <osmocom/core/msgfile.h>
Jan Engelhardt1a632552014-10-04 11:06:13 +020019#include <osmocom/core/talloc.h>
Vadim Yanitskiy225fd1b2024-04-22 09:12:39 +070020#include <osmocom/core/utils.h>
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080021
22#include <stdio.h>
23
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020024static void dump_entries(struct osmo_config_list *entries)
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080025{
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020026 struct osmo_config_entry *entry;
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080027
28 if (!entries) {
29 fprintf(stderr, "Failed to parse the file\n");
30 return;
31 }
32
33 llist_for_each_entry(entry, &entries->entry, list) {
34 printf("Entry '%s:%s:%s:%s'\n",
35 entry->mcc, entry->mnc, entry->option, entry->text);
36 }
37}
38
39int main(int argc, char **argv)
40{
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020041 struct osmo_config_list *entries;
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080042
Vadim Yanitskiy225fd1b2024-04-22 09:12:39 +070043 OSMO_ASSERT(argc > 1);
44 entries = osmo_config_list_parse(NULL, argv[1]);
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080045 dump_entries(entries);
Holger Hans Peter Freyther8d950ea2014-08-29 14:19:20 +020046 talloc_free(entries);
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080047
48 return 0;
49}