1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
8 * Copyright (C) 2001-2008 Alvaro Lopez Ortega
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 #ifndef CHEROKEE_HANDLER_OSM_H
26 #define CHEROKEE_HANDLER_OSM_H
28 #include <cherokee/common-internal.h>
29 #include <cherokee/cherokee.h>
38 CHEROKEE_RWLOCK_T(lock
);
40 } cherokee_handler_osm_priv_t
;
42 #define OSM_PRIV(x) ((cherokee_handler_osm_priv_t *)((x)->priv))
43 #define OSM_LOCK(x) (&OSM_PRIV(x)->lock)
46 cherokee_module_props_t base
;
47 cherokee_boolean_t read_only
;
48 cherokee_buffer_t db_hostname
;
50 cherokee_buffer_t db_username
;
51 cherokee_buffer_t db_password
;
52 cherokee_buffer_t db_name
;
55 cherokee_list_t dbh_pool
;
56 } cherokee_handler_osm_props_t
;
60 cherokee_handler_t handler
;
61 cherokee_buffer_t buffer
;
62 } cherokee_handler_osm_t
;
65 #define HDL_OSM(x) ((cherokee_handler_osm_t *)(x))
66 #define PROP_OSM(x) ((cherokee_handler_osm_props_t *)(x))
67 #define HDL_OSM_PROPS(x) (PROP_OSM(MODULE(x)->props))
70 /* Library init function
72 void PLUGIN_INIT_NAME(osm
) (cherokee_plugin_loader_t
*loader
);
73 ret_t
cherokee_handler_osm_new (cherokee_handler_t
**hdl
, cherokee_connection_t
*cnt
, cherokee_module_props_t
*props
);
75 /* virtual methods implementation
77 ret_t
cherokee_handler_osm_init (cherokee_handler_osm_t
*hdl
);
78 ret_t
cherokee_handler_osm_free (cherokee_handler_osm_t
*hdl
);
79 ret_t
cherokee_handler_osm_step (cherokee_handler_osm_t
*hdl
, cherokee_buffer_t
*buffer
);
80 ret_t
cherokee_handler_osm_add_headers (cherokee_handler_osm_t
*hdl
, cherokee_buffer_t
*buffer
);
82 #endif /* CHEROKEE_HANDLER_OSM_H */