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/props.c between version 1.27 and 1.28

version 1.27, 2002/08/27 13:19:18 version 1.28, 2002/09/05 19:08:25
Line 48  char *cfg_default_properties[CFG_N_PROPS
Line 48  char *cfg_default_properties[CFG_N_PROPS
         /* CFG_FILE_LEFTOVER_MULTI_VALS_SEPARATOR */    { " ",  NULL, NULL, NULL },          /* CFG_FILE_LEFTOVER_MULTI_VALS_SEPARATOR */    { " ",  NULL, NULL, NULL },
         /* CFG_FILE_QUOTE_PREFIX */                                             { "\"", "'",  NULL, NULL },          /* CFG_FILE_QUOTE_PREFIX */                                             { "\"", "'",  NULL, NULL },
         /* CFG_FILE_QUOTE_POSTFIX */                                    { "\"", "'",  NULL, NULL },          /* CFG_FILE_QUOTE_POSTFIX */                                    { "\"", "'",  NULL, NULL },
 }; /* }}} */          }; /* }}} */
   
 /*  /*
  * Static functions for strdyn manipulation   * Static functions for strdyn manipulation
Line 144  cfg_get_context_flags(con)
Line 144  cfg_get_context_flags(con)
 } /* }}} */  } /* }}} */
   
 /*  /*
  * Functions for multi values separator manipulation.   * Macros
  */   */
   
 #define cfg_normal_property_type(type) ((type) >= 0 && (type) < CFG_N_PROPS)  #define cfg_normal_property_type(type) ((type) >= 0 && (type) < CFG_N_PROPS)
 #define cfg_virtual_property_type(type) ((type) > CFG_N_PROPS)  #define cfg_virtual_property_type(type) ((type) > CFG_N_PROPS)
   
 /*  /*
  * Clear   * Clear functions
  */   */
   
         int          int
Line 228  cfg_clear_property(con, type)
Line 228  cfg_clear_property(con, type)
         return 0; /* failure */          return 0; /* failure */
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_clear_properties(  cfg_clear_properties(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         enum cfg_property_type type, ...)                  enum cfg_property_type type, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         enum cfg_property_type tmp_type;          enum cfg_property_type tmp_type;
Line 241  cfg_clear_properties(
Line 241  cfg_clear_properties(
         tmp_type = type;          tmp_type = type;
         va_start(ap, type);          va_start(ap, type);
   
         /* argument list must be termited with typeN = CFG_EOF */          /* argument list must be termited with typeN = CFG_EOT */
         while (tmp_type != CFG_EOF) {          while (tmp_type != CFG_EOT) {
                 ret &= cfg_clear_property(con, tmp_type);                  ret &= cfg_clear_property(con, tmp_type);
                 if (!ret)                  if (!ret)
                         break;                          break;
Line 256  cfg_clear_properties(
Line 256  cfg_clear_properties(
 } /* }}} */  } /* }}} */
   
 /*  /*
  * Add   * Add functions
  */   */
   
         int          int
Line 343  cfg_add_property(con, type, str)
Line 343  cfg_add_property(con, type, str)
         return 0; /* failure */          return 0; /* failure */
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_add_properties(  cfg_add_properties(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         enum cfg_property_type type,                  enum cfg_property_type type,
         char *str, ...)                  char *str, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         enum cfg_property_type tmp_type;          enum cfg_property_type tmp_type;
Line 359  cfg_add_properties(
Line 359  cfg_add_properties(
         tmp_str  = str;          tmp_str  = str;
         va_start(ap, str);          va_start(ap, str);
   
         /* argument list must be termited with typeN = CFG_EOF or          /* argument list must be termited with typeN = CFG_EOT or
          * str = NULL           * str = NULL
          */           */
         while (tmp_type != CFG_EOF && tmp_str != NULL) {          while (tmp_type != CFG_EOT && tmp_str != NULL) {
                 ret &= cfg_add_property(con, tmp_type, tmp_str);                  ret &= cfg_add_property(con, tmp_type, tmp_str);
                 if (!ret)                  if (!ret)
                         break;                          break;
                 tmp_type = va_arg(ap, enum cfg_property_type);                  tmp_type = va_arg(ap, enum cfg_property_type);
                 if (tmp_type == CFG_EOF) /* if typeN == CFG_EOF, strN may be not specified! */                  if (tmp_type == CFG_EOT) /* if typeN == CFG_EOT, strN may be not specified! */
                         break;                          break;
                 tmp_str  = va_arg(ap, char *);                  tmp_str  = va_arg(ap, char *);
         }          }
Line 378  cfg_add_properties(
Line 378  cfg_add_properties(
         return ret;          return ret;
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_add_properties_str(  cfg_add_properties_str(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         char *str,                  char *str,
         enum cfg_property_type type, ...)                  enum cfg_property_type type, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         enum cfg_property_type tmp_type;          enum cfg_property_type tmp_type;
Line 392  cfg_add_properties_str(
Line 392  cfg_add_properties_str(
         tmp_type = type;          tmp_type = type;
         va_start(ap, type);          va_start(ap, type);
   
         /* argument list must be termited with typeN = CFG_EOF or */          /* argument list must be termited with typeN = CFG_EOT or */
         if (str != NULL)          if (str != NULL)
                 while (tmp_type != CFG_EOF) {                  while (tmp_type != CFG_EOT) {
                         ret &= cfg_add_property(con, tmp_type, str);                          ret &= cfg_add_property(con, tmp_type, str);
                         if (!ret)                          if (!ret)
                                 break;                                  break;
Line 407  cfg_add_properties_str(
Line 407  cfg_add_properties_str(
         return ret;          return ret;
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_add_properties_type(  cfg_add_properties_type(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         enum cfg_property_type type,                  enum cfg_property_type type,
         char *str, ...)                  char *str, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         char * tmp_str;          char * tmp_str;
Line 422  cfg_add_properties_type(
Line 422  cfg_add_properties_type(
         va_start(ap, str);          va_start(ap, str);
   
         /* argument list must be termited with str = NULL */          /* argument list must be termited with str = NULL */
         if (type != CFG_EOF)          if (type != CFG_EOT)
                 while (tmp_str != NULL) {                  while (tmp_str != NULL) {
                         ret &= cfg_add_property(con, type, tmp_str);                          ret &= cfg_add_property(con, type, tmp_str);
                         if (!ret)                          if (!ret)
Line 437  cfg_add_properties_type(
Line 437  cfg_add_properties_type(
 } /* }}} */  } /* }}} */
   
 /*  /*
  * Remove   * Remove functions
  */   */
   
         int          int
Line 524  cfg_remove_property(con, type, str)
Line 524  cfg_remove_property(con, type, str)
         return 0; /* failure */          return 0; /* failure */
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_remove_properties( /* code same like cfg_add_properties() */  cfg_remove_properties( /* code same like cfg_add_properties() */
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         enum cfg_property_type type,                  enum cfg_property_type type,
         char *str, ...)                  char *str, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         enum cfg_property_type tmp_type;          enum cfg_property_type tmp_type;
Line 540  cfg_remove_properties( /* code same like
Line 540  cfg_remove_properties( /* code same like
         tmp_str  = str;          tmp_str  = str;
         va_start(ap, str);          va_start(ap, str);
   
         /* argument list must be termited with typeN = CFG_EOF or          /* argument list must be termited with typeN = CFG_EOT or
          * str = NULL           * str = NULL
          */           */
         while (tmp_type != CFG_EOF && tmp_str != NULL) {          while (tmp_type != CFG_EOT && tmp_str != NULL) {
                 ret &= cfg_remove_property(con, tmp_type, tmp_str);                  ret &= cfg_remove_property(con, tmp_type, tmp_str);
                 if (!ret)                  if (!ret)
                         break;                          break;
                 tmp_type = va_arg(ap, enum cfg_property_type);                  tmp_type = va_arg(ap, enum cfg_property_type);
                 if (tmp_type == CFG_EOF) /* if typeN == CFG_EOF, strN may be not specified! */                  if (tmp_type == CFG_EOT) /* if typeN == CFG_EOT, strN may be not specified! */
                         break;                          break;
                 tmp_str  = va_arg(ap, char *);                  tmp_str  = va_arg(ap, char *);
         }          }
Line 559  cfg_remove_properties( /* code same like
Line 559  cfg_remove_properties( /* code same like
         return ret;          return ret;
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_remove_properties_str(  cfg_remove_properties_str(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         char *str,                  char *str,
         enum cfg_property_type type, ...)                  enum cfg_property_type type, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         enum cfg_property_type tmp_type;          enum cfg_property_type tmp_type;
Line 573  cfg_remove_properties_str(
Line 573  cfg_remove_properties_str(
         tmp_type = type;          tmp_type = type;
         va_start(ap, type);          va_start(ap, type);
   
         /* argument list must be termited with typeN = CFG_EOF or */          /* argument list must be termited with typeN = CFG_EOT or */
         if (str != NULL)          if (str != NULL)
                 while (tmp_type != CFG_EOF) {                  while (tmp_type != CFG_EOT) {
                         ret &= cfg_remove_property(con, tmp_type, str);                          ret &= cfg_remove_property(con, tmp_type, str);
                         if (!ret)                          if (!ret)
                                 break;                                  break;
Line 588  cfg_remove_properties_str(
Line 588  cfg_remove_properties_str(
         return ret;          return ret;
 } /* }}} */  } /* }}} */
   
         int  int
 cfg_remove_properties_type(  cfg_remove_properties_type(
         const CFG_CONTEXT con,                  const CFG_CONTEXT con,
         enum cfg_property_type type,                  enum cfg_property_type type,
         char *str, ...)                  char *str, ...)
 { /* {{{ */  { /* {{{ */
         va_list ap;          va_list ap;
         char * tmp_str;          char * tmp_str;
Line 603  cfg_remove_properties_type(
Line 603  cfg_remove_properties_type(
         va_start(ap, str);          va_start(ap, str);
   
         /* argument list must be termited with str = NULL */          /* argument list must be termited with str = NULL */
         if (type != CFG_EOF)          if (type != CFG_EOT)
                 while (tmp_str != NULL) {                  while (tmp_str != NULL) {
                         ret &= cfg_remove_property(con, type, tmp_str);                          ret &= cfg_remove_property(con, type, tmp_str);
                         if (!ret)                          if (!ret)

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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