version 1.1.1.1, 2008/08/28 13:17:41
|
version 1.1.1.1.4.2, 2009/10/19 14:58:24
|
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")); |
|
printf("tmp: SetAttribute=%d\n", cfg_SetAttribute(&tmp, NULL, "att", "0001122777777")); |
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 44 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")); |
|
printf("tmp: SetAttribute=%d\n", cfg_SetAttribute(&lst, "bzyt", "111", "99999")); |
|
|
|
WriteConfig(stdout, &tmp); |
|
WriteConfig(stdout, &lst); |
|
printf("---------------------------------\n"); |
|
printf("%d\n---------------------------------\n", MergeConfig(&lst, &tmp)); |
|
WriteConfig(stdout, &lst); |
|
// printf("%d\n---------------------------------\n", ConcatConfig(&lst, &tmp)); |
|
// WriteConfig(stdout, &lst); |
|
printf("%d\n---------------------------------\n", 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()); |