Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for libcfg+/doc/examples/example.c between version 1.1 and 1.2

version 1.1, 2002/07/15 15:37:05 version 1.2, 2002/07/16 13:43:18
Line 46  int main(int argc, char **argv)
Line 46  int main(int argc, char **argv)
                 {"verbose", 'v',  "verbose", CFG_BOOL+CFG_MULTI, (void *) &verbose,  0},                  {"verbose", 'v',  "verbose", CFG_BOOL+CFG_MULTI, (void *) &verbose,  0},
                 {NULL,      'f',  NULL,      CFG_STRING,         (void *) &cfg_file, 0},                  {NULL,      'f',  NULL,      CFG_STRING,         (void *) &cfg_file, 0},
                 {"nice",    'n',  "nice",    CFG_INT,            (void *) &nice,     0},                  {"nice",    'n',  "nice",    CFG_INT,            (void *) &nice,     0},
                 {NULL,      '\0', "command", CFG_STRING+CFG_MULTI+CFG_LEFTOVER_ARGS,                  {NULL,      '\0', "command", CFG_STRING+CFG_MULTI_SEPARATED+CFG_LEFTOVER_ARGS,
                         (void *) &command, 0},                          (void *) &command, 0},
                         CFG_END_OF_LIST                          CFG_END_OF_LIST
         };          };
Line 58  int main(int argc, char **argv)
Line 58  int main(int argc, char **argv)
                 return 1;                  return 1;
         }          }
   
         cfg_set_cmdline_context(con, argc, argv);          /* Parse command line from second argument to end (NULL) */
           cfg_set_cmdline_context(con, 1, -1, argv);
   
         /* Clearing option variables */          /* Clearing option variables */
         help     = 0;          help     = 0;
Line 96  int main(int argc, char **argv)
Line 97  int main(int argc, char **argv)
   
         /* Config file testing */          /* Config file testing */
         if (cfg_file != NULL) {          if (cfg_file != NULL) {
                 cfg_set_cfgfile_context(con, 0, 0, cfg_file);                  /* Parse configuration file from the first line to end of file */
                   cfg_set_cfgfile_context(con, 0, -1, cfg_file);
   
                 /* Parsing config line */                  /* Parsing config line */
                 ret = cfg_parse(con);                  ret = cfg_parse(con);
Line 129  int main(int argc, char **argv)
Line 131  int main(int argc, char **argv)
                 register int i;                  register int i;
                 printf("info: running");                  printf("info: running");
                 for (i = 0; command[i] != NULL; i++)                  for (i = 0; command[i] != NULL; i++)
                         printf("[%s]", command[i]);                          printf(" %s", command[i]);
                 putchar('\n');                  putchar('\n');
         }          }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top