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

« back to all changes in this revision

Viewing changes to src/types.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
/*  TYPES.H                                                    */
 
4
/*                                                             */
 
5
/*  Type definitions all dumped here.                          */
 
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: types.h,v 1.5 2000/02/18 03:46:12 dfs Exp $ */
 
14
 
 
15
#include "dynbuf.h"
 
16
 
 
17
/* Values */
 
18
typedef struct {
 
19
    char type;
 
20
    union {
 
21
        char *str;
 
22
        int val;
 
23
    } v;
 
24
} Value;
 
25
 
 
26
/* Define the type of operators */
 
27
typedef struct {
 
28
    char *name;
 
29
    char prec;
 
30
    char type;
 
31
#ifdef HAVE_PROTOS
 
32
    int (*func)(void);
 
33
#else
 
34
    int (*func) ();
 
35
#endif
 
36
} Operator;
 
37
 
 
38
/* Define the structure of a variable */
 
39
typedef struct var {
 
40
    struct var *next;
 
41
    char name[VAR_NAME_LEN+1];
 
42
    char preserve;
 
43
    Value v;
 
44
} Var;
 
45
 
 
46
/* A trigger */
 
47
typedef struct {
 
48
    int wd;
 
49
    int d;
 
50
    int m;
 
51
    int y;
 
52
    int back;
 
53
    int delta;
 
54
    int rep;
 
55
    int localomit;
 
56
    int skip;
 
57
    int until;
 
58
    int typ;
 
59
    int once;
 
60
    int scanfrom;
 
61
    int priority;
 
62
    char sched[VAR_NAME_LEN+1];  /* Scheduling function */
 
63
    char warn[VAR_NAME_LEN+1];   /* Warning function    */
 
64
    char tag[TAG_LEN+1];
 
65
    char passthru[PASSTHRU_LEN+1];
 
66
} Trigger;
 
67
 
 
68
/* A time trigger */
 
69
typedef struct {
 
70
    int ttime;
 
71
    int nexttime;
 
72
    int delta;
 
73
    int rep;
 
74
    int duration;
 
75
} TimeTrig;
 
76
 
 
77
/* The parse pointer */
 
78
typedef struct {
 
79
    char isnested;        /* Is it a nested expression? */
 
80
    char allownested;
 
81
    char *text;           /* Start of text */
 
82
    char *pos;            /* Current position */
 
83
    char *etext;          /* Substituted text */
 
84
    char *epos;           /* Position in substituted text */
 
85
    DynamicBuffer pushedToken;  /* Pushed-back token */
 
86
    char *tokenPushed;    /* NULL if no pushed-back token */
 
87
} Parser;
 
88
 
 
89
typedef Parser *ParsePtr;  /* Pointer to parser structure */
 
90
 
 
91
/* Some useful manifest constants */
 
92
#define NO_BACK 0
 
93
#define NO_DELTA 0
 
94
#define NO_REP 0
 
95
#define NO_WD 0
 
96
#define NO_DAY -1
 
97
#define NO_MON -1
 
98
#define NO_YR -1
 
99
#define NO_UNTIL -1
 
100
#define NO_ONCE 0
 
101
#define ONCE_ONCE 1
 
102
#define NO_DATE -1
 
103
#define NO_SKIP 0
 
104
#define SKIP_SKIP 1
 
105
#define BEFORE_SKIP 2
 
106
#define AFTER_SKIP 3
 
107
 
 
108
#define NO_TIME 1500 /* >1440, ie > than the largest possible legal time */
 
109
 
 
110
#define NO_PRIORITY 5000 /* Default priority is midway between 0 and 9999 */
 
111
 
 
112
#define NO_TYPE  0
 
113
#define MSG_TYPE 1
 
114
#define RUN_TYPE 2
 
115
#define CAL_TYPE 3
 
116
#define SAT_TYPE 4
 
117
#define PS_TYPE  5
 
118
#define PSF_TYPE 6
 
119
#define MSF_TYPE 7
 
120
#define PASSTHRU_TYPE 8
 
121
 
 
122
 
 
123
/* DEFINES for debugging flags */
 
124
#define DB_PRTLINE   1
 
125
#define DB_PRTEXPR   2
 
126
#define DB_PRTTRIG   4
 
127
#define DB_DUMP_VARS 8
 
128
#define DB_ECHO_LINE 16
 
129
 
 
130
/* Enumeration of the tokens */
 
131
enum TokTypes
 
132
{ T_Illegal,
 
133
  /* Commands first */
 
134
  T_Rem, T_Push, T_Pop, T_Preserve, T_Include, T_If, T_Else, T_EndIf,
 
135
  T_IfTrig, T_ErrMsg,
 
136
  T_Set, T_UnSet, T_Fset, T_Omit, T_Banner, T_Exit,
 
137
  T_WkDay,
 
138
  T_Month, T_Time,
 
139
  T_Skip, T_At, T_RemType, T_Until, T_Year, T_Day, T_Rep, T_Delta, T_Back,
 
140
  T_Once,
 
141
  T_Empty,
 
142
  T_Comment,
 
143
  T_Number,
 
144
  T_Clr,
 
145
  T_Debug,
 
146
  T_Dumpvars,
 
147
  T_Scanfrom,
 
148
  T_Flush,
 
149
  T_Priority,
 
150
  T_Sched,
 
151
  T_Warn,
 
152
  T_Tag,
 
153
  T_Duration
 
154
};
 
155
 
 
156
/* The structure of a token */
 
157
typedef struct {
 
158
    char *name;
 
159
    char MinLen;
 
160
    enum TokTypes type;
 
161
    int val;
 
162
} Token;
 
163
 
 
164
/* Flags for the state of the "if" stack */
 
165
#define IF_TRUE      0
 
166
#define IF_FALSE     1
 
167
#define BEFORE_ELSE  0
 
168
#define AFTER_ELSE   2
 
169
#define IF_MASK      3
 
170
#define IF_TRUE_MASK 1
 
171
#define IF_ELSE_MASK 2
 
172
 
 
173
/* Flags for the DoSubst function */
 
174
#define NORMAL_MODE 0
 
175
#define CAL_MODE 1
 
176
#define QUOTE_MARKER 1 /* Unlikely character to appear in reminder */
 
177
 
 
178
/* Flags for disabling run */
 
179
#define RUN_CMDLINE  1
 
180
#define RUN_SCRIPT   2
 
181
#define RUN_NOTOWNER 4
 
182
 
 
183
/* Flags for the SimpleCalendar format */
 
184
#define SC_AMPM   0   /* Time shown as 3:00am, etc. */
 
185
#define SC_MIL    1   /* 24-hour time format */
 
186
#define SC_NOTIME 2   /* Do not display time in SC format. */
 
187
 
 
188
/* Flags for sorting */
 
189
#define SORT_NONE    0
 
190
#define SORT_ASCEND  1
 
191
#define SORT_DESCEND 2