1
1

* profile.c: Make AppName parameter const char * everywhere.

* profile.h: Adjust declarations.
Этот коммит содержится в:
Andrew V. Samoilov 2002-07-25 13:44:06 +00:00
родитель e94799f762
Коммит eb7d542f24
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -256,7 +256,7 @@ static void new_key (TSecHeader *section, char *KeyName, char *Value)
} }
static char * static char *
GetSetProfileChar (int set, char *AppName, char *KeyName, GetSetProfileChar (int set, const char *AppName, char *KeyName,
char *Default, char *FileName) char *Default, char *FileName)
{ {
@ -308,7 +308,7 @@ GetSetProfileChar (int set, char *AppName, char *KeyName,
return Default; return Default;
} }
static short GetSetProfile (int set, char * AppName, char * KeyName, static short GetSetProfile (int set, const char * AppName, char * KeyName,
char * Default, char * ReturnedString, char * Default, char * ReturnedString,
short Size, char * FileName) short Size, char * FileName)
@ -323,21 +323,21 @@ static short GetSetProfile (int set, char * AppName, char * KeyName,
return 1; return 1;
} }
short GetPrivateProfileString (char * AppName, char * KeyName, short GetPrivateProfileString (const char * AppName, char * KeyName,
char * Default, char * ReturnedString, char * Default, char * ReturnedString,
short Size, char * FileName) short Size, char * FileName)
{ {
return (GetSetProfile (0, AppName, KeyName, Default, ReturnedString, Size, FileName)); return (GetSetProfile (0, AppName, KeyName, Default, ReturnedString, Size, FileName));
} }
char *get_profile_string (char *AppName, char *KeyName, char *Default, char *get_profile_string (const char *AppName, char *KeyName, char *Default,
char *FileName) char *FileName)
{ {
return GetSetProfileChar (0, AppName, KeyName, Default, FileName); return GetSetProfileChar (0, AppName, KeyName, Default, FileName);
} }
#if 0 #if 0
int GetProfileString (char * AppName, char * KeyName, char * Default, int GetProfileString (const char * AppName, char * KeyName, char * Default,
char * ReturnedString, int Size) char * ReturnedString, int Size)
{ {
return GetPrivateProfileString (AppName, KeyName, Default, return GetPrivateProfileString (AppName, KeyName, Default,
@ -345,7 +345,7 @@ int GetProfileString (char * AppName, char * KeyName, char * Default,
} }
#endif #endif
int GetPrivateProfileInt (char * AppName, char * KeyName, int Default, int GetPrivateProfileInt (const char * AppName, char * KeyName, int Default,
char * File) char * File)
{ {
static char IntBuf [BUF_TINY]; static char IntBuf [BUF_TINY];
@ -363,20 +363,20 @@ int GetPrivateProfileInt (char * AppName, char * KeyName, int Default,
} }
#if 0 #if 0
int GetProfileInt (char * AppName, char * KeyName, int Default) int GetProfileInt (const char * AppName, char * KeyName, int Default)
{ {
return GetPrivateProfileInt (AppName, KeyName, Default, INIFILE); return GetPrivateProfileInt (AppName, KeyName, Default, INIFILE);
} }
#endif #endif
int WritePrivateProfileString (char * AppName, char * KeyName, char * String, int WritePrivateProfileString (const char * AppName, char * KeyName, char * String,
char * FileName) char * FileName)
{ {
return GetSetProfile (1, AppName, KeyName, String, "", 0, FileName); return GetSetProfile (1, AppName, KeyName, String, "", 0, FileName);
} }
#if 0 #if 0
int WriteProfileString (char * AppName, char * KeyName, char * String) int WriteProfileString (const char * AppName, char * KeyName, char * String)
{ {
return (WritePrivateProfileString (AppName, KeyName, String, INIFILE)); return (WritePrivateProfileString (AppName, KeyName, String, INIFILE));
} }

Просмотреть файл

@ -3,28 +3,28 @@
/* Prototypes for the profile management functions */ /* Prototypes for the profile management functions */
#ifndef _OS_NT #ifndef _OS_NT
short GetPrivateProfileString (char * AppName, char * KeyName, short GetPrivateProfileString (const char * AppName, char * KeyName,
char * Default, char * ReturnedString, char * Default, char * ReturnedString,
short Size, char * FileName); short Size, char * FileName);
int GetProfileString (char * AppName, char * KeyName, char * Default, int GetProfileString (const char * AppName, char * KeyName, char * Default,
char * ReturnedString, int Size); char * ReturnedString, int Size);
int GetPrivateProfileInt (char * AppName, char * KeyName, int Default, int GetPrivateProfileInt (const char * AppName, char * KeyName, int Default,
char * File); char * File);
int GetProfileInt (char * AppName, char * KeyName, int Default); int GetProfileInt (const char * AppName, char * KeyName, int Default);
int WritePrivateProfileString (char * AppName, char * KeyName, char * String, int WritePrivateProfileString (const char * AppName, char * KeyName, char * String,
char * FileName); char * FileName);
int WriteProfileString (char * AppName, char * KeyName, char * String); int WriteProfileString (const char * AppName, char * KeyName, char * String);
#endif /* not _OS_NT */ #endif /* not _OS_NT */
void sync_profiles (void); void sync_profiles (void);
void free_profiles (void); void free_profiles (void);
char *get_profile_string (char *AppName, char *KeyName, char *Default, char *get_profile_string (const char *AppName, char *KeyName, char *Default,
char *FileName); char *FileName);
/* New profile functions */ /* New profile functions */