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+/src/parse.c between version 1.16 and 1.17

version 1.16, 2002/05/11 14:54:58 version 1.17, 2002/05/30 22:29:45
Line 17 
Line 17 
   
 /* $Id$ */  /* $Id$ */
   
   /* Includes {{{ */
 #include "config.h"  #include "config.h"
   
 #include <stdio.h>  #include <stdio.h>
Line 40 
Line 41 
 #include "cfg+.h"  #include "cfg+.h"
 #include "cmdline.h"  #include "cmdline.h"
 #include "cfgfile.h"  #include "cfgfile.h"
   /* }}} */
   
 /* Processing context options. */  /* Processing context options. */
   
         int          int
 cfg_parse(con)  cfg_parse(con)
         const CFG_CONTEXT con;          const CFG_CONTEXT con;
 {  { /* {{{ */
         register int ret;          register int ret;
   
         while ((ret = cfg_get_next_opt(con)) > 0)          while ((ret = cfg_get_next_opt(con)) > 0)
                 ;                  ;
   
         return ret;          return ret;
 }  } /* }}} */
   
         int          int
 cfg_get_next_opt(con)  cfg_get_next_opt(con)
         const CFG_CONTEXT con;          const CFG_CONTEXT con;
 {  { /* {{{ */
         return con->type == CFG_CMDLINE          return con->type == CFG_CMDLINE
                 ? cfg_cmdline_get_next_opt(con)                  ? cfg_cmdline_get_next_opt(con)
                 : cfg_cfgfile_get_next_opt(con);                  : cfg_cfgfile_get_next_opt(con);
 }  } /* }}} */
   
         char *          char *
 cfg_get_cur_opt(con)  cfg_get_cur_opt(con)
         const CFG_CONTEXT con;          const CFG_CONTEXT con;
 {  { /* {{{ */
         return con->cur_opt;          return con->cur_opt;
 }  } /* }}} */
   
         char *          char *
 cfg_get_cur_arg(con)  cfg_get_cur_arg(con)
         const CFG_CONTEXT con;          const CFG_CONTEXT con;
 {  { /* {{{ */
         return con->cur_arg;          return con->cur_arg;
 }  } /* }}} */
   
         int          int
 cfg_get_cur_idx(con)  cfg_get_cur_idx(con)
         const CFG_CONTEXT con;          const CFG_CONTEXT con;
 {  { /* {{{ */
         return con->type == CFG_CMDLINE          return con->type == CFG_CMDLINE
                 ? con->cur_idx                  ? con->cur_idx
                 : (con->flags & CFG_FILE_LINE_POS_USAGE                  : (con->flags & CFG_FILE_LINE_POS_USAGE
                                 ? con->cur_idx                                  ? con->cur_idx
                                 : (con->fhandle != NULL ? (int) ftell(con->fhandle) : 0));                                  : (con->fhandle != NULL ? (int) ftell(con->fhandle) : 0));
 }  } /* }}} */
   
   /* Modeline for ViM {{{
    * vim:set ts=4:
    * vim600:fdm=marker fdl=0 fdc=0:
    * }}} */
   

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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