Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

test_cfg.c File Reference

#include "gwlib/gwlib.h"

Include dependency graph for test_cfg.c:

Include dependency graph

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 59 of file test_cfg.c.

References cfg_create(), cfg_destroy(), cfg_dump(), cfg_read(), gwlib_init(), gwlib_shutdown(), info(), name, octstr_create, and octstr_destroy().

00060 {
00061     Cfg *cfg;
00062     int ret = 1;
00063     Octstr *name;
00064     int i;
00065     
00066     gwlib_init();
00067 
00068     for (i = 1; i < argc; ++i) {
00069         name = octstr_create(argv[i]);
00070         cfg = cfg_create(name);
00071         octstr_destroy(name);
00072         ret = cfg_read(cfg);
00073         info(0, "cfg_read returned %d", ret);
00074         if (ret == 0)
00075             cfg_dump(cfg);
00076         cfg_destroy(cfg);
00077     }
00078     
00079     info(0, "Shutting down.");
00080     gwlib_shutdown();
00081 
00082     return ret;
00083 }

Here is the call graph for this function:

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.