Annotation of libaitcfg/example/test_av2.c, revision 1.1.2.1
1.1.2.1 ! misho 1: #include <stdio.h>
! 2: #include <aitcfg.h>
! 3:
! 4:
! 5: int
! 6: main(int argc, char **argv)
! 7: {
! 8: cfg_root_t cfg;
! 9: FILE *f;
! 10:
! 11: if (cfgInitConfig(&cfg)) {
! 12: printf("Error:: #%d - %s\n", cfg_GetErrno(), cfg_GetError());
! 13: return 1;
! 14: }
! 15:
! 16: f = fopen("test_lines.txt", "r");
! 17: if (!f) {
! 18: cfgUnloadConfig(&cfg);
! 19: return 2;
! 20: } else {
! 21: cfgReadLines(f, ":", "\r\n", &cfg);
! 22: fclose(f);
! 23: }
! 24:
! 25: cfgWriteConfig(stdout, &cfg, 0);
! 26: cfgUnloadConfig(&cfg);
! 27: return 0;
! 28: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>