ssl_expr_eval.c revision 02c7b3fa1c2c34a3a9bd236f6cbf2fc5486b8bb0
/* _ _
** _ __ ___ ___ __| | ___ ___| | mod_ssl
** | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
** | | | | | | (_) | (_| | \__ \__ \ | www.modssl.org
** |_| |_| |_|\___/ \__,_|___|___/___/_| ftp.modssl.org
** |_____|
** Expression Evaluation
*/
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
/* ``Make love,
not software!''
-- Unknown */
#include "mod_ssl.h"
#if 0 /* XXX */
/* _________________________________________________________________
**
** 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;
}
}
}
{
char *buf;
int len;
ssl_expr_error = "Cannot open file";
return "";
}
if (len == 0) {
}
else {
ssl_expr_error = "Cannot allocate memory";
return "";
}
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;
}
#endif /* XXX */