Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/apache2/modperl_error.h
$ cat -n /usr/include/apache2/modperl_error.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_ERROR_H 18 #define MODPERL_ERROR_H 19 20 /*** mod_perl custom errors come here ***/ 21 22 /* to check whether $@ is set by ModPerl::Util::exit */ 23 #define MODPERL_RC_EXIT APR_OS_START_USERERR + 0 24 /* indicate the filter error problem */ 25 #define MODPERL_FILTER_ERROR APR_OS_START_USERERR + 1 26 27 /** 28 * return the string representation of the error code 29 * @param rc error code 30 * @return the error string 31 * 32 * The return value must be immediately copied unless used only in a 33 * limited visible scope where it's clear that Perl_form() is not 34 * called again (which could happen indirectly). If unsure, copy. 35 */ 36 char *modperl_error_strerror(pTHX_ apr_status_t rc); 37 38 void modperl_croak(pTHX_ apr_status_t rc, const char* func); 39 40 #ifdef USE_ITHREADS 41 #define MP_PUTBACK_IF_USED() STMT_START \ 42 { \ 43 modperl_interp_t *interp = modperl_thx_interp_get(aTHX); \ 44 if (interp && interp->refcnt > 1) { \ 45 modperl_interp_unselect(interp); \ 46 } \ 47 } STMT_END 48 #else 49 #define MP_PUTBACK_IF_USED() NOOP 50 #endif 51 52 #define MP_CROAK_PUTBACK(rc, func) STMT_START \ 53 { \ 54 MP_PUTBACK_IF_USED(); \ 55 modperl_croak(aTHX_ rc, func); \ 56 } STMT_END 57 58 #define MP_RUN_CROAK(rc_run, func) STMT_START \ 59 { \ 60 apr_status_t rc = rc_run; \ 61 if (rc != APR_SUCCESS) { \ 62 modperl_croak(aTHX_ rc, func); \ 63 } \ 64 } STMT_END 65 66 #define MP_RUN_CROAK_PUTBACK(rc_run, func) STMT_START \ 67 { \ 68 apr_status_t rc = rc_run; \ 69 if (rc != APR_SUCCESS) { \ 70 MP_PUTBACK_IF_USED(); \ 71 modperl_croak(aTHX_ rc, func); \ 72 } \ 73 } STMT_END 74 75 #define MP_RUN_CROAK_RESET_OK(s, rc_run, func) STMT_START \ 76 { \ 77 apr_status_t rc = rc_run; \ 78 if (rc != APR_SUCCESS) { \ 79 if (APR_STATUS_IS_ECONNRESET(rc) || \ 80 APR_STATUS_IS_ECONNABORTED(rc)) { \ 81 ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, \ 82 "%s got: %s", func, \ 83 modperl_error_strerror(aTHX_ rc)); \ 84 } \ 85 else { \ 86 modperl_croak(aTHX_ rc, func); \ 87 } \ 88 } \ 89 } STMT_END 90 91 #define MP_RUN_CROAK_RESET_OK_PUTBACK(s, rc_run, func) STMT_START \ 92 { \ 93 apr_status_t rc = rc_run; \ 94 if (rc != APR_SUCCESS) { \ 95 if (APR_STATUS_IS_ECONNRESET(rc) || \ 96 APR_STATUS_IS_ECONNABORTED(rc)) { \ 97 ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, \ 98 "%s got: %s", func, \ 99 modperl_error_strerror(aTHX_ rc)); \ 100 } \ 101 else { \ 102 MP_PUTBACK_IF_USED(); \ 103 modperl_croak(aTHX_ rc, func); \ 104 } \ 105 } \ 106 } STMT_END 107 108 #endif /* MODPERL_ERROR_H */ 109 110 /* 111 * Local Variables: 112 * c-basic-offset: 4 113 * indent-tabs-mode: nil 114 * End: 115 */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™