2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
26 * regexp interface and partial implementation
27 * what a novel approach
30 * OBSOLETE: use <regex.h>
34 #if !defined(__PROTO__)
35 #include <prototyped.h>
37 #if !defined(__LINKAGE__)
38 #define __LINKAGE__ /* 2004-08-11 transition */
47 char* re_braslist
[NBRA
];
48 char* re_braelist
[NBRA
];
58 #define braslist _re_info.re_braslist
59 #define braelist _re_info.re_braelist
60 #define circf _re_info.re_circf
61 #define loc1 _re_info.re_loc1
62 #define loc2 _re_info.re_loc2
63 #define locs _re_info.re_locs
64 #define nbra _re_info.re_nbra
65 #define nodelim _re_info.re_nodelim
66 #define sed _re_info.re_sed
68 #define advance(a,b) _re_exec(&_re_info,a,b,1)
69 #define compile(a,b,c,d) _re_read(&_re_info,a,b,c,d)
70 #define step(a,b) _re_exec(&_re_info,a,b,0)
72 #if _BLD_ast && defined(__EXPORT__)
74 #define __MANGLE__ __LINKAGE__ __EXPORT__
77 extern __MANGLE__
int _re_comp
__PROTO__((regexp_t
*, const char*, char*, unsigned int));
78 extern __MANGLE__
int _re_exec
__PROTO__((regexp_t
*, const char*, const char*, int));
79 extern __MANGLE__
char* _re_putc
__PROTO__((int));
80 extern __MANGLE__
char* _re_read
__PROTO__((regexp_t
*, const char*, char*, const char*, int));
83 #define __MANGLE__ __LINKAGE__
85 #ifndef _REGEXP_DECLARE
90 _re_read
__PARAM__((register regexp_t
* re
, const char* instring
, char* ep
, const char* endbuf
, int seof
), (re
, instring
, ep
, endbuf
, seof
)) __OTORP__(register regexp_t
* re
; const char* instring
; char* ep
; const char* endbuf
; int seof
;){
93 static const char* prev
;
100 if ((c
= GETC()) == seof
|| c
== '\n' || c
== -1 || c
== 0)
107 if (!re
->re_sed
&& !prev
)
109 RETURN((char*)endbuf
);
115 if ((c
= GETC()) == seof
|| c
== '\n' || c
== -1 || c
== 0)
126 if ((c
= GETC()) == seof
|| c
== '\n' || c
== -1 || c
== 0)
131 if (c
= _re_comp(re
, _re_putc(0), ep
, (char*)endbuf
- ep
))