"Fossies" - the Fresh Open Source Software Archive

Member "mod_auth_pubtkt-0.14/src/ap_compat.h" (17 Dec 2020, 9332 Bytes) of package /linux/www/apache_httpd_modules/mod_auth_pubtkt-0.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ap_compat.h" see the Fossies "Dox" file reference documentation.

    1 /* Compatibility mappings from apache 2.0 api calls back to apache 1.3.x */
    2 /* Derived from apr_compat.h and apu_compat.h */
    3 
    4 #ifndef AP_COMPAT_H
    5 #define AP_COMPAT_H
    6 
    7 #define APR_INLINE ap_inline 
    8 #define AP_MODULE_DECLARE_DATA MODULE_VAR_EXPORT
    9 #define APR_OFFSETOF XtOffsetOf
   10 #define APR_EGENERAL 0
   11 #define APR_INADDR_NONE INADDR_NONE
   12 
   13 /* Omit Apache2 status from ap_log_rerror, adding APLOG_NOERRNO instead */
   14 #define ap_log_error(mark, level, status, ...) ap_log_error(mark, level | APLOG_NOERRNO, __VA_ARGS__)
   15 #define ap_log_rerror(mark, level, status, ...) ap_log_rerror(mark, level | APLOG_NOERRNO, __VA_ARGS__)
   16 
   17 #define apr_uri_default_port_for_scheme ap_default_port_for_scheme
   18 #define apr_pool_t pool
   19 #define apr_md5_ctx_t ap_md5_ctx_t 
   20 #define apr_md5_encode ap_MD5Encode 
   21 #define apr_md5_final ap_MD5Final 
   22 #define apr_md5_init ap_MD5Init 
   23 #define apr_md5_update ap_MD5Update 
   24 #define apr_array_append ap_append_arrays 
   25 #define apr_array_cat ap_array_cat 
   26 #define apr_array_header_t array_header
   27 #define apr_array_pstrcat ap_array_pstrcat 
   28 #define apr_pool_free_blocks_num_bytes ap_bytes_in_free_blocks  
   29 #define apr_pool_num_bytes ap_bytes_in_pool 
   30 #define apr_check_file_time ap_check_file_time 
   31 #define apr_filetype_e ap_filetype_e 
   32 #define apr_pool_cleanup_for_exec ap_cleanup_for_exec 
   33 #define apr_pool_clear ap_clear_pool 
   34 #define apr_table_clear ap_clear_table 
   35 #define apr_array_copy ap_copy_array 
   36 #define apr_array_copy_hdr ap_copy_array_hdr 
   37 #define apr_table_copy ap_copy_table 
   38 #define apr_cpystrn ap_cpystrn 
   39 #define apr_day_snames ap_day_snames 
   40 #define apr_pool_destroy ap_destroy_pool 
   41 #define apr_time_exp_t ap_exploded_time_t 
   42 #define apr_fnmatch ap_fnmatch 
   43 #define apr_getopt ap_getopt 
   44 #define apr_inet_addr ap_inet_addr 
   45 #define apr_pool_alloc_init ap_init_alloc 
   46 #define apr_is_empty_table ap_is_empty_table 
   47 #define apr_fnmatch_test ap_is_fnmatch 
   48 #define apr_pool_cleanup_kill ap_kill_cleanup 
   49 #define apr_array_make ap_make_array 
   50 #define apr_pool_sub_make ap_make_sub_pool 
   51 #define apr_table_make ap_make_table 
   52 #define apr_month_snames ap_month_snames 
   53 #define apr_pool_note_subprocess ap_note_subprocess 
   54 #define apr_pool_cleanup_null ap_null_cleanup 
   55 #define apr_filepath_merge ap_os_canonical_filename 
   56 /* #define apr_filepath_merge ap_os_case_canonical_filename  */
   57 #define apr_dso_load ap_os_dso_load 
   58 #define apr_dso_unload ap_os_dso_unload 
   59 #define apr_dso_sym ap_os_dso_sym 
   60 #define apr_dso_error ap_os_dso_error 
   61 /** @deprecated @see apr_filepath_merge
   62  *  @warning apr_filepath_merge rejects invalid filenames */
   63 /* #define ap_os_is_filename_valid apr_filepath_merge */
   64 #define apr_proc_kill ap_os_kill 
   65 /* #define ap_os_systemcase_canonical_filename apr_filepath_merge */
   66 #define apr_table_overlap ap_overlap_tables 
   67 #define apr_table_overlay ap_overlay_tables 
   68 #define apr_palloc ap_palloc 
   69 #define apr_pcalloc ap_pcalloc 
   70 #define apr_pool_join ap_pool_join 
   71 #define apr_psprintf ap_psprintf 
   72 #define apr_pstrcat ap_pstrcat 
   73 #define apr_pstrdup ap_pstrdup 
   74 #define apr_pstrndup ap_pstrndup 
   75 #define apr_array_push ap_push_array 
   76 #define apr_pvsprintf ap_pvsprintf 
   77 #define apr_pool_cleanup_register ap_register_cleanup 
   78 #define apr_proc_other_child_register ap_register_other_child 
   79 #define apr_pool_cleanup_run ap_run_cleanup 
   80 #define apr_signal ap_signal 
   81 #define apr_snprintf ap_snprintf 
   82 #define apr_table_add ap_table_add 
   83 #define apr_table_addn ap_table_addn 
   84 #define apr_table_do ap_table_do 
   85 #define apr_table_elts ap_table_elts 
   86 #define apr_table_get ap_table_get 
   87 #define apr_table_merge ap_table_merge 
   88 #define apr_table_mergen ap_table_mergen 
   89 #define apr_table_set ap_table_set 
   90 #define apr_table_setn ap_table_setn 
   91 #define apr_table_unset ap_table_unset 
   92 #define apr_proc_other_child_unregister ap_unregister_other_child 
   93 #define apr_password_validate ap_validate_password 
   94 #define apr_vformatter ap_vformatter 
   95 #define apr_vsnprintf ap_vsnprintf 
   96 #define apr_wait_t ap_wait_t 
   97 
   98 #define apr_isalnum ap_isalnum 
   99 #define apr_isalpha ap_isalpha 
  100 #define apr_iscntrl ap_iscntrl 
  101 #define apr_isdigit ap_isdigit 
  102 #define apr_isgraph ap_isgraph 
  103 #define apr_islower ap_islower 
  104 #define apr_isascii ap_isascii 
  105 #define apr_isprint ap_isprint 
  106 #define apr_ispunct ap_ispunct 
  107 #define apr_isspace ap_isspace 
  108 #define apr_isupper ap_isupper 
  109 #define apr_isxdigit ap_isxdigit 
  110 #define apr_tolower ap_tolower 
  111 #define apr_toupper ap_toupper 
  112 
  113 #define APR_USEC_PER_SEC AP_USEC_PER_SEC 
  114 #define APR_RFC822_DATE_LEN AP_RFC822_DATE_LEN 
  115 #define APR_OVERLAP_TABLES_MERGE AP_OVERLAP_TABLES_MERGE 
  116 #define APR_OVERLAP_TABLES_SET AP_OVERLAP_TABLES_SET 
  117 
  118 #define apr_base64_decode ap_base64decode 
  119 #define apr_base64_decode_binary ap_base64decode_binary 
  120 #define apr_base64_decode_len ap_base64decode_len 
  121 #define apr_base64_encode ap_base64encode 
  122 #define apr_base64_encode_binary ap_base64encode_binary 
  123 #define apr_base64_encode_len ap_base64encode_len 
  124 #define apr_hook_deregister_all ap_hook_deregister_all 
  125 #define apr_hook_sort_register ap_hook_sort_register 
  126 #define apr_hook_debug_show ap_show_hook 
  127 
  128 /* --------------------------------------------------------------------
  129  * the following symbols were moved from httpd-2.0/.../util_date.[ch]
  130  */
  131 #define apr_date_parse_http ap_parseHTTPdate 
  132 #define apr_date_checkmask ap_checkmask 
  133 
  134 /* --------------------------------------------------------------------
  135  * the following symbols were moved from httpd-2.0/.../util_xml.[ch]
  136  */
  137 #define ap_text apr_text
  138 #define ap_text_header apr_text_header
  139 #define ap_text_append apr_text_append
  140 
  141 #define AP_XML_NS_DAV_ID APR_XML_NS_DAV_ID
  142 #define AP_XML_NS_NONE APR_XML_NS_NONE
  143 #define AP_XML_NS_ERROR_BASE APR_XML_NS_ERROR_BASE
  144 #define AP_XML_NS_IS_ERROR(e) APR_XML_NS_IS_ERROR(e)
  145 #define AP_XML_ELEM_IS_EMPTY(e) APR_XML_ELEM_IS_EMPTY(e)
  146 
  147 #define ap_xml_attr apr_xml_attr
  148 #define ap_xml_elem apr_xml_elem
  149 #define ap_xml_doc apr_xml_doc
  150 
  151 #define ap_xml_to_text apr_xml_to_text
  152 #define AP_XML_X2T_FULL APR_XML_X2T_FULL
  153 #define AP_XML_X2T_INNER APR_XML_X2T_INNER
  154 #define AP_XML_X2T_LANG_INNER APR_XML_X2T_LANG_INNER
  155 #define AP_XML_X2T_FULL_NS_LANG APR_XML_X2T_FULL_NS_LANG
  156 
  157 #define ap_xml_empty_elem apr_xml_empty_elem
  158 #define ap_xml_quote_string apr_xml_quote_string
  159 #define ap_xml_quote_elem apr_xml_quote_elem
  160 #define ap_xml_insert_uri apr_xml_insert_uri
  161 #define AP_XML_GET_URI_ITEM(a,i) APR_XML_GET_URI_ITEM(a,i)
  162 
  163 /* From Apache2 httpd.h */
  164 # define ap_strchr(s, c)        strchr(s, c)
  165 
  166 /* From Apache2 http_config.h */
  167 # define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
  168     { directive, func, mconfig, where, RAW_ARGS, help }
  169 # define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
  170     { directive, func, mconfig, where, RAW_ARGS, help }
  171 # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
  172     { directive, func, mconfig, where, TAKE1, help }
  173 # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
  174     { directive, func, mconfig, where, ITERATE, help }
  175 # define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
  176     { directive, func, mconfig, where, TAKE2, help }
  177 # define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
  178     { directive, func, mconfig, where, TAKE12, help }
  179 # define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
  180     { directive, func, mconfig, where, ITERATE2, help }
  181 # define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
  182     { directive, func, mconfig, where, TAKE13, help }
  183 # define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
  184     { directive, func, mconfig, where, TAKE23, help }
  185 # define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
  186     { directive, func, mconfig, where, TAKE123, help }
  187 # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
  188     { directive, func, mconfig, where, TAKE3, help }
  189 # define AP_INIT_FLAG(directive, func, mconfig, where, help) \
  190     { directive, func, mconfig, where, FLAG, help }
  191 
  192 /* use strtok_r instead of apr_strtok */
  193 #define apr_strtok strtok_r
  194 
  195 /* Apache 1.3 doesn't have ap_unescape_url_keep2f */
  196 static char x2c(const char *what)
  197 {
  198     register char digit;
  199 
  200     digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
  201     digit *= 16;
  202     digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
  203     return (digit);
  204 }
  205 
  206 static int ap_unescape_url_keep2f(char *url)
  207 {
  208     register int badesc, badpath;
  209     char *x, *y;
  210 
  211     badesc = 0;
  212     badpath = 0;
  213     /* Initial scan for first '%'. Don't bother writing values before
  214      * seeing a '%' */
  215     y = strchr(url, '%');
  216     if (y == NULL) {
  217         return OK;
  218     }
  219     for (x = y; *y; ++x, ++y) {
  220         if (*y != '%') {
  221             *x = *y;
  222         }
  223         else {
  224             if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  225                 badesc = 1;
  226                 *x = '%';
  227             }
  228             else {
  229                 char decoded;
  230                 decoded = x2c(y + 1);
  231                 if (decoded == '\0') {
  232                     badpath = 1;
  233                 }
  234                 else {
  235                     *x = decoded;
  236                     y += 2;
  237                 }
  238             }
  239         }
  240     }
  241     *x = '\0';
  242     if (badesc) {
  243         return HTTP_BAD_REQUEST;
  244     }
  245     else if (badpath) {
  246         return HTTP_NOT_FOUND;
  247     }
  248     else {
  249         return OK;
  250     }
  251 }
  252 
  253 #endif /* AP_COMPAT_H */