~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/sge_depend/ifparser.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $XConsortium: ifparser.h /main/4 1996/09/28 16:15:24 rws $
 
3
 *
 
4
 * Copyright 1992 Network Computing Devices, Inc.
 
5
 * 
 
6
 * Permission to use, copy, modify, and distribute this software and its
 
7
 * documentation for any purpose and without fee is hereby granted, provided
 
8
 * that the above copyright notice appear in all copies and that both that
 
9
 * copyright notice and this permission notice appear in supporting
 
10
 * documentation, and that the name of Network Computing Devices may not be
 
11
 * used in advertising or publicity pertaining to distribution of the software
 
12
 * without specific, written prior permission.  Network Computing Devices makes
 
13
 * no representations about the suitability of this software for any purpose.
 
14
 * It is provided ``as is'' without express or implied warranty.
 
15
 * 
 
16
 * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
 
17
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
 
18
 * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
 
19
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 
20
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 
21
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 * 
 
24
 * Author:  Jim Fulton
 
25
 *          Network Computing Devices, Inc.
 
26
 * 
 
27
 * Simple if statement processor
 
28
 *
 
29
 * This module can be used to evaluate string representations of C language
 
30
 * if constructs.  It accepts the following grammar:
 
31
 * 
 
32
 *     EXPRESSION       :=      VALUE
 
33
 *                       |      VALUE  BINOP    EXPRESSION
 
34
 * 
 
35
 *     VALUE            :=      '('  EXPRESSION  ')'
 
36
 *                       |      '!'  VALUE
 
37
 *                       |      '-'  VALUE
 
38
 *                       |      'defined'  '('  variable  ')'
 
39
 *                       |      variable
 
40
 *                       |      number
 
41
 * 
 
42
 *     BINOP            :=      '*'     |  '/'  |  '%'
 
43
 *                       |      '+'     |  '-'
 
44
 *                       |      '<<'    |  '>>'
 
45
 *                       |      '<'     |  '>'  |  '<='  |  '>='
 
46
 *                       |      '=='    |  '!='
 
47
 *                       |      '&'     |  '|'
 
48
 *                       |      '&&'    |  '||'
 
49
 * 
 
50
 * The normal C order of precidence is supported.
 
51
 * 
 
52
 * 
 
53
 * External Entry Points:
 
54
 * 
 
55
 *     ParseIfExpression                parse a string for #if
 
56
 */
 
57
 
 
58
#include <stdio.h>
 
59
 
 
60
#define const /**/
 
61
typedef int Bool;
 
62
#define False 0
 
63
#define True 1
 
64
 
 
65
typedef struct _if_parser IfParser;
 
66
 
 
67
#ifdef __STDC__
 
68
typedef char *(*ErrorHandlerT) (IfParser *, const char *, const char *); 
 
69
typedef long (*EvalVariableT) (IfParser *, const char *, int); 
 
70
typedef int (*EvalDefinedT) (IfParser *, const char *, int); 
 
71
#else
 
72
typedef char *(*ErrorHandlerT) (); 
 
73
typedef long (*EvalVariableT) (); 
 
74
typedef int (*EvalDefinedT) (); 
 
75
#endif
 
76
 
 
77
struct _if_parser {
 
78
    struct {                            /* functions */
 
79
      ErrorHandlerT handle_error;
 
80
      EvalVariableT eval_variable;
 
81
      EvalDefinedT eval_defined;
 
82
    } funcs;
 
83
    char *data;
 
84
};
 
85
 
 
86
char *ParseIfExpression (
 
87
#ifdef __STDC__
 
88
    IfParser *, 
 
89
    const char *, 
 
90
    long *
 
91
#endif
 
92
);
 
93