forked from grisha/mod_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod_python.h.in
More file actions
191 lines (165 loc) · 4.56 KB
/
Copy pathmod_python.h.in
File metadata and controls
191 lines (165 loc) · 4.56 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#ifndef Mp_MOD_PYTHON_H
#define Mp_MOD_PYTHON_H
/*
* Copyright 2004 Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* Originally developed by Gregory Trubetskoy.
*
*
* mod_python.h
*
* $Id: mod_python.h 231054 2005-08-09 15:37:04Z jgallacher $
*
* See accompanying documentation and source code comments
* for details.
*
*/
/*
* NOTE - NOTE - NOTE - NOTE
*
* If you are looking at mod_python.h, it is an auto-generated file on
* UNIX. This file is kept around for the Win32 platform which
* doesnot use autoconf. Any changes to mod_python.h must also be
* reflected in mod_python.h.in.
*/
/* Apache headers */
#include "httpd.h"
#define CORE_PRIVATE
#include "http_config.h"
#include "http_core.h"
#include "http_main.h"
#include "http_connection.h"
#include "http_protocol.h"
#include "http_request.h"
#include "util_script.h"
#include "util_filter.h"
#include "http_log.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_hash.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
#include "unixd.h"
#endif
/* Python headers */
/* this gets rid of some compile warnings */
#if defined(_POSIX_THREADS)
#undef _POSIX_THREADS
#endif
#include "Python.h"
#include "structmember.h"
#if defined(WIN32) && !defined(WITH_THREAD)
#error Python threading must be enabled on Windows
#endif
#if !defined(WIN32)
#include <sys/socket.h>
#endif
/* pool given to us in ChildInit. We use it for
server.register_cleanup() */
extern apr_pool_t *child_init_pool;
/* Apache module declaration */
extern module AP_MODULE_DECLARE_DATA python_module;
#include "mpversion.h"
#include "util.h"
#include "hlist.h"
#include "hlistobject.h"
#include "tableobject.h"
#include "serverobject.h"
#include "connobject.h"
#include "_apachemodule.h"
#include "requestobject.h"
#include "filterobject.h"
#include "_pspmodule.h"
/** Things specific to mod_python, as an Apache module **/
#define MP_CONFIG_KEY "mod_python_config"
#define VERSION_COMPONENT "mod_python/" MPV_STRING
#define MODULENAME "mod_python.apache"
#define INITFUNC "init"
#define MAIN_INTERPRETER "main_interpreter"
/* used in python_directive_handler */
#define SILENT 1
#define NOTSILENT 0
/* MAX_LOCKS can now be set as a configure option
* ./configure --with-max-locks=INTEGER
*/
#define MAX_LOCKS @MAX_LOCKS@
/* MUTEX_DIR can be set as a configure option
* ./configure --with-mutex-dir=/path/to/dir
*/
#define MUTEX_DIR "@MUTEX_DIR@"
/* python 2.3 no longer defines LONG_LONG, it defines PY_LONG_LONG */
#ifndef LONG_LONG
#define LONG_LONG PY_LONG_LONG
#endif
/* structure to hold interpreter data */
typedef struct {
PyInterpreterState *istate;
PyObject *obcallback;
} interpreterdata;
/* global configuration parameters */
typedef struct
{
apr_global_mutex_t **g_locks;
int nlocks;
int parent_pid;
} py_global_config;
/* structure describing per directory configuration parameters */
typedef struct {
int authoritative;
char *config_dir;
apr_table_t *directives;
apr_table_t *options;
apr_hash_t *hlists; /* hlists for every phase */
apr_hash_t *in_filters;
apr_hash_t *out_filters;
hl_entry *imports; /* for PythonImport */
} py_config;
/* register_cleanup info */
typedef struct
{
request_rec *request_rec;
server_rec *server_rec;
PyObject *handler;
const char *interpreter;
PyObject *data;
} cleanup_info;
/* request config structure */
typedef struct
{
requestobject *request_obj;
apr_hash_t *dynhls; /* dynamically registered handlers
for this request */
} py_req_config;
/* filter context */
typedef struct
{
int transparent;
} python_filter_ctx;
/* a structure to hold a handler,
used in configuration for filters */
typedef struct
{
char *handler;
char *dir;
} py_handler;
apr_status_t python_cleanup(void *data);
#endif /* !Mp_MOD_PYTHON_H */
/*
# makes emacs go into C mode
### Local Variables:
### mode:c
### End:
*/