1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/coreconf/mkdepend/ifparser.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,83 @@ 1.4 +/* 1.5 + * $Xorg: ifparser.h,v 1.3 2000/08/17 19:41:51 cpqbld Exp $ 1.6 + * 1.7 + * Copyright 1992 Network Computing Devices, Inc. 1.8 + * 1.9 + * Permission to use, copy, modify, and distribute this software and its 1.10 + * documentation for any purpose and without fee is hereby granted, provided 1.11 + * that the above copyright notice appear in all copies and that both that 1.12 + * copyright notice and this permission notice appear in supporting 1.13 + * documentation, and that the name of Network Computing Devices may not be 1.14 + * used in advertising or publicity pertaining to distribution of the software 1.15 + * without specific, written prior permission. Network Computing Devices makes 1.16 + * no representations about the suitability of this software for any purpose. 1.17 + * It is provided ``as is'' without express or implied warranty. 1.18 + * 1.19 + * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 1.20 + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, 1.21 + * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, 1.22 + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 1.23 + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 1.24 + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 1.25 + * PERFORMANCE OF THIS SOFTWARE. 1.26 + * 1.27 + * Author: Jim Fulton 1.28 + * Network Computing Devices, Inc. 1.29 + * 1.30 + * Simple if statement processor 1.31 + * 1.32 + * This module can be used to evaluate string representations of C language 1.33 + * if constructs. It accepts the following grammar: 1.34 + * 1.35 + * EXPRESSION := VALUE 1.36 + * | VALUE BINOP EXPRESSION 1.37 + * | VALUE '?' EXPRESSION ':' EXPRESSION 1.38 + * 1.39 + * VALUE := '(' EXPRESSION ')' 1.40 + * | '!' VALUE 1.41 + * | '-' VALUE 1.42 + * | '~' VALUE 1.43 + * | 'defined' '(' variable ')' 1.44 + * | variable 1.45 + * | number 1.46 + * 1.47 + * BINOP := '*' | '/' | '%' 1.48 + * | '+' | '-' 1.49 + * | '<<' | '>>' 1.50 + * | '<' | '>' | '<=' | '>=' 1.51 + * | '==' | '!=' 1.52 + * | '&' | '^' | '|' 1.53 + * | '&&' | '||' 1.54 + * 1.55 + * The normal C order of precedence is supported. 1.56 + * 1.57 + * 1.58 + * External Entry Points: 1.59 + * 1.60 + * ParseIfExpression parse a string for #if 1.61 + */ 1.62 + 1.63 +/* $XFree86: xc/config/makedepend/ifparser.h,v 3.5 2001/07/25 15:04:40 dawes Exp $ */ 1.64 + 1.65 +#include <stdio.h> 1.66 + 1.67 +typedef int Bool; 1.68 +#define False 0 1.69 +#define True 1 1.70 + 1.71 +typedef struct _if_parser { 1.72 + struct { /* functions */ 1.73 + const char *(*handle_error) (struct _if_parser *, const char *, 1.74 + const char *); 1.75 + long (*eval_variable) (struct _if_parser *, const char *, int); 1.76 + int (*eval_defined) (struct _if_parser *, const char *, int); 1.77 + } funcs; 1.78 + char *data; 1.79 +} IfParser; 1.80 + 1.81 +const char *ParseIfExpression ( 1.82 + IfParser *, 1.83 + const char *, 1.84 + long * 1.85 +); 1.86 +