ssl_expr_eval.c revision ef5650b61a8e35f3cc93ec07e73efc17ea329894
/* Copyright 2001-2005 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* _ _
* _ __ ___ ___ __| | ___ ___| | mod_ssl
* | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
* | | | | | | (_) | (_| | \__ \__ \ |
* |_| |_| |_|\___/ \__,_|___|___/___/_|
* |_____|
* Expression Evaluation
*/
/* ``Make love,
not software!''
-- Unknown */
#include "ssl_private.h"
/* _________________________________________________________________
**
** Expression Evaluation
** _________________________________________________________________
*/
static char *ssl_expr_eval_func_file(request_rec *, char *);
static int ssl_expr_eval_strcmplex(char *, char *);
{
case op_True: {
return TRUE;
}
case op_False: {
return FALSE;
}
case op_Not: {
return (!ssl_expr_eval(r, e));
}
case op_Or: {
}
case op_And: {
}
case op_Comp: {
return ssl_expr_eval_comp(r, e);
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
{
case op_EQ: {
}
case op_NE: {
}
case op_LT: {
}
case op_LE: {
}
case op_GT: {
}
case op_GE: {
}
case op_IN: {
do {
break;
}
return found;
}
case op_REG: {
char *word;
}
case op_NRE: {
char *word;
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
{
case op_Digit: {
return string;
}
case op_String: {
return string;
}
case op_Var: {
}
case op_Func: {
else {
ssl_expr_error = "Internal evaluation error: Unknown function name";
return "";
}
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
{
apr_file_t *fp;
char *buf;
ssl_expr_error = "Cannot open file";
return "";
}
ssl_expr_error = "Huge file cannot be read";
return "";
}
if (len == 0) {
}
else {
ssl_expr_error = "Cannot allocate memory";
return "";
}
offset = 0;
ssl_expr_error = "Cannot read from file";
return "";
}
}
return buf;
}
/* a variant of strcmp(3) which works correctly also for number strings */
{
return -1;
return +1;
return 1;
return -1;
for (i = 0; i < n1; i++) {
return 1;
return -1;
}
return 0;
}