version 1.1.1.1, 2008/08/28 13:17:41
|
version 1.1.1.1.4.1, 2009/09/23 14:20:53
|
Line 4
|
Line 4
|
|
|
int main() |
int main() |
{ |
{ |
sl_config lst; | sl_config lst, tmp; |
char szStr[256]; |
char szStr[256]; |
|
|
/* |
/* |
Line 29 int main()
|
Line 29 int main()
|
printf("LoadValue=%d :: ", LoadAttribute(&lst, "section", "attr3", szStr, 255, "iH")); |
printf("LoadValue=%d :: ", LoadAttribute(&lst, "section", "attr3", szStr, 255, "iH")); |
printf("Str=%s\n", szStr); |
printf("Str=%s\n", szStr); |
*/ |
*/ |
|
InitConfig(&tmp); |
|
printf("tmp: SetAttribute=%d\n", cfg_SetAttribute(&tmp, "global", "piuk", "blahz")); |
|
printf("tmp: SetAttribute=%d\n", cfg_SetAttribute(&tmp, "bzyt", "00", "99999")); |
|
printf("tmp: SetAttribute=%d\n", cfg_SetAttribute(&tmp, "global", "gniah", "tiiiiiii")); |
InitConfig(&lst); |
InitConfig(&lst); |
|
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, NULL, "zzz", "ZZZ")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, NULL, "att", "0001122222222222")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, NULL, "att", "0001122222222222")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, "global", "att", "0001122222222222")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, "global", "att", "0001122222222222")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, "global", "attr2", "1111111122222222222")); |
printf("SetAttribute=%d\n", cfg_SetAttribute(&lst, "global", "attr2", "1111111122222222222")); |
Line 38 int main()
|
Line 43 int main()
|
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, "global", "")); |
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, "global", "")); |
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, NULL, "att")); |
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, NULL, "att")); |
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, "global", "attr2")); |
printf("UnsetAttribute=%d\n", cfg_UnsetAttribute(&lst, "global", "attr2")); |
|
|
|
WriteConfig(stdout, &tmp); |
|
ConcatConfig(&lst, &tmp); |
|
WriteConfig(stdout, &lst); |
|
|
printf("CreateConfig=%d\n", CreateConfig("test4e.cfg", &lst)); |
printf("CreateConfig=%d\n", CreateConfig("test4e.cfg", &lst)); |
printf("errno=%d error=%s\n", cfg_GetErrno(), cfg_GetError()); |
printf("errno=%d error=%s\n", cfg_GetErrno(), cfg_GetError()); |