Subversion Repositories IRCServ

Rev

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

Rev 5 Rev 6
Line 1... Line 1...
1
/* $Id: check.c 5 2024-08-25 11:58:10Z nishi $ */
1
/* $Id: check.c 6 2024-08-25 19:00:39Z nishi $ */
2
 
2
 
3
#include "config.h"
3
#include "config.h"
4
 
4
 
5
#include <string.h>
5
#include <string.h>
6
#include <stdio.h>
6
#include <stdio.h>
Line 26... Line 26...
26
		printf("Using %s for logging\n", name);
26
		printf("Using %s for logging\n", name);
27
		return 0;
27
		return 0;
28
	}
28
	}
29
}
29
}
30
 
30
 
-
 
31
int check_ircd(void) {
-
 
32
	int count = 0;
-
 
33
	const char* name = "";
-
 
34
#ifdef USE_BAHAMUT_IRCD
-
 
35
	name = "Bahamut";
-
 
36
	count++;
-
 
37
#endif
-
 
38
	if(count == 0) {
-
 
39
		fprintf(stderr, "Select an IRCd\n");
-
 
40
		return 1;
-
 
41
	} else if(count > 1) {
-
 
42
		fprintf(stderr, "Too many IRCds\n");
-
 
43
		return 1;
-
 
44
	} else {
-
 
45
		printf("Using %s for IRCd\n", name);
-
 
46
		return 0;
-
 
47
	}
-
 
48
}
-
 
49
 
31
int check_irc(void) {
50
int check_irc(void) {
32
	int st = 0;
51
	int st = 0;
33
#ifndef IRC_SERVER
52
#ifndef IRC_SERVER
34
	fprintf(stderr, "Set a server IP\n");
53
	fprintf(stderr, "Set a server IP\n");
35
	st = 1;
54
	st = 1;
Line 54... Line 73...
54
		int st = 0;
73
		int st = 0;
55
		st = check_log();
74
		st = check_log();
56
		if(st != 0) goto cleanup;
75
		if(st != 0) goto cleanup;
57
		st = check_irc();
76
		st = check_irc();
58
		if(st != 0) goto cleanup;
77
		if(st != 0) goto cleanup;
-
 
78
		st = check_ircd();
-
 
79
		if(st != 0) goto cleanup;
59
	cleanup:
80
	cleanup:
60
		return st;
81
		return st;
61
	} else if(strcmp(argv[1], "objs") == 0) {
82
	} else if(strcmp(argv[1], "objs") == 0) {
62
#if defined(USE_SYSLOG)
83
#if defined(USE_SYSLOG)
63
		printf("log/syslog.o");
84
		printf("log/syslog.o");
64
#elif defined(USE_STDERR)
85
#elif defined(USE_STDERR)
65
		printf("log/stderr.o");
86
		printf("log/stderr.o");
66
#endif
87
#endif
-
 
88
 
-
 
89
		printf(" ");
-
 
90
#if defined(USE_BAHAMUT_IRCD)
-
 
91
		printf("ircd/bahamut.o");
-
 
92
#endif
-
 
93
 
-
 
94
		printf(" ");
-
 
95
#ifdef USE_NICKSERV
-
 
96
		printf("service/nickserv.o");
-
 
97
#endif
-
 
98
 
-
 
99
		printf(" ");
-
 
100
#ifdef USE_CHANSERV
-
 
101
		printf("service/chanserv.o");
-
 
102
#endif
-
 
103
 
-
 
104
		printf(" ");
-
 
105
#ifdef USE_MEMOSERV
-
 
106
		printf("service/memoserv.o");
-
 
107
#endif
-
 
108
 
-
 
109
		printf(" ");
-
 
110
#ifdef USE_OPERSERV
-
 
111
		printf("service/operserv.o");
-
 
112
#endif
67
		printf("\n");
113
		printf("\n");
68
	}
114
	}
69
}
115
}