~ubuntu-branches/ubuntu/karmic/remind/karmic

« back to all changes in this revision

Viewing changes to src/expr.h

  • Committer: Bazaar Package Importer
  • Author(s): Javier Fernandez-Sanguino Pen~a
  • Date: 1999-02-19 13:36:15 UTC
  • Revision ID: james.westby@ubuntu.com-19990219133615-ovob95sord67b0ks
Tags: 03.00.22-1
* NMU upload, maintainer seems to be missing.
* Changed to main (now GPL) (Closes: #42402)
* New upstream version (Closes: #59447)
* Moved to use debconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************/
 
2
/*                                                             */
 
3
/*  EXPR.H                                                     */
 
4
/*                                                             */
 
5
/*  Contains a few definitions used by expression evaluator.   */
 
6
/*                                                             */
 
7
/*  This file is part of REMIND.                               */
 
8
/*  Copyright (C) 1992-1998 by David F. Skoll                  */
 
9
/*  Copyright (C) 1999-2000 by Roaring Penguin Software Inc.   */
 
10
/*                                                             */
 
11
/***************************************************************/
 
12
 
 
13
/* $Id: expr.h,v 1.4 2000/02/18 03:45:53 dfs Exp $ */
 
14
 
 
15
/* Define the types of values */
 
16
#define ERR_TYPE 0
 
17
#define INT_TYPE 1
 
18
#define TIM_TYPE 2
 
19
#define DATE_TYPE 3
 
20
#define STR_TYPE 4
 
21
 
 
22
/* Define stuff for parsing expressions */
 
23
#define BEG_OF_EXPR '['
 
24
#define END_OF_EXPR ']'
 
25
#define COMMA ','
 
26
 
 
27
#define UN_OP 0  /* Unary operator */
 
28
#define BIN_OP 1 /* Binary Operator */
 
29
#define FUNC 2   /* Function */
 
30
 
 
31
/* Make the pushing and popping of values and operators in-line code
 
32
   for speed.  BEWARE:  These macros invoke return if an error happens ! */
 
33
 
 
34
#define PushOpStack(op) \
 
35
if (OpStackPtr >= OP_STACK_SIZE) \
 
36
return E_OP_STK_OVER; \
 
37
else \
 
38
OpStack[OpStackPtr++] = (op)
 
39
 
 
40
#define PopOpStack(op) \
 
41
if (OpStackPtr <= 0) \
 
42
return E_OP_STK_UNDER; \
 
43
else \
 
44
(op) = OpStack[--OpStackPtr]
 
45
 
 
46
#define PushValStack(val) \
 
47
if (ValStackPtr >= VAL_STACK_SIZE) \
 
48
return E_VA_STK_OVER; \
 
49
else \
 
50
ValStack[ValStackPtr++] = (val)
 
51
 
 
52
#define PopValStack(val) \
 
53
if (ValStackPtr <= 0) \
 
54
return E_VA_STK_UNDER; \
 
55
else \
 
56
(val) = ValStack[--ValStackPtr]