Subversion Repositories Tewi

Rev

Rev 255 | Rev 284 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 255 Rev 257
Line 1... Line 1...
1
/* $Id: main.c 255 2024-10-04 04:08:58Z nishi $ */
1
/* $Id: main.c 257 2024-10-04 05:34:27Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 84... Line 84...
84
 
84
 
85
char tw_server[2048];
85
char tw_server[2048];
86
 
86
 
87
int startup(int argc, char** argv);
87
int startup(int argc, char** argv);
88
 
88
 
89
#if defined(__MINGW32__) || defined(_MSC_VER)
89
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
90
char* get_registry(const char* main, const char* sub) {
90
char* get_registry(const char* main, const char* sub) {
91
	DWORD bufsize = 512;
91
	DWORD bufsize = 512;
92
	HKEY handle;
92
	HKEY handle;
93
	char* value = malloc(513);
93
	char* value = malloc(513);
94
	int err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, main, 0, KEY_QUERY_VALUE, &handle);
94
	int err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, main, 0, KEY_QUERY_VALUE, &handle);
Line 708... Line 708...
708
#endif
708
#endif
709
 
709
 
710
int startup(int argc, char** argv) {
710
int startup(int argc, char** argv) {
711
	int i;
711
	int i;
712
	char* r;
712
	char* r;
713
#if defined(__MINGW32__) || defined(_MSC_VER)
713
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
714
	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
714
	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
715
	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
715
	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
716
	if(regpath != NULL) {
716
	if(regpath != NULL) {
717
		free(confpath);
717
		free(confpath);
718
		confpath = cm_strcat(regpath, "/etc/tewi.conf");
718
		confpath = cm_strcat(regpath, "/etc/tewi.conf");