util_script.h revision 3d96ee83babeec32482c9082c9426340cee8c44d
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen/* ====================================================================
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * The Apache Software License, Version 1.1
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Copyright (c) 2000 The Apache Software Foundation. All rights
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Redistribution and use in source and binary forms, with or without
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * modification, are permitted provided that the following conditions
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * 1. Redistributions of source code must retain the above copyright
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * notice, this list of conditions and the following disclaimer.
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * 2. Redistributions in binary form must reproduce the above copyright
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * notice, this list of conditions and the following disclaimer in
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * the documentation and/or other materials provided with the
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * distribution.
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * 3. The end-user documentation included with the redistribution,
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * if any, must include the following acknowledgment:
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * "This product includes software developed by the
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Apache Software Foundation (http://www.apache.org/)."
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Alternately, this acknowledgment may appear in the software itself,
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * if and wherever such third-party acknowledgments normally appear.
682265d5e2157882861b0091c6b81fa92699b72aTom Gundersen * 4. The names "Apache" and "Apache Software Foundation" must
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * not be used to endorse or promote products derived from this
39d8db043b599a7382f94bfc904d5e108af438bdLennart Poettering * software without prior written permission. For written
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering * permission, please contact apache@apache.org.
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * 5. Products derived from this software may not be called "Apache",
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * nor may "Apache" appear in their name, without prior written
682265d5e2157882861b0091c6b81fa92699b72aTom Gundersen * permission of the Apache Software Foundation.
682265d5e2157882861b0091c6b81fa92699b72aTom Gundersen * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * SUCH DAMAGE.
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * ====================================================================
a5a807e63a50314e190e9166d8a453cd8dd258e3Zbigniew Jędrzejewski-Szmek * This software consists of voluntary contributions made by many
cc56fafeebf814ef035e549115cf1850e6473fa5WaLyong Cho * individuals on behalf of the Apache Software Foundation. For more
a5a807e63a50314e190e9166d8a453cd8dd258e3Zbigniew Jędrzejewski-Szmek * information on the Apache Software Foundation, please see
a5a807e63a50314e190e9166d8a453cd8dd258e3Zbigniew Jędrzejewski-Szmek * Portions of this software are based upon public domain software
a5a807e63a50314e190e9166d8a453cd8dd258e3Zbigniew Jędrzejewski-Szmek * originally written at the National Center for Supercomputing Applications,
682265d5e2157882861b0091c6b81fa92699b72aTom Gundersen * University of Illinois, Urbana-Champaign.
682265d5e2157882861b0091c6b81fa92699b72aTom Gundersen * @package Apache script tools
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Create an environment variable out of an Apache table of key-value pairs
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * @param p pool to allocate out of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * @param t Apache table of key-value pairs
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * @return An array containing the same key-value pairs suitable for
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering * use with an exec call.
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * @deffunc char **ap_create_environment(apr_pool_t *p, apr_table_t *t)
edc501d4674dadc304d45a7e1c5b69e207eb8cd4Lennart PoetteringAP_DECLARE(char **) ap_create_environment(apr_pool_t *p, apr_table_t *t);
edc501d4674dadc304d45a7e1c5b69e207eb8cd4Lennart Poettering * This "cute" little function comes about because the path info on
edc501d4674dadc304d45a7e1c5b69e207eb8cd4Lennart Poettering * filenames and URLs aren't always the same. So we take the two,
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering * and find as much of the two that match as possible.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * @param uri The uri we are currently parsing
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * @param path_info The current path info
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering * @return The length of the path info
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering * @deffunc int ap_fine_path_info(const char *uri, const char *path_info)
091a364c802e34a58f3260c9cb5db9b75c62215cTom GundersenAP_DECLARE(int) ap_find_path_info(const char *uri, const char *path_info);
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Add CGI environment variables required by HTTP/1.1 to the request's
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * environment table
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * @param r the current request
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * @deffunc void ap_add_cgi_vars(request_rec *r)
091a364c802e34a58f3260c9cb5db9b75c62215cTom GundersenAP_DECLARE(void) ap_add_cgi_vars(request_rec *r);
96e6e394431dcc1db52847be311e2c8e61d7a9d6Lennart Poettering * Add common CGI environment variables to the requests environment table
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * @param r The current request
af4ec4309e8f82aad87a8d574785c12f8763d5f8Lennart Poettering * @deffunc void ap_add_common_vars(request_rec *r)
af4ec4309e8f82aad87a8d574785c12f8763d5f8Lennart PoetteringAP_DECLARE(void) ap_add_common_vars(request_rec *r);
091a364c802e34a58f3260c9cb5db9b75c62215cTom Gundersen * Read headers output from a script, ensuring that the output is valid. If
* @deffunc int ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc)(char *, int, void *), void *getsfunc_data)
char *buffer,
const char **termch,
int *termarg, ...);
* @deffunc int ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc)(char *, int, void *), void *getsfunc_data)
int (*getsfunc) (char *, int, void *),
void *getsfunc_data);
#ifdef __cplusplus