1 /*
2 * test-cfg-filelist.c -- testsuite for module_*_config_list family;
3 * everyone feel free to add more tests and improve
4 * existing ones.
5 * (C) 2007-2010 - Francesco Romani <fromani -at- gmail -dot- com>
6 *
7 * This file is part of transcode, a video stream processing tool.
8 *
9 * transcode is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * transcode is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <assert.h>
27
28 #include "config.h"
29 #include "libtc/libtc.h"
30 #include "libtc/cfgfile.h"
31
32
main(int argc,char * argv[])33 int main(int argc, char *argv[])
34 {
35 TCConfigList *list = NULL;
36 const char *filename = NULL, *section = NULL;
37
38 if (argc != 3) {
39 fprintf(stderr, "(%s) usage: %s cfgfile section\n", __FILE__, argv[0]);
40 exit(1);
41 }
42 filename = argv[1];
43 section = argv[2];
44
45 libtc_init(NULL, NULL); /* XXX: dirty! */
46 tc_set_config_dir(""); /* XXX: dirty? */
47 list = module_read_config_list(filename, section, __FILE__);
48 if (!list) {
49 fprintf(stderr, "unable to scan '%s'\n", filename);
50 exit(1);
51 } else {
52 module_print_config_list(list, section, "test");
53 module_free_config_list(list, 0);
54 }
55
56 return 0;
57 }
58
59 /*************************************************************************/
60
61 /*
62 * Local variables:
63 * c-file-style: "stroustrup"
64 * c-file-offsets: ((case-label . *) (statement-case-intro . *))
65 * indent-tabs-mode: nil
66 * End:
67 *
68 * vim: expandtab shiftwidth=4:
69 */
70