Subversion Repositories Tewi

Rev

Rev 17 | Rev 19 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/* $Id: tw_config.h 18 2024-09-14 00:42:40Z nishi $ */

#ifndef __TW_CONFIG_H__
#define __TW_CONFIG_H__

#include <stdint.h>

#define MAX_PORTS 1024
#define MAX_VHOSTS 1024
#define MAX_MODULES 1024

struct tw_config_entry {
        char* name;
        int port;
        char* sslkey;
        char* sslcert;
};

struct tw_config {
        uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
        char hostname[1025];
        struct tw_config_entry root;
        struct tw_config_entry vhosts[MAX_VHOSTS];
        void* modules[MAX_MODULES];
        int module_count;
        int vhost_count;
        char* server_root;
        char* extension;
};

void tw_config_init(void);
int tw_config_read(const char* path);
struct tw_config_entry* tw_vhost_match(const char* name, int port);

#endif