1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
5 * Copyright (C) 2001-2009, Eduardo Silva P.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #define MK_PLUGIN_LOAD "plugins.load"
27 #define MK_PLUGIN_ERROR -1 /* plugin execution error */
30 #define MK_PLUGIN_STAGE_10 ((__uint32_t) 1) /* Before server's loop */
31 #define MK_PLUGIN_STAGE_20 ((__uint32_t) 2) /* Accepted connection */
32 #define MK_PLUGIN_STAGE_30 ((__uint32_t) 4) /* Connection assigned */
33 #define MK_PLUGIN_STAGE_40 ((__uint32_t) 8) /* Object Handler */
34 #define MK_PLUGIN_STAGE_50 ((__uint32_t) 16) /* Request ended */
35 #define MK_PLUGIN_STAGE_60 ((__uint32_t) 32) /* Connection closed */
38 struct plugin
*stage_10
;
39 struct plugin
*stage_20
;
40 struct plugin
*stage_30
;
41 struct plugin
*stage_40
;
42 struct plugin
*stage_50
;
43 struct plugin
*stage_60
;
52 /* Plugin external functions */
53 int (*call_init
)(void *api
);
54 int (*call_stage_10
)();
60 struct server_config
*config
;
61 struct sched_list_node
**sched_list
;
63 void *(*malloc
)(int *);
66 typedef char mk_plugin_data_t
[];
67 typedef __uint32_t mk_plugin_stage_t
;
71 void mk_plugin_init();
72 void mk_plugin_stage_run(mk_plugin_stage_t stage
);