blob: ed7aa9782ece8524a71999ea5f962d6499fc2430 [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 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 */
21
Pablo Neira Ayuso83419342011-03-22 16:36:13 +010022#include <osmocom/core/msgfile.h>
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080023
24#include <stdio.h>
25
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020026static void dump_entries(struct osmo_config_list *entries)
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080027{
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020028 struct osmo_config_entry *entry;
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080029
30 if (!entries) {
31 fprintf(stderr, "Failed to parse the file\n");
32 return;
33 }
34
35 llist_for_each_entry(entry, &entries->entry, list) {
36 printf("Entry '%s:%s:%s:%s'\n",
37 entry->mcc, entry->mnc, entry->option, entry->text);
38 }
39}
40
41int main(int argc, char **argv)
42{
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020043 struct osmo_config_list *entries;
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080044
45 /* todo use msgfile_test.c.in and replace the path */
Pablo Neira Ayuso1b4a42c2011-05-07 13:01:41 +020046 entries = osmo_config_list_parse(NULL, "msgconfig.cfg");
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080047 dump_entries(entries);
48
49 return 0;
50}