summaryrefslogtreecommitdiffstats
path: root/bbsconfig.h
blob: 3819d9d8ce574623c6f4e797026bfbed9161ad80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __MICROBBS_BBSCONFIG_H
#define __MICROBBS_BBSCONFIG_H

#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

#define ASSERT assert

#include "kconfig.h"
#include "list.h"
#include "sds.h"
#include "file_use.h"
#include "ini.h"

//there should be many ways how to config stuff
//from commandline some basic things
//from config files more complicated

typedef struct bbs_config
{
	//todo configs
	//list of filenames that considered to be todos
	char *todo_dir;
	List *todo_files;

	//directories where could be articles
	char *article_dir;

	//if defined this then there is directory where all needed is in standart layout
	char *root_dir;

	//directory with all user inis
	char *user_dir;

	//show motd messages?
	int motd;

	//write syslogs?
	int syslog;

	//debug mode outputs more stuff
	int debug;
} bbs_config;

//GLOBAL USER
#ifdef __MICROBBS_MAIN
bbs_config g_config;
#else
extern bbs_config g_config;
#endif

int config_default();
int config_from_ini( const char *config_file );
int config_from_argv( int argc, char **argv );
char* config_to_str( size_t max_size );


#endif