home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / os2 / apach134.arj / APACH134.ZIP / src / include / ap_mmn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-08  |  11.2 KB  |  234 lines

  1. /* ====================================================================
  2.  * Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
  3.  *
  4.  * Redistribution and use in source and binary forms, with or without
  5.  * modification, are permitted provided that the following conditions
  6.  * are met:
  7.  *
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer. 
  10.  *
  11.  * 2. Redistributions in binary form must reproduce the above copyright
  12.  *    notice, this list of conditions and the following disclaimer in
  13.  *    the documentation and/or other materials provided with the
  14.  *    distribution.
  15.  *
  16.  * 3. All advertising materials mentioning features or use of this
  17.  *    software must display the following acknowledgment:
  18.  *    "This product includes software developed by the Apache Group
  19.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  20.  *
  21.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  22.  *    endorse or promote products derived from this software without
  23.  *    prior written permission. For written permission, please contact
  24.  *    apache@apache.org.
  25.  *
  26.  * 5. Products derived from this software may not be called "Apache"
  27.  *    nor may "Apache" appear in their names without prior written
  28.  *    permission of the Apache Group.
  29.  *
  30.  * 6. Redistributions of any form whatsoever must retain the following
  31.  *    acknowledgment:
  32.  *    "This product includes software developed by the Apache Group
  33.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  36.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  38.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  41.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  42.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  43.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  44.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  45.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  46.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Group and was originally based
  51.  * on public domain software written at the National Center for
  52.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  53.  * For more information on the Apache Group and the Apache HTTP server
  54.  * project, please see <http://www.apache.org/>.
  55.  *
  56.  */
  57.  
  58. #ifndef APACHE_AP_MMN_H
  59. #define APACHE_AP_MMN_H
  60.  
  61. /*
  62.  * MODULE_MAGIC_NUMBER_MAJOR
  63.  * Major API changes that could cause compatibility problems for older modules
  64.  * such as structure size changes.  No binary compatibility is possible across
  65.  * a change in the major version.
  66.  *
  67.  * MODULE_MAGIC_NUMBER_MINOR
  68.  * Minor API changes that do not cause binary compatibility problems.
  69.  * Should be reset to 0 when upgrading MODULE_MAGIC_NUMBER_MAJOR.
  70.  *
  71.  * See the MODULE_MAGIC_AT_LEAST macro below for an example.
  72.  */
  73.  
  74. /*
  75.  * 19950525        - original value
  76.  * 19960512 (1.1b2)    - updated, 1.1, version.
  77.  * 19960526 (1.1b3)    - get_token(), table_unset(), pstrndup()
  78.  *              functions added
  79.  * 19960725 (1.2-dev)    - HTTP/1.1 compliance
  80.  *              (new version of read_client_block)
  81.  * 19960806 (1.2-dev)    - scan_script_header_err() added
  82.  * 19961007 (1.2-dev)    - replace read_client_block() with get_client_block()
  83.  * 19961125 (1.2b1)    - change setup_client_block() to Roy's version
  84.  * 19961211 (1.2b3)    - rwrite() added
  85.  * 19970103 (1.2b5-dev)    - header parse API
  86.  * 19970427 (1.2b9-dev)    - port references made unsigned
  87.  * 19970526 (1.2)    - correct vhost walk for multiple requests on a single
  88.  *              connect
  89.  * 19970623 (1.3-dev)    - NT changes
  90.  * 19970628 (1.3-dev)    - ap_slack (fd fixes) added
  91.  * 19970717 (1.3-dev)    - child_init API hook added
  92.  * 19970719 (1.3-dev)    - discard_request_body() added (to clear the decks
  93.  *              as needed)
  94.  * 19970728 (1.3a2-dev)    - child_exit API hook added
  95.  * 19970818 (1.3a2-dev)    - post read-request phase added
  96.  * 19970825 (1.3a2-dev)    - r->mtime cell added
  97.  * 19970831 (1.3a2-dev)    - error logging changed to use aplog_error()
  98.  * 19970902 (1.3a2-dev)    - MD5 routines and structures renamed to ap_*
  99.  * 19970912 (1.3b1-dev)    - set_last_modified split into set_last_modified,
  100.  *               set_etag and meets_conditions
  101.  *              register_other_child API
  102.  *              piped_log API
  103.  *              short_score split into parent and child pieces
  104.  *              os_is_absolute_path
  105.  * 19971026 (1.3b3-dev)    - custom config hooks in place
  106.  * 19980126 (1.3b4-dev)    - ap_cpystrn(), table_addn(), table_setn(),
  107.  *              table_mergen()
  108.  * 19980201 (1.3b4-dev)    - construct_url()
  109.  *              prototype server_rec * -> request_rec *
  110.  *              add get_server_name() and get_server_port()
  111.  * 19980207 (1.3b4-dev)    - add dynamic_load_handle to module structure as part
  112.  *              of the STANDARD_MODULE_STUFF header
  113.  * 19980304 (1.3b6-dev)    - abstraction of SERVER_BUILT and SERVER_VERSION
  114.  * 19980305 (1.3b6-dev)    - ap_config.h added for use by external modules
  115.  * 19980312 (1.3b6-dev)    - parse_uri_components() and its ilk
  116.  *              remove r->hostlen, add r->unparsed_uri
  117.  *              set_string_slot_lower()
  118.  *              clarification: non-RAW_ARGS cmd handlers do not
  119.  *              need to pstrdup() their arguments
  120.  *              clarification: request_rec members content_type,
  121.  *              handler, content_encoding, content_language,
  122.  *              content_languages MUST all be lowercase strings,
  123.  *              and MAY NOT be modified in place -- modifications
  124.  *              require pstrdup().
  125.  * 19980317 (1.3b6-dev)    - CORE_EXPORTs for win32 and <Perl>
  126.  *              API export basic_http_header, send_header_field,
  127.  *              set_keepalive, srm_command_loop, check_cmd_context,
  128.  *              tm2sec
  129.  *              spacetoplus(), plustospace(), client_to_stdout()
  130.  *              removed
  131.  * 19980324 (1.3b6-dev)    - API_EXPORT(index_of_response)
  132.  * 19980413 (1.3b6-dev)    - The BIG SYMBOL RENAMING: general ap_ prefix
  133.  *              (see src/include/compat.h for more details)
  134.  *              ap_vformatter() API, see src/include/ap.h
  135.  * 19980507 (1.3b7-dev)    - addition of ap_add_version_component() and
  136.  *              discontinuation of -DSERVER_SUBVERSION support
  137.  * 19980519 (1.3b7-dev)    - add child_info * to spawn function (as passed to
  138.  *              ap_spawn_child_err_buff) and to ap_call_exec to make
  139.  *              children work correctly on Win32.
  140.  * 19980527 (1.3b8-dev)    - renamed some more functions to ap_ prefix which were
  141.  *              missed at the big renaming (they are defines):
  142.  *              is_default_port, default_port and http_method.
  143.  *              A new communication method for modules was added:
  144.  *              they can create customized error messages under the
  145.  *              "error-notes" key in the request_rec->notes table.
  146.  *              This string will be printed in place of the canned
  147.  *              error responses, and will be propagated to
  148.  *              ErrorDocuments or cgi scripts in the
  149.  *              (REDIRECT_)ERROR_NOTES variable.
  150.  * 19980627 (1.3.1-dev)    - More renaming that we forgot/bypassed. In particular:
  151.  *              table_elts --> ap_table_elts
  152.  *              is_table_empty --> ap_is_table_empty
  153.  * 19980708 (1.3.1-dev)    - ap_isalnum(), ap_isalpha(), ... "8-bit safe" ctype
  154.  *              macros and apctype.h added
  155.  * 19980713 (1.3.1-dev)    - renaming of C header files:
  156.  *              1. conf.h      -> ap_config.h
  157.  *              2. conf_auto.h -> ap_config_auto.h - now merged
  158.  *              3. ap_config.h -> ap_config_auto.h - now merged
  159.  *              4. compat.h    -> ap_compat.h
  160.  *              5. apctype.h   -> ap_ctype.h
  161.  * 19980806 (1.3.2-dev) - add ap_log_rerror()
  162.  *                      - add ap_scan_script_header_err_core()
  163.  *                      - add ap_uuencode()
  164.  *                      - add ap_custom_response()
  165.  * 19980811 (1.3.2-dev)    - added limit_req_line, limit_req_fieldsize, and
  166.  *              limit_req_fields to server_rec.
  167.  *              added limit_req_body to core_dir_config and
  168.  *              ap_get_limit_req_body() to get its value.
  169.  * 19980812 (1.3.2-dev)    - split off MODULE_MAGIC_NUMBER
  170.  * 19980812.2           - add ap_overlap_tables()
  171.  * 19980816 (1.3.2-dev)    - change proxy to use tables for headers, change
  172.  *                        struct cache_req to typedef cache_req.
  173.  *                        Delete ap_proxy_get_header(), ap_proxy_add_header(),
  174.  *                        ap_proxy_del_header(). Change interface of 
  175.  *                        ap_proxy_send_fb() and ap_proxy_cache_error(). 
  176.  *                        Add ap_proxy_send_hdr_line() and ap_proxy_bputs2().
  177.  * 19980825 (1.3.2-dev) - renamed is_HTTP_xxx() macros to ap_is_HTTP_xxx()
  178.  * 19980825.1           - mod_proxy only (minor change): modified interface of
  179.  *                        ap_proxy_read_headers() and rdcache() to use a
  180.  *                        request_rec* instead of pool*
  181.  *                        (for implementing better error reporting).
  182.  * 19980906 (1.3.2-dev) - added ap_md5_binary()
  183.  * 19980917 (1.3.2-dev) - bs2000: changed os_set_authfile() to os_set_account()
  184.  * 19981108 (1.3.4-dev) - added ap_method_number_of()
  185.  *                      - changed value of M_INVALID and added WebDAV methods
  186.  * 19981108.1           - ap_exists_config_define() is now public (minor bump)
  187.  * 19981204             - scoreboard changes -- added generation, changed
  188.  *                        exit_generation to running_generation.  Somewhere
  189.  *                        earlier vhostrec was added, but it's only safe to use
  190.  *                        as of this rev.  See scoreboard.h for documentation.
  191.  * 19981211             - DSO changes -- added ap_single_module_configure()
  192.  *                                    -- added ap_single_module_init()
  193.  * 19981229             - mod_negotiation overhaul -- added ap_make_etag()
  194.  *                        and added vlist_validator to request_rec.
  195.  * 19990101             - renamed macro escape_uri() to ap_escape_uri()
  196.  *                      - added MODULE_MAGIC_COOKIE to identify module structs
  197.  * 19990103 (1.3.4-dev) - added ap_array_pstrcat()
  198.  * 19990105 (1.3.4-dev) - added ap_os_is_filename_valid()
  199.  * 19990106 (1.3.4-dev) - Move MODULE_MAGIC_COOKIE to the end of the
  200.  *                        STANDARD_MODULE_STUFF macro so the version
  201.  *                        numbers and file name remain at invariant offsets
  202.  * 19990108 (1.3.4-dev) - status_drops_connection -> ap_status_drops_connection
  203.  *                        scan_script_header -> ap_scan_script_header_err
  204.  *                      - reordered entries in request_rec that were waiting
  205.  *                        for a non-binary-compatible release.
  206.  */
  207.  
  208. #define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
  209.  
  210. #ifndef MODULE_MAGIC_NUMBER_MAJOR
  211. #define MODULE_MAGIC_NUMBER_MAJOR 19990108
  212. #endif
  213. #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
  214. #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR    /* backward compat */
  215.  
  216. /* Useful for testing for features. */
  217. #define MODULE_MAGIC_AT_LEAST(major,minor)        \
  218.     ((major) > MODULE_MAGIC_NUMBER_MAJOR         \
  219.     || ((major) == MODULE_MAGIC_NUMBER_MAJOR     \
  220.         && (minor) >= MODULE_MAGIC_NUMBER_MINOR))
  221.  
  222. /* For example, suppose you wish to use the ap_overlap_tables
  223.    function.  You can do this:
  224.  
  225. #if MODULE_MAGIC_AT_LEAST(19980812,2)
  226.     ... use ap_overlap_tables()
  227. #else
  228.     ... alternative code which doesn't use ap_overlap_tables()
  229. #endif
  230.  
  231. */
  232.  
  233. #endif /* !APACHE_AP_MMN_H */
  234.