Blame modules/generators/mod_cgi.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @file  mod_cgi.h
Packit 90a5c9
 * @brief CGI Script Execution Extension Module for Apache
Packit 90a5c9
 *
Packit 90a5c9
 * @defgroup MOD_CGI mod_cgi
Packit 90a5c9
 * @ingroup APACHE_MODS
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef _MOD_CGI_H
Packit 90a5c9
#define _MOD_CGI_H 1
Packit 90a5c9
Packit 90a5c9
#include "mod_include.h"
Packit 90a5c9
Packit 90a5c9
typedef enum {RUN_AS_SSI, RUN_AS_CGI} prog_types;
Packit 90a5c9
Packit 90a5c9
typedef struct {
Packit 90a5c9
    apr_int32_t          in_pipe;
Packit 90a5c9
    apr_int32_t          out_pipe;
Packit 90a5c9
    apr_int32_t          err_pipe;
Packit 90a5c9
    int                  process_cgi;
Packit 90a5c9
    apr_cmdtype_e        cmd_type;
Packit 90a5c9
    apr_int32_t          detached;
Packit 90a5c9
    prog_types           prog_type;
Packit 90a5c9
    apr_bucket_brigade **bb;
Packit 90a5c9
    include_ctx_t       *ctx;
Packit 90a5c9
    ap_filter_t         *next;
Packit 90a5c9
    apr_int32_t          addrspace;
Packit 90a5c9
} cgi_exec_info_t;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Registerable optional function to override CGI behavior;
Packit 90a5c9
 * Reprocess the command and arguments to execute the given CGI script.
Packit 90a5c9
 * @param cmd Pointer to the command to execute (may be overridden)
Packit 90a5c9
 * @param argv Pointer to the arguments to pass (may be overridden)
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param p The pool to allocate correct cmd/argv elements within.
Packit 90a5c9
 * @param e_info pass e_info.cmd_type (Set to APR_SHELLCMD or APR_PROGRAM on entry)
Packit 90a5c9
                      and e_info.detached (Should the child start in detached state?)
Packit 90a5c9
 * @remark This callback may be registered by the os-specific module
Packit 90a5c9
 * to correct the command and arguments for apr_proc_create invocation
Packit 90a5c9
 * on a given os.  mod_cgi will call the function if registered.
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command,
Packit 90a5c9
                        (const char **cmd, const char ***argv,
Packit 90a5c9
                         request_rec *r, apr_pool_t *p,
Packit 90a5c9
                         cgi_exec_info_t *e_info));
Packit 90a5c9
Packit 90a5c9
#endif /* _MOD_CGI_H */
Packit 90a5c9
/** @} */
Packit 90a5c9