| version 1.18, 2002/07/16 13:42:11 |
version 1.19, 2002/08/16 20:31:42 |
|
|
| /* $Id$ */ |
/* $Id$ */ |
| |
|
| /* Includes {{{ */ |
/* Includes {{{ */ |
| #include "config.h" |
#ifdef HAVE_CONFIG_H |
| |
# include "config.h" |
| |
#endif |
| |
|
| #if STDC_HEADERS |
#if STDC_HEADERS |
| # include <stdlib.h> |
# include <stdlib.h> |
| Line 127 cfg_cfgfile_get_next_opt(con) |
|
| Line 129 cfg_cfgfile_get_next_opt(con) |
|
| |
|
| /* Testing if file stop prefix was found */ |
/* Testing if file stop prefix was found */ |
| if (buf != NULL && con->prop[CFG_FILE_STOP_PREFIX] != NULL) { |
if (buf != NULL && con->prop[CFG_FILE_STOP_PREFIX] != NULL) { |
| if (buf == strdyn_str2(buf, |
if (buf == FUNCTION(strdyn_str2)(buf, |
| con->prop[CFG_FILE_STOP_PREFIX], NULL)) { |
con->prop[CFG_FILE_STOP_PREFIX], NULL)) { |
| __cfg_free_currents(con); |
__cfg_free_currents(con); |
| con->cur_opt = buf; |
con->cur_opt = buf; |
| Line 185 get_multi_line(con, buf) |
|
| Line 187 get_multi_line(con, buf) |
|
| |
|
| *buf = NULL; |
*buf = NULL; |
| |
|
| if ((ar = strdyn_create()) == NULL) |
if ((ar = FUNCTION(strdyn_create)()) == NULL) |
| return CFG_ERROR_NOMEM; |
return CFG_ERROR_NOMEM; |
| |
|
| while (1) { |
while (1) { |
| Line 195 get_multi_line(con, buf) |
|
| Line 197 get_multi_line(con, buf) |
|
| if (my_buf != NULL) |
if (my_buf != NULL) |
| free(my_buf); |
free(my_buf); |
| |
|
| |
#ifdef PLATON_PREFIX |
| |
my_buf = FUNCTION(dynamic_fgets)(con->fhandle); |
| |
#else |
| my_buf = dynamic_fgets(con->fhandle); |
my_buf = dynamic_fgets(con->fhandle); |
| |
#endif |
| if (my_buf == NULL) { |
if (my_buf == NULL) { |
| if (feof(con->fhandle)) |
if (feof(con->fhandle)) |
| return CFG_OK; |
return CFG_OK; |
| Line 244 get_multi_line(con, buf) |
|
| Line 250 get_multi_line(con, buf) |
|
| state = 2; |
state = 2; |
| |
|
| len = strlen(my_buf); |
len = strlen(my_buf); |
| str_right_trim(my_buf); |
FUNCTION(str_right_trim)(my_buf); |
| if (len - strlen(my_buf) > 0) { |
if (len - strlen(my_buf) > 0) { |
| /* Could be replaced with |
/* Could be replaced with |
| strcpy(my_buf + strlen(my_buf), " "); */ |
strcpy(my_buf + strlen(my_buf), " "); */ |
| Line 254 get_multi_line(con, buf) |
|
| Line 260 get_multi_line(con, buf) |
|
| } |
} |
| } |
} |
| |
|
| ar = strdyn_add(ar, my_buf); |
ar = FUNCTION(strdyn_add)(ar, my_buf); |
| if (ar == NULL) |
if (ar == NULL) |
| return CFG_ERROR_NOMEM; |
return CFG_ERROR_NOMEM; |
| |
|
| Line 265 get_multi_line(con, buf) |
|
| Line 271 get_multi_line(con, buf) |
|
| if (my_buf != NULL) |
if (my_buf != NULL) |
| free(my_buf); |
free(my_buf); |
| |
|
| my_buf = str_right_trim(strdyn_implode(ar, "")); |
my_buf = FUNCTION(str_right_trim)(strdyn_implode(ar, "")); |
| strdyn_free(ar); |
FUNCTION(strdyn_free)(ar); |
| |
|
| if (my_buf == NULL) |
if (my_buf == NULL) |
| return CFG_ERROR_NOMEM; |
return CFG_ERROR_NOMEM; |