2 ===================================================================
3 RCS file: /homes/amcore/cvsroot/amanda-2/regex-src/regex2.h,v
4 retrieving revision 1.2
5 retrieving revision 1.4
7 --- regex2.h 1997/09/30 06:28:57 1.2
8 +++ regex2.h 1997/11/07 20:43:30 1.4
10 #define OP(n) ((n)&OPRMASK)
11 #define OPND(n) ((n)&OPDMASK)
12 #define SOP(op, opnd) ((op)|(opnd))
14 +#ifndef UNSIGNEDLONG1
16 +#define UNSIGNEDLONG1 1ul
18 +#define UNSIGNEDLONG1 ((unsigned long)1)
22 +#define MAKE_UNSIGNED_LONG(num) (UNSIGNEDLONG1*num)
23 +#define SHIFTED_UL(num) (MAKE_UNSIGNED_LONG(num) << OPSHIFT)
25 /* operators meaning operand */
26 /* (back, fwd are offsets) */
27 -#define OEND (1ul<<OPSHIFT) /* endmarker - */
28 -#define OCHAR (2ul<<OPSHIFT) /* character unsigned char */
29 -#define OBOL (3ul<<OPSHIFT) /* left anchor - */
30 -#define OEOL (4ul<<OPSHIFT) /* right anchor - */
31 -#define OANY (5ul<<OPSHIFT) /* . - */
32 -#define OANYOF (6ul<<OPSHIFT) /* [...] set number */
33 -#define OBACK_ (7ul<<OPSHIFT) /* begin \d paren number */
34 -#define O_BACK (8ul<<OPSHIFT) /* end \d paren number */
35 -#define OPLUS_ (9ul<<OPSHIFT) /* + prefix fwd to suffix */
36 -#define O_PLUS (10ul<<OPSHIFT) /* + suffix back to prefix */
37 -#define OQUEST_ (11ul<<OPSHIFT) /* ? prefix fwd to suffix */
38 -#define O_QUEST (12ul<<OPSHIFT) /* ? suffix back to prefix */
39 -#define OLPAREN (13ul<<OPSHIFT) /* ( fwd to ) */
40 -#define ORPAREN (14ul<<OPSHIFT) /* ) back to ( */
41 -#define OCH_ (15ul<<OPSHIFT) /* begin choice fwd to OOR2 */
42 -#define OOR1 (16ul<<OPSHIFT) /* | pt. 1 back to OOR1 or OCH_ */
43 -#define OOR2 (17ul<<OPSHIFT) /* | pt. 2 fwd to OOR2 or O_CH */
44 -#define O_CH (18ul<<OPSHIFT) /* end choice back to OOR1 */
45 -#define OBOW (19ul<<OPSHIFT) /* begin word - */
46 -#define OEOW (20ul<<OPSHIFT) /* end word - */
47 +#define OEND (SHIFTED_UL(1)) /* endmarker - */
48 +#define OCHAR (SHIFTED_UL(2)) /* character unsigned char */
49 +#define OBOL (SHIFTED_UL(3)) /* left anchor - */
50 +#define OEOL (SHIFTED_UL(4)) /* right anchor - */
51 +#define OANY (SHIFTED_UL(5)) /* . - */
52 +#define OANYOF (SHIFTED_UL(6)) /* [...] set number */
53 +#define OBACK_ (SHIFTED_UL(7)) /* begin \d paren number */
54 +#define O_BACK (SHIFTED_UL(8)) /* end \d paren number */
55 +#define OPLUS_ (SHIFTED_UL(9)) /* + prefix fwd to suffix */
56 +#define O_PLUS (SHIFTED_UL(10)) /* + suffix back to prefix */
57 +#define OQUEST_ (SHIFTED_UL(11)) /* ? prefix fwd to suffix */
58 +#define O_QUEST (SHIFTED_UL(12)) /* ? suffix back to prefix */
59 +#define OLPAREN (SHIFTED_UL(13)) /* ( fwd to ) */
60 +#define ORPAREN (SHIFTED_UL(14)) /* ) back to ( */
61 +#define OCH_ (SHIFTED_UL(15)) /* begin choice fwd to OOR2 */
62 +#define OOR1 (SHIFTED_UL(16)) /* | pt. 1 back to OOR1 or OCH_ */
63 +#define OOR2 (SHIFTED_UL(17)) /* | pt. 2 fwd to OOR2 or O_CH */
64 +#define O_CH (SHIFTED_UL(18)) /* end choice back to OOR1 */
65 +#define OBOW (SHIFTED_UL(19)) /* begin word - */
66 +#define OEOW (SHIFTED_UL(20)) /* end word - */
69 * Structure for [] character-set representation. Character sets are
71 ===================================================================
72 RCS file: /homes/amcore/cvsroot/amanda-2/regex-src/regexec.c,v
73 retrieving revision 1.2
74 retrieving revision 1.4
76 --- regexec.c 1997/09/30 06:28:59 1.2
77 +++ regexec.c 1997/11/07 20:43:32 1.4
80 #define states1 states /* for later use in regexec() decision */
81 #define CLEAR(v) ((v) = 0)
82 -#define SET0(v, n) ((v) &= ~(1ul << (n)))
83 -#define SET1(v, n) ((v) |= 1ul << (n))
84 -#define ISSET(v, n) ((v) & (1ul << (n)))
85 +#define SET0(v, n) ((v) &= ~(MAKE_UNSIGNED_LONG(1) << (n)))
86 +#define SET1(v, n) ((v) |= (MAKE_UNSIGNED_LONG(1)) << (n))
87 +#define ISSET(v, n) ((v) & ((MAKE_UNSIGNED_LONG(1)) << (n)))
88 #define ASSIGN(d, s) ((d) = (s))
89 #define EQ(a, b) ((a) == (b))
90 #define STATEVARS int dummy /* dummy version */