Go to the source code of this file.
Functions | |
short | GetPrivateProfileString (char *AppName, char *KeyName, char *Default, char *ReturnedString, short Size, char *FileName) |
int | GetProfileString (char *AppName, char *KeyName, char *Default, char *ReturnedString, int Size) |
int | GetPrivateProfileInt (char *AppName, char *KeyName, short Default, char *File) |
int | GetProfileInt (char *AppName, char *KeyName, int Default) |
int | WritePrivateProfileString (char *AppName, char *KeyName, char *String, char *FileName) |
int | WriteProfileString (char *AppName, char *KeyName, char *String) |
void | sync_profiles (void) |
void | free_profiles (void) |
char * | get_profile_string (char *AppName, char *KeyName, char *Default, char *FileName) |
void * | profile_init_iterator (char *appname, char *file) |
void * | profile_iterator_next (void *s, char **key, char **value) |
void | profile_clean_section (char *appname, char *file) |
void free_profiles | ( | void | ) |
Definition at line 420 of file profile.c.
References free_profile().
00421 { 00422 free_profile (Base); 00423 }
char* get_profile_string | ( | char * | AppName, | |
char * | KeyName, | |||
char * | Default, | |||
char * | FileName | |||
) |
Definition at line 288 of file profile.c.
References GetSetProfileChar().
00290 { 00291 return GetSetProfileChar (0, AppName, KeyName, Default, FileName); 00292 }
int GetPrivateProfileInt | ( | char * | AppName, | |
char * | KeyName, | |||
short | Default, | |||
char * | File | |||
) |
Definition at line 303 of file profile.c.
References GetPrivateProfileString().
Referenced by GetProfileInt(), and main().
00305 { 00306 static char IntBuf[10]; 00307 static char buf[10]; 00308 00309 sprintf (buf, "%d", Default); 00310 00311 /* Check the exact semantic with the SDK */ 00312 GetPrivateProfileString (AppName, KeyName, buf, IntBuf, 5, File); 00313 if (!strcasecmp (IntBuf, "true")) 00314 return 1; 00315 if (!strcasecmp (IntBuf, "yes")) 00316 return 1; 00317 return atoi (IntBuf); 00318 }
short GetPrivateProfileString | ( | char * | AppName, | |
char * | KeyName, | |||
char * | Default, | |||
char * | ReturnedString, | |||
short | Size, | |||
char * | FileName | |||
) |
Definition at line 280 of file profile.c.
References GetSetProfile().
Referenced by GetPrivateProfileInt(), GetProfileString(), mollerClass::Loop(), and main().
00283 { 00284 return (GetSetProfile (0, AppName, KeyName, Default, ReturnedString, Size, FileName)); 00285 }
int GetProfileInt | ( | char * | AppName, | |
char * | KeyName, | |||
int | Default | |||
) |
Definition at line 321 of file profile.c.
References GetPrivateProfileInt(), and INIFILE.
00322 { 00323 return GetPrivateProfileInt (AppName, KeyName, Default, INIFILE); 00324 }
int GetProfileString | ( | char * | AppName, | |
char * | KeyName, | |||
char * | Default, | |||
char * | ReturnedString, | |||
int | Size | |||
) |
Definition at line 295 of file profile.c.
References GetPrivateProfileString(), and INIFILE.
00297 { 00298 return GetPrivateProfileString (AppName, KeyName, Default, 00299 ReturnedString, Size, INIFILE); 00300 }
void profile_clean_section | ( | char * | appname, | |
char * | file | |||
) |
Definition at line 462 of file profile.c.
References TSecHeader::AppName, is_loaded(), and TSecHeader::link.
00463 { 00464 TSecHeader *section; 00465 00466 /* We assume the user has called one of the other initialization funcs */ 00467 if (!is_loaded (file, §ion)) { 00468 fprintf (stderr, "Warning: profile_clean_section called before init\n"); 00469 return; 00470 } 00471 /* We only disable the section, so it will still be freed, but it */ 00472 /* won't be find by further walks of the structure */ 00473 00474 for (; section; section = section->link) { 00475 if (strcasecmp (section->AppName, appname)) 00476 continue; 00477 section->AppName[0] = 0; 00478 } 00479 }
void* profile_init_iterator | ( | char * | appname, | |
char * | file | |||
) |
Definition at line 426 of file profile.c.
References TSecHeader::AppName, TProfile::FileName, is_loaded(), TSecHeader::Keys, TSecHeader::link, TProfile::link, load(), TProfile::Section, and xmalloc.
00427 { 00428 TProfile *New; 00429 TSecHeader *section; 00430 00431 if (!is_loaded (file, §ion)) { 00432 New = (TProfile *) xmalloc (sizeof (TProfile), "GetSetProfile"); 00433 New->link = Base; 00434 New->FileName = strdup (file); 00435 New->Section = load (file); 00436 Base = New; 00437 section = New->Section; 00438 Current = New; 00439 } 00440 for (; section; section = section->link) { 00441 if (strcasecmp (section->AppName, appname)) 00442 continue; 00443 return section->Keys; 00444 } 00445 return 0; 00446 }
void* profile_iterator_next | ( | void * | s, | |
char ** | key, | |||
char ** | value | |||
) |
Definition at line 449 of file profile.c.
References TKeys::KeyName, TKeys::link, and TKeys::Value.
void sync_profiles | ( | void | ) |
Definition at line 379 of file profile.c.
References dump_profile().
00380 { 00381 dump_profile (Base); 00382 }
int WritePrivateProfileString | ( | char * | AppName, | |
char * | KeyName, | |||
char * | String, | |||
char * | FileName | |||
) |
Definition at line 327 of file profile.c.
References GetSetProfile().
Referenced by WriteProfileString().
00329 { 00330 return GetSetProfile (1, AppName, KeyName, String, "", 0, FileName); 00331 }
int WriteProfileString | ( | char * | AppName, | |
char * | KeyName, | |||
char * | String | |||
) |
Definition at line 334 of file profile.c.
References INIFILE, and WritePrivateProfileString().
00335 { 00336 return (WritePrivateProfileString (AppName, KeyName, String, INIFILE)); 00337 }