Subversion Repositories Tewi

Rev

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

Rev 310 Rev 311
Line 1... Line 1...
1
/* $Id: main.c 310 2024-10-11 19:44:01Z nishi $ */
1
/* $Id: main.c 311 2024-10-13 01:23:22Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 28... Line 28...
28
 
28
 
29
#include "tw_config.h"
29
#include "tw_config.h"
30
#include "tw_server.h"
30
#include "tw_server.h"
31
#include "tw_version.h"
31
#include "tw_version.h"
32
 
32
 
33
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
33
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__))
34
#include <windows.h>
34
#include <windows.h>
35
#endif
35
#endif
36
 
36
 
37
#ifdef _PSP
37
#ifdef _PSP
38
#include <pspkernel.h>
38
#include <pspkernel.h>
Line 86... Line 86...
86
 
86
 
87
char tw_server[2048];
87
char tw_server[2048];
88
 
88
 
89
int startup(int argc, char** argv);
89
int startup(int argc, char** argv);
90
 
90
 
91
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
91
#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__)) || defined(__BORLANDC__)
92
char* get_registry(const char* main, const char* sub) {
92
char* get_registry(const char* main, const char* sub) {
93
	DWORD bufsize = 512;
93
	DWORD bufsize = 512;
94
	HKEY handle;
94
	HKEY handle;
95
	char* value = malloc(513);
95
	char* value = malloc(513);
96
	int err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, main, 0, KEY_QUERY_VALUE, &handle);
96
	int err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, main, 0, KEY_QUERY_VALUE, &handle);
Line 715... Line 715...
715
#endif
715
#endif
716
 
716
 
717
int startup(int argc, char** argv) {
717
int startup(int argc, char** argv) {
718
	int i;
718
	int i;
719
	char* r;
719
	char* r;
720
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
720
#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__)) || defined(__BORLANDC__)
721
	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
721
	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
722
	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
722
	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
723
	if(regpath != NULL) {
723
	if(regpath != NULL) {
724
		free(confpath);
724
		free(confpath);
725
		confpath = cm_strcat(regpath, "/etc/tewi.conf");
725
		confpath = cm_strcat(regpath, "/etc/tewi.conf");