summaryrefslogtreecommitdiff
path: root/src/mod_sql_vhost_core.h
blob: 2d70f62d9c5c0912cbf921c90ce5c406352766d4 (plain)
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
#ifndef _MOD_SQL_VHOST_CORE_H_
#define _MOD_SQL_VHOST_CORE_H_

#include "buffer.h"
#include "plugin.h"

#ifdef HAVE_GLIB_H
#include <glib.h>
#endif

#define SQLVHOST_BACKEND_GETVHOST_PARAMS \
	(server *srv, connection *con, void *p_d, buffer *docroot, buffer *host)

#define SQLVHOST_BACKEND_GETVHOST_RETVAL handler_t

#define SQLVHOST_BACKEND_GETVHOST(name) \
	SQLVHOST_BACKEND_GETVHOST_RETVAL name SQLVHOST_BACKEND_GETVHOST_PARAMS

#define SQLVHOST_BACKEND_GETVHOST_PTR(name) \
	SQLVHOST_BACKEND_GETVHOST_RETVAL (* name)SQLVHOST_BACKEND_GETVHOST_PARAMS

typedef struct {
	buffer  *db;
	buffer  *user;
	buffer  *pass;
	buffer  *sock;

	buffer  *hostname;
	unsigned short port;

	buffer  *backend;
	void *backend_data;

	buffer *select_vhost;
	
	unsigned short cache_ttl;
	unsigned short debug;

#ifdef HAVE_GLIB_H
	GHashTable *vhost_table;
#endif

	SQLVHOST_BACKEND_GETVHOST_PTR(get_vhost);
} mod_sql_vhost_core_plugin_config;

/* global plugin data */
typedef struct {
	PLUGIN_DATA;

	buffer 	*docroot;
	buffer 	*host;

	mod_sql_vhost_core_plugin_config **config_storage;

	mod_sql_vhost_core_plugin_config conf;
} mod_sql_vhost_core_plugin_data;



#endif