Subversion Repositories Tewi

Rev

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

Rev 17 Rev 18
Line 1... Line 1...
1
/* $Id: tw_config.h 17 2024-09-13 17:41:07Z nishi $ */
1
/* $Id: tw_config.h 18 2024-09-14 00:42:40Z nishi $ */
2
 
2
 
3
#ifndef __TW_CONFIG_H__
3
#ifndef __TW_CONFIG_H__
4
#define __TW_CONFIG_H__
4
#define __TW_CONFIG_H__
5
 
5
 
6
#include <stdint.h>
6
#include <stdint.h>
7
 
7
 
8
#define MAX_PORTS 1024
8
#define MAX_PORTS 1024
9
 
-
 
10
#define MAX_VHOSTS 1024
9
#define MAX_VHOSTS 1024
-
 
10
#define MAX_MODULES 1024
11
 
11
 
12
struct tw_config_entry {
12
struct tw_config_entry {
13
	char* name;
13
	char* name;
14
	int port;
14
	int port;
15
	char* sslkey;
15
	char* sslkey;
Line 19... Line 19...
19
struct tw_config {
19
struct tw_config {
20
	uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
20
	uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
21
	char hostname[1025];
21
	char hostname[1025];
22
	struct tw_config_entry root;
22
	struct tw_config_entry root;
23
	struct tw_config_entry vhosts[MAX_VHOSTS];
23
	struct tw_config_entry vhosts[MAX_VHOSTS];
-
 
24
	void* modules[MAX_MODULES];
-
 
25
	int module_count;
24
	int vhost_count;
26
	int vhost_count;
25
	char* server_root;
27
	char* server_root;
-
 
28
	char* extension;
26
};
29
};
27
 
30
 
28
void tw_config_init(void);
31
void tw_config_init(void);
29
int tw_config_read(const char* path);
32
int tw_config_read(const char* path);
30
struct tw_config_entry* tw_vhost_match(const char* name, int port);
33
struct tw_config_entry* tw_vhost_match(const char* name, int port);