Subversion Repositories Okuu

Rev

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

Rev Author Line No. Line
2 nishi 1
/* $Id: main.c 2 2024-09-09 13:22:05Z nishi $ */
2
 
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <stdbool.h>
6
 
7
char* nntpserver;
8
char* nntpuser;
9
char* nntppass;
10
int nntpport = 119;
11
 
12
char* ircserver;
13
int ircport = 6669;
14
 
15
int main(){
16
	printf("Okuu starting up\n");
17
 
18
	nntpserver = getenv("NNTPSERVER");
19
	nntpuser = getenv("NNTPUSER");
20
	nntppass = getenv("NNTPPASS");
21
	ircserver = getenv("IRCSERVER");
22
	if(getenv("NNTPPORT") != NULL){
23
		nntpport = atoi(getenv("NNTPPORT"));
24
	}
25
	if(getenv("IRCPORT") != NULL){
26
		ircport = atoi(getenv("IRCPORT"));
27
	}
28
	bool bad = false;
29
	if(nntpserver == NULL){
30
		fprintf(stderr, "Set NNTPSERVER\n");
31
		bad = true;
32
	}
33
	if(ircserver == NULL){
34
		fprintf(stderr, "Set IRCSERVER\n");
35
		bad = true;
36
	}
37
	if(bad){
38
		return 1;
39
	}
40
}