|
version 1.16.6.4, 2025/08/19 11:40:13
|
version 1.18, 2026/08/04 18:59:27
|
|
Line 12 terms:
|
Line 12 terms:
|
| All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
| Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
| |
|
| Copyright 2004 - 2025 | Copyright 2004 - 2026 |
| by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
| |
|
| Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
|
Line 203 cfgLoadConfig(const char *cfgName, cfg_root_t * __rest
|
Line 203 cfgLoadConfig(const char *cfgName, cfg_root_t * __rest
|
| return -1; |
return -1; |
| } |
} |
| |
|
| ret = cfgReadConfig(f, cfg); | ret = cfg_ReadConfig(f, cfg, 1); |
| |
|
| fclose(f); |
fclose(f); |
| return ret; |
return ret; |
| } |
} |
| |
|
| |
/* |
| |
* cfgLoadConfigExt() - Load config from file with recursion level of includes |
| |
* |
| |
* @cfgName = Config filename |
| |
* @cfg = Config root |
| |
* @lvl = Level of include recursion |
| |
* return: -1 error or 0 ok |
| |
*/ |
| |
int |
| |
cfgLoadConfigExt(const char *cfgName, cfg_root_t * __restrict cfg, int lvl) |
| |
{ |
| |
FILE *f; |
| |
int ret; |
| |
|
| |
if (!cfgName || cfgInitConfigExt(cfg)) { |
| |
cfg_SetErr(EINVAL, "Invalid parameter(s)"); |
| |
return -1; |
| |
} |
| |
|
| |
f = fopen(cfgName, "r"); |
| |
if (!f) { |
| |
LOGERR; |
| |
return -1; |
| |
} |
| |
|
| |
ret = cfg_ReadConfig(f, cfg, lvl); |
| |
|
| |
fclose(f); |
| |
return ret; |
| |
} |
| /* |
/* |
| * cfgClearConfig() - Clear config and free resources |
* cfgClearConfig() - Clear config and free resources |
| * |
* |