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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include "mod_include.h"
22 #define AP_PROC_DETACHED 1
23 #define AP_PROC_NEWADDRSPACE 2
25 typedef enum {RUN_AS_SSI, RUN_AS_CGI} prog_types;
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 */
36 apr_bucket_brigade **bb;
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.
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));
62 #endif /* _MOD_CGI_H */