bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / modules / generators / mod_cgi.h
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements.  See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License.  You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef _MOD_CGI_H
18 #define _MOD_CGI_H 1
19
20 #include "mod_include.h"
21
22 #define AP_PROC_DETACHED       1
23 #define AP_PROC_NEWADDRSPACE   2
24
25 typedef enum {RUN_AS_SSI, RUN_AS_CGI} prog_types;
26
27 typedef struct {
28     apr_int32_t          in_pipe;
29     apr_int32_t          out_pipe;
30     apr_int32_t          err_pipe;
31     int                  process_cgi;
32     apr_cmdtype_e        cmd_type;
33     apr_int32_t          detached; /* used as a bitfield for detached_ & addrspace_set, */
34                                    /* when initializing apr_proc_attr structure */
35     prog_types           prog_type;
36     apr_bucket_brigade **bb;
37     include_ctx_t       *ctx;
38     ap_filter_t         *next;
39 } cgi_exec_info_t;
40
41 /**
42  * Registerable optional function to override CGI behavior;
43  * Reprocess the command and arguments to execute the given CGI script.
44  * @param cmd Pointer to the command to execute (may be overridden)
45  * @param argv Pointer to the arguments to pass (may be overridden)
46  * @param r The current request
47  * @param p The pool to allocate correct cmd/argv elements within.
48  * @param process_cgi Set true if processing r->filename and r->args
49  *                    as a CGI invocation, otherwise false
50  * @param type Set to APR_SHELLCMD or APR_PROGRAM on entry, may be
51  *             changed to invoke the program with alternate semantics.
52  * @param detach Should the child start in detached state?  Default is no. 
53  * @remark This callback may be registered by the os-specific module 
54  * to correct the command and arguments for apr_proc_create invocation
55  * on a given os.  mod_cgi will call the function if registered.
56  */
57 APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command, 
58                         (const char **cmd, const char ***argv,
59                          request_rec *r, apr_pool_t *p, 
60                          cgi_exec_info_t *e_info));
61
62 #endif /* _MOD_CGI_H */