home *** CD-ROM | disk | FTP | other *** search
- #include <windows.h>
-
- #include "config.h"
-
- struct ConfigData Config;
- static char IniFileName[] = "Twiny.ini";
-
- void LoadConfig( struct ConfigData *cfg )
- {
- char IniFile[ MAX_PATH ];
-
- memset( cfg, 0, sizeof( *cfg ));
-
- GetModuleFileName( NULL, IniFile, sizeof( IniFile ));
-
- // I hereby state I don't code this way. Usually. :)
- strrchr( IniFile, '\\' )[1] = '\0';
- strcat( IniFile, IniFileName );
-
- cfg->Port = GetPrivateProfileInt( "Server", "Port", 1414, IniFile );
- cfg->WinX = GetPrivateProfileInt( "Window", "X", 650, IniFile );
- cfg->WinY = GetPrivateProfileInt( "Window", "Y", 2, IniFile );
- cfg->WinWidth = GetPrivateProfileInt( "Window", "Width", 100, IniFile );
- cfg->WinHeight = GetPrivateProfileInt( "Window", "Height", 100, IniFile );
-
- GetPrivateProfileString( "Server", "Host", "Amiga",
- cfg->Host, sizeof( cfg->Host ), IniFile );
-
- }