cdvdgigaherz: Remove old config code

This commit is contained in:
Jonathan Li 2016-10-24 21:43:04 +01:00
parent 59247c7838
commit 5917bf31c3
1 changed files with 0 additions and 91 deletions

View File

@ -21,97 +21,6 @@
#include <commctrl.h> #include <commctrl.h>
#include "resource.h" #include "resource.h"
char CfgFile[MAX_PATH + 10] = "inis/cdvdGigaherz.ini";
/*| Config File Format: |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯*\
+--+---------------------+------------------------+
| |
| Option=Value |
| |
| |
| Boolean Values: TRUE,YES,1,T,Y mean 'true', |
| everything else means 'false'. |
| |
| All Values are limited to 255 chars. |
| |
+-------------------------------------------------+
\*_____________________________________________*/
void CfgWriteBool(char *Section, char *Name, char Value)
{
char *Data = Value ? "TRUE" : "FALSE";
WritePrivateProfileString(Section, Name, Data, CfgFile);
}
void CfgWriteInt(char *Section, char *Name, int Value)
{
char Data[255];
_itoa(Value, Data, 10);
WritePrivateProfileString(Section, Name, Data, CfgFile);
}
void CfgWriteStr(char *Section, char *Name, char *Data)
{
WritePrivateProfileString(Section, Name, Data, CfgFile);
}
/*****************************************************************************/
char CfgReadBool(char *Section, char *Name, char Default)
{
char Data[255] = "";
GetPrivateProfileString(Section, Name, "", Data, 255, CfgFile);
Data[254] = 0;
if (strlen(Data) == 0) {
CfgWriteBool(Section, Name, Default);
return Default;
}
if (strcmp(Data, "1") == 0)
return -1;
if (strcmp(Data, "Y") == 0)
return -1;
if (strcmp(Data, "T") == 0)
return -1;
if (strcmp(Data, "YES") == 0)
return -1;
if (strcmp(Data, "TRUE") == 0)
return -1;
return 0;
}
int CfgReadInt(char *Section, char *Name, int Default)
{
char Data[255] = "";
GetPrivateProfileString(Section, Name, "", Data, 255, CfgFile);
Data[254] = 0;
if (strlen(Data) == 0) {
CfgWriteInt(Section, Name, Default);
return Default;
}
return atoi(Data);
}
void CfgReadStr(char *Section, char *Name, char *Data, int DataSize, char *Default)
{
int sl;
GetPrivateProfileString(Section, Name, "", Data, DataSize, CfgFile);
if (strlen(Data) == 0) {
sl = (int)strlen(Default);
strncpy(Data, Default, sl > 255 ? 255 : sl);
CfgWriteStr(Section, Name, Data);
}
}
/*****************************************************************************/
static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
switch (uMsg) { switch (uMsg) {