Translation update done using Pootle.
[gammu.git] / tests / config.c
blob85794c06bae8a1cce5844528c2eb962ecaed93e2
1 /**
2 * Config file parsing tests.
3 */
5 #include <gammu.h>
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <string.h>
9 #include "common.h"
11 int main(int argc, char **argv)
13 GSM_Error error;
14 GSM_Config cfg = { "", "", NULL, NULL, FALSE, FALSE, NULL, FALSE, FALSE, "", "", "", "", "", {0} };
15 INI_Section *ini = NULL;
17 /* Check parameters */
18 if (argc != 2) {
19 printf("Not enough parameters!\nUsage: config config_file\n");
20 return 1;
23 error = GSM_FindGammuRC(&ini, argv[1]);
24 gammu_test_result(error, "GSM_FindGammuRC");
26 error = GSM_ReadConfig(ini, &cfg, 0);
27 gammu_test_result(error, "GSM_ReadConfig");
29 /* Free config file structures */
30 INI_Free(ini);
32 printf("DEBUG_LEVEL: '%s'\n", cfg.DebugLevel);
34 free(cfg.Device);
35 free(cfg.Connection);
36 free(cfg.DebugFile);
38 return 0;