vhost.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_VHOST_H_
00012 #define _KLONE_VHOST_H_
00013
00014 #include <u/libu.h>
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00020
00021 LIST_HEAD(vhost_list_s, vhost_s);
00022
00023 struct http_s;
00024 struct klog_s;
00025
00026 typedef struct vhost_s
00027 {
00028 LIST_ENTRY(vhost_s) np;
00029 struct http_s *http;
00030 struct klog_s *klog;
00031 u_config_t *config;
00032 u_config_t *al_config;
00033 const char *host;
00034 int id;
00035
00036
00037 const char *server_sig;
00038 const char *dir_root;
00039 const char *index;
00040 int send_enc_deflate;
00041 } vhost_t;
00042
00043 typedef struct vhost_list_s vhost_list_t;
00044
00045 int vhost_create(vhost_t **pv);
00046 int vhost_free(vhost_t *v);
00047
00048 int vhost_list_create(vhost_list_t **pvs);
00049 int vhost_list_free(vhost_list_t *vs);
00050 int vhost_list_add(vhost_list_t *vs, vhost_t *vhost);
00051 vhost_t* vhost_list_get_n(vhost_list_t *vs, int n);
00052 vhost_t* vhost_list_get(vhost_list_t *vs, const char *host);
00053
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057
00058 #endif