]> git.street.me.uk Git - andy/viking.git/blob - test/test_babel.c
Merge commit 'ToolbarConfig'
[andy/viking.git] / test / test_babel.c
1 // Decide the Babel file types capability you wish to list
2 // e.g. for read support of waypoints, tracks and routes:
3 // run like: ./test_babel 1 0 1 0 1 0
4 #include <stdlib.h>
5 #include <babel.h>
6
7 static void print_file_format (gpointer data, gpointer user_data)
8 {
9         BabelFile *file = (BabelFile*)data;
10         printf("%s : %d%d%d%d%d%d\n",
11                 file->label,
12                 file->mode.waypointsRead, file->mode.waypointsWrite,
13                 file->mode.tracksRead, file->mode.tracksWrite,
14                 file->mode.routesRead, file->mode.routesWrite);
15 }
16
17 int main(int argc, char*argv[])
18 {
19         a_babel_init();
20
21         if (argc != 7) return 1;
22         BabelMode mode = { atoi(argv[1]),atoi(argv[2]),atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),atoi(argv[6]) };
23         a_babel_foreach_file_with_mode(mode, print_file_format, NULL);
24
25         a_babel_uninit();
26
27         return 0;
28 }
29