Subversion Repositories IRCServ

Rev

Rev 3 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 nishi 1
/* $Id: check.c 2 2024-08-25 10:11:51Z nishi $ */
2
 
3
#include "config.h"
4
 
5
#include <stdio.h>
6
 
7
int check_log(void) {
8
	int count = 0;
9
	const char* name = "";
10
#ifdef USE_SYSLOG
11
	name = "Syslog";
12
	count++;
13
#endif
14
#ifdef USE_STDERR
15
	name = "stderr";
16
	count++;
17
#endif
18
	if(count == 0) {
19
		fprintf(stderr, "Select a logger\n");
20
		return 1;
21
	} else if(count > 1) {
22
		fprintf(stderr, "Too many loggers\n");
23
		return 1;
24
	} else {
25
		printf("Using %s for logging\n", name);
26
		return 0;
27
	}
28
}
29
 
30
int main() {
31
	int st = 0;
32
	st = check_log();
33
	if(st != 0) goto cleanup;
34
cleanup:
35
	return st;
36
}