/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/** A node in the expression parse tree */ typedefstruct ap_expr_node ap_expr_t;
/** Struct describing a parsed expression */ typedefstruct { /** The root of the actual expression parse tree */
ap_expr_t *root_node; /** The filename where the expression has been defined (for logging). *MaybeNULL
*/ constchar *filename; /** The line number where the expression has been defined (for logging). */ unsignedint line_number; /** Flags relevant for the expression, see AP_EXPR_FLAG_* */ unsignedint flags; /** The module that is used for loglevel configuration */ int module_index;
} ap_expr_info_t;
/** Use ssl_expr compatibility mode (changes the meaning of the comparison *operators)
*/ #define AP_EXPR_FLAG_SSL_EXPR_COMPAT 1 /** Don't add significant request headers to the Vary response header */ #define AP_EXPR_FLAG_DONT_VARY 2 /** Don't allow functions/vars that bypass the current request's access *restrictionsorwouldotherwiseleakconfidentialinformation. *Usedbye.g.mod_include.
*/ #define AP_EXPR_FLAG_RESTRICTED 4 /** Expression evaluates to a string, not to a bool */ #define AP_EXPR_FLAG_STRING_RESULT 8
/** Context used during evaluation of a parse tree, created by ap_expr_exec */ typedefstruct { /** the current request */
request_rec *r; /** the current connection */
conn_rec *c; /** the current virtual host */
server_rec *s; /** the pool to use */
apr_pool_t *p; /** where to store the error string */ constchar **err; /** ap_expr_info_t for the expression */ const ap_expr_info_t *info; /** regex match information for back references */
ap_regmatch_t *re_pmatch; /** size of the vector pointed to by re_pmatch */
apr_size_t re_nmatch; /** the string corresponding to the re_pmatch */ constchar **re_source; /** A string where the comma separated names of headers are stored *tobelateraddedtotheVary:header.IfNULL,thecallerisnot *interestedinthisinformation.
*/ constchar **vary_this; /** where to store the result string */ constchar **result_string; /** Arbitrary context data provided by the caller for custom functions */ void *data; /** The current recursion level */ int reclvl;
} ap_expr_eval_ctx_t;
/** Unary operator, takes one string argument and returns a bool value. *Thenamemusthavetheform'-z'(oneletteronly). *@paramctxTheevaluationcontext *@paramdataAnopaquecontextprovidedbythelookuphookfunction *@paramargThe(right)operand *@return0or1
*/ typedefint ap_expr_op_unary_t(ap_expr_eval_ctx_t *ctx, constvoid *data, constchar *arg);
/** Binary operator, takes two string arguments and returns a bool value. *Thenamemusthavetheform'-cmp'(atleasttwoletters). *@paramctxTheevaluationcontext *@paramdataAnopaquecontextprovidedbythelookuphookfunction *@paramarg1Theleftoperand *@paramarg2Therightoperand *@return0or1
*/ typedefint ap_expr_op_binary_t(ap_expr_eval_ctx_t *ctx, constvoid *data, constchar *arg1, constchar *arg2);
/** String valued function, takes a string argument and returns a string *@paramctxTheevaluationcontext *@paramdataAnopaquecontextprovidedbythelookuphookfunction *@paramargTheargument *@returnThefunctionsresultstring,maybeNULLfor'emptystring'
*/ typedefconstchar *(ap_expr_string_func_t)(ap_expr_eval_ctx_t *ctx, constvoid *data, constchar *arg);
/** List valued function, takes a string argument and returns a list of strings *Cancurrentlyonlybecalledfollowingthebuiltin'-in'operator. *@paramctxTheevaluationcontext *@paramdataAnopaquecontextprovidedbythelookuphookfunction *@paramargTheargument *@returnThefunctionsresultlistofstrings,maybeNULLfor'emptyarray'
*/ typedef apr_array_header_t *(ap_expr_list_func_t)(ap_expr_eval_ctx_t *ctx, constvoid *data, constchar *arg);
/** Variable lookup function, takes no argument and returns a string *@paramctxTheevaluationcontext *@paramdataAnopaquecontextprovidedbythelookuphookfunction *@returnTheexpandedvariable
*/ typedefconstchar *(ap_expr_var_func_t)(ap_expr_eval_ctx_t *ctx, constvoid *data);
/** parameter struct passed to the lookup hook functions */ typedefstruct { /** type of the looked up object */ int type; #define AP_EXPR_FUNC_VAR 0 #define AP_EXPR_FUNC_STRING 1 #define AP_EXPR_FUNC_LIST 2 #define AP_EXPR_FUNC_OP_UNARY 3 #define AP_EXPR_FUNC_OP_BINARY 4 /** name of the looked up object */ constchar *name;
int flags;
apr_pool_t *pool;
apr_pool_t *ptemp;
/** where to store the function pointer */ constvoid **func; /** where to store the function's context */ constvoid **data; /** where to store the error message (if any) */ constchar **err;
/** arg for pre-parsing (only if a simple string).
* For binary ops, this is the right argument. */ constchar *arg;
} ap_expr_lookup_parms;
/** Function for looking up the provider function for a variable, operator *orfunctioninanexpression. *@paramparmsTheparameterstruct,alsodetermineswheretheresultis *stored. *@returnOKonsuccess, *!OKonfailure, *DECLINEDiftherequestednameisnothandledbythisfunction
*/ typedefint (ap_expr_lookup_fn_t)(ap_expr_lookup_parms *parms);
/** Default lookup function which just calls ap_run_expr_lookup(). *ap_run_expr_lookupcannotbeuseddirectlybecauseithasthewrong *callingconventionunderWindows.
*/
AP_DECLARE_NONSTD(int) ap_expr_lookup_default(ap_expr_lookup_parms *parms);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.