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+/examples/Attic/example.c between version 1.1 and 1.2

version 1.1, 2002/05/28 16:01:41 version 1.2, 2002/05/29 15:09:17
Line 18 
Line 18 
 /* $Id$ */  /* $Id$ */
   
 #include <stdio.h>  #include <stdio.h>
   #include <unistd.h>
 #include <errno.h>  #include <errno.h>
 #include <sys/resource.h>  #include <sys/resource.h>
   
Line 68  int main(int argc, char **argv)
Line 69  int main(int argc, char **argv)
         ret = cfg_parse(con);          ret = cfg_parse(con);
   
         if (ret != CFG_OK) {          if (ret != CFG_OK) {
                   printf("error parsing command line: ");
                 cfg_fprint_error(con, stdout);                  cfg_fprint_error(con, stdout);
                 putchar('\n');                  putchar('\n');
   
                 return ret < 0 ? -ret : ret;                  return ret < 0 ? -ret : ret;
         }          }
   
Line 91  int main(int argc, char **argv)
Line 92  int main(int argc, char **argv)
                 return 1;                  return 1;
         }          }
   
           /* Config file testing */
           if (cfg_file != NULL) {
                   cfg_set_cfgfile_context(con, 0, 0, cfg_file);
   
                   /* Parsing config line */
                   ret = cfg_parse(con);
   
                   if (ret != CFG_OK) {
                           printf("error parsing config file: ");
                           cfg_fprint_error(con, stdout);
                           putchar('\n');
                           return ret < 0 ? -ret : ret;
                   }
           }
   
         /* Testing if command to run was specified */          /* Testing if command to run was specified */
         if (command == NULL) {          if (command == NULL) {
                 puts("error: you must specify program to run");                  puts("error: you must specify program to run");
Line 106  int main(int argc, char **argv)
Line 122  int main(int argc, char **argv)
                         printf("warning: unable to set priority (nice) to %d\n", nice);                          printf("warning: unable to set priority (nice) to %d\n", nice);
         }          }
   
           /* Verbose running info */
           if (verbose) {
                   register int i;
                   printf("info: running");
                   for (i = 0; command[i] != NULL; i++)
                           printf("[%s]", command[i]);
                   putchar('\n');
           }
   
         execvp(command[0], command);          execvp(command[0], command);
   
         perror("error running program");          perror("error running program");
Line 118  int main(int argc, char **argv)
Line 143  int main(int argc, char **argv)
  * vim600:fdm=marker fdl=0 fdc=0:   * vim600:fdm=marker fdl=0 fdc=0:
  * }}} */   * }}} */
   
   

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