Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/apache2/modperl_util.h
$ cat -n /usr/include/apache2/modperl_util.h 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 #ifndef MODPERL_UTIL_H 18 #define MODPERL_UTIL_H 19 20 #include "modperl_common_util.h" 21 22 /* check whether the response phase has been initialized already */ 23 #define MP_CHECK_WBUCKET_INIT(func) \ 24 if (!rcfg->wbucket) { \ 25 Perl_croak(aTHX_ "%s: " func " can't be called " \ 26 "before the response phase", MP_FUNC); \ 27 } 28 29 /* turn off cgi header parsing. in case we are already inside 30 * modperl_callback_per_dir(MP_RESPONSE_HANDLER, r, MP_HOOK_RUN_FIRST); 31 * but haven't sent any data yet, it's too late to change 32 * MpReqPARSE_HEADERS, so change the wbucket's private flag directly 33 */ 34 #define MP_CGI_HEADER_PARSER_OFF(rcfg) \ 35 MpReqPARSE_HEADERS_Off(rcfg); \ 36 if (rcfg->wbucket) { \ 37 rcfg->wbucket->header_parse = 0; \ 38 } 39 40 MP_INLINE server_rec *modperl_sv2server_rec(pTHX_ SV *sv); 41 MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv); 42 43 request_rec *modperl_xs_sv2request_rec(pTHX_ SV *sv, char *classname, CV *cv); 44 45 MP_INLINE SV *modperl_newSVsv_obj(pTHX_ SV *stashsv, SV *obj); 46 47 MP_INLINE SV *modperl_ptr2obj(pTHX_ char *classname, void *ptr); 48 49 int modperl_errsv(pTHX_ int status, request_rec *r, server_rec *s); 50 51 void modperl_errsv_prepend(pTHX_ const char *pat, ...); 52 53 int modperl_require_module(pTHX_ const char *pv, int logfailure); 54 int modperl_require_file(pTHX_ const char *pv, int logfailure); 55 56 void modperl_xs_dl_handles_clear(pTHX); 57 58 void **modperl_xs_dl_handles_get(pTHX); 59 60 void modperl_xs_dl_handles_close(void **handles); 61 62 modperl_cleanup_data_t *modperl_cleanup_data_new(apr_pool_t *p, void *data); 63 64 MP_INLINE void modperl_perl_av_push_elts_ref(pTHX_ AV *dst, AV *src); 65 66 HE *modperl_perl_hv_fetch_he(pTHX_ HV *hv, 67 register char *key, 68 register I32 klen, 69 register U32 hash); 70 71 #define hv_fetch_he(hv,k,l,h) \ 72 modperl_perl_hv_fetch_he(aTHX_ hv, k, l, h) 73 74 void modperl_str_toupper(char *str); 75 76 void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg); 77 78 void modperl_perl_call_list(pTHX_ AV *subs, const char *name); 79 80 void modperl_perl_exit(pTHX_ int status); 81 82 MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s, 83 char *key, SV *sv_val); 84 85 SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key, 86 SV *sv_val, int do_taint); 87 88 MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name); 89 90 /** 91 * slurp the contents of r->filename and return them as a scalar 92 * @param r request record 93 * @param tainted whether the SV should be marked tainted or not 94 * @return a PV scalar with the contents of the file 95 */ 96 SV *modperl_slurp_filename(pTHX_ request_rec *r, int tainted); 97 98 char *modperl_file2package(apr_pool_t *p, const char *file); 99 100 SV *modperl_apr_array_header2avrv(pTHX_ apr_array_header_t *array); 101 apr_array_header_t *modperl_avrv2apr_array_header(pTHX_ apr_pool_t *p, 102 SV *avrv); 103 void modperl_package_unload(pTHX_ const char *package); 104 #if defined(MP_TRACE) && defined(USE_ITHREADS) 105 #define MP_TRACEf_PERLID "perl id 0x%lx" 106 #define MP_TRACEv_PERLID (unsigned long)my_perl 107 #define MP_TRACEv_PERLID_ MP_TRACEv_PERLID, 108 #define MP_TRACEv__PERLID ,MP_TRACEv_PERLID 109 #else 110 #define MP_TRACEf_PERLID 111 #define MP_TRACEv_PERLID 112 #define MP_TRACEv_PERLID_ 113 #define MP_TRACEv__PERLID 114 #endif /* USE_ITHREADS */ 115 116 /* dumping hundreds of lines in the trace, makes it less useful. Get a 117 * string chunk of MP_TRACE_STR_LEN bytes or less. Not too long so it 118 * won't wrap when posted in email. Notice that we copy 'count' bytes 119 * of the string even if count < MP_TRACE_STR_LEN, because the 'str' 120 * buffer doesn't necessarily have \0 terminator at 'count'. As this 121 * is for debug tracing, not to be used in production, it doesn't make 122 * any difference if it's not efficient. 123 */ 124 #define MP_TRACE_STR_LEN 35 125 #define MP_TRACE_STR_TRUNC(p, str, count) \ 126 count < MP_TRACE_STR_LEN \ 127 ? (char *)apr_pstrmemdup(p, str, count) \ 128 : (char *)apr_psprintf(p, "%s...", \ 129 apr_pstrmemdup(p, str, MP_TRACE_STR_LEN)) 130 131 /* functions maintaining the amount of times mod_perl was restarted, 132 * e.g. on Apache start, it restarts itself, so the count will be 133 * first 1, and on on restart 2 */ 134 void modperl_restart_count_inc(server_rec *base_server); 135 int modperl_restart_count(void); 136 137 void modperl_pnotes_kill(void *data); 138 139 SV *modperl_pnotes(pTHX_ modperl_pnotes_t *pnotes, SV *key, SV *val, 140 apr_pool_t *pool ); 141 142 U16 *modperl_code_attrs(pTHX_ CV *cv); 143 144 #if AP_SERVER_MAJORVERSION_NUMBER>2 || \ 145 (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3) 146 apr_status_t 147 modperl_register_auth_provider(apr_pool_t *pool, const char *provider_group, 148 const char *provider_name, 149 const char *provider_version, SV *callback1, 150 SV *callback2, int type); 151 152 apr_status_t 153 modperl_register_auth_provider_name(apr_pool_t *pool, 154 const char *provider_group, 155 const char *provider_name, 156 const char *provider_version, 157 const char *callback1, 158 const char *callback2, int type); 159 #endif 160 161 #endif /* MODPERL_UTIL_H */ 162 163 /* 164 * Local Variables: 165 * c-basic-offset: 4 166 * indent-tabs-mode: nil 167 * End: 168 */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™