Rozdiely pre libcfg+/src/props.c medzi verziami 1.22 a 1.23
| verzia 1.22, 2002/07/18 22:16:30 |
verzia 1.23, 2002/08/03 20:03:21 |
|
|
| #include "config.h" |
#include "config.h" |
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| |
#include <stdarg.h> |
| |
|
| #include "str/strdyn.h" |
#include "str/strdyn.h" |
| #include "cfg+.h" |
#include "cfg+.h" |
| Riadok 306 cfg_add_property(con, type, str) |
|
| Riadok 307 cfg_add_property(con, type, str) |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| int |
int |
| |
cfg_add_properties( |
| |
const CFG_CONTEXT con, |
| |
enum cfg_property_type type, |
| |
char *str, ...) |
| |
{ /* {{{ */ |
| |
va_list ap; |
| |
enum cfg_property_type tmp_type; |
| |
char * tmp_str; |
| |
int ret = 1; |
| |
|
| |
/* initialization */ |
| |
tmp_type = type; |
| |
tmp_str = str; |
| |
va_start(ap, str); |
| |
|
| |
/* argument list must be termited with typeN = CFG_EOF or |
| |
* str = NULL |
| |
*/ |
| |
while (tmp_type != CFG_EOF && tmp_str != NULL) { |
| |
ret &= cfg_add_property(con, tmp_type, tmp_str); |
| |
if (!ret) |
| |
break; |
| |
tmp_type = va_arg(ap, enum cfg_property_type); |
| |
if (tmp_type == CFG_EOF) /* if typeN == CFG_EOF, strN may be not specified! */ |
| |
break; |
| |
tmp_str = va_arg(ap, char *); |
| |
} |
| |
|
| |
/* cleanup */ |
| |
va_end(ap); |
| |
|
| |
return ret; |
| |
} /* }}} */ |
| |
|
| |
|
| |
int |
| cfg_remove_property(con, type, str) |
cfg_remove_property(con, type, str) |
| const CFG_CONTEXT con; |
const CFG_CONTEXT con; |
| enum cfg_property_type type; |
enum cfg_property_type type; |
Platon Group <platon@platon.sk> http://platon.sk/
|
|