regexp.h revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/* : : generated by proto : : */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/***********************************************************************
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China* *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* This software is part of the ast package *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Copyright (c) 1985-2008 AT&T Intellectual Property *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* and is licensed under the *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Common Public License, Version 1.0 *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* by AT&T Intellectual Property *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* A copy of the License is available at *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* http://www.opensource.org/licenses/cpl1.0.txt *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Information and Software Systems Research *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* AT&T Research *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Florham Park NJ *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Glenn Fowler <gsf@research.att.com> *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* David Korn <dgk@research.att.com> *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* Phong Vo <kpv@research.att.com> *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt* *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt***********************************************************************/
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China/*
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * regexp interface and partial implementation
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * what a novel approach
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * don't do it again
9da57d7b0ddd8d73b676ce12c040362132cdd538bt *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * OBSOLETE: use <regex.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifndef _REGEXP_H
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#if !defined(__PROTO__)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <prototyped.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#if !defined(__LINKAGE__)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define __LINKAGE__ /* 2004-08-11 transition */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define _REGEXP_H
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define NBRA 9
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct
9da57d7b0ddd8d73b676ce12c040362132cdd538bt{
9da57d7b0ddd8d73b676ce12c040362132cdd538bt char* re_braslist[NBRA];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt char* re_braelist[NBRA];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt char* re_loc1;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt char* re_loc2;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt char* re_locs;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int re_circf;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int re_nbra;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int re_nodelim;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int re_sed;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} regexp_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define braslist _re_info.re_braslist
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define braelist _re_info.re_braelist
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define circf _re_info.re_circf
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define loc1 _re_info.re_loc1
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define loc2 _re_info.re_loc2
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define locs _re_info.re_locs
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define nbra _re_info.re_nbra
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define nodelim _re_info.re_nodelim
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define sed _re_info.re_sed
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define advance(a,b) _re_exec(&_re_info,a,b,1)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define compile(a,b,c,d) _re_read(&_re_info,a,b,c,d)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define step(a,b) _re_exec(&_re_info,a,b,0)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#if _BLD_ast && defined(__EXPORT__)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#undef __MANGLE__
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define __MANGLE__ __LINKAGE__ __EXPORT__
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538btextern __MANGLE__ int _re_comp __PROTO__((regexp_t*, const char*, char*, unsigned int));
9da57d7b0ddd8d73b676ce12c040362132cdd538btextern __MANGLE__ int _re_exec __PROTO__((regexp_t*, const char*, const char*, int));
9da57d7b0ddd8d73b676ce12c040362132cdd538btextern __MANGLE__ char* _re_putc __PROTO__((int));
9da57d7b0ddd8d73b676ce12c040362132cdd538btextern __MANGLE__ char* _re_read __PROTO__((regexp_t*, const char*, char*, const char*, int));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#undef __MANGLE__
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define __MANGLE__ __LINKAGE__
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifndef _REGEXP_DECLARE
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538btregexp_t _re_info;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538btchar*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt_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;){
9da57d7b0ddd8d73b676ce12c040362132cdd538bt register int c;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt static const char* prev;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifdef INIT
9da57d7b0ddd8d73b676ce12c040362132cdd538bt INIT;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt re->re_nodelim = 0;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((c = GETC()) == seof || c == '\n' || c == -1 || c == 0)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (c != seof)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt UNGETC(c);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt re->re_nodelim = 1;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (!re->re_sed && !prev)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt { ERROR(41); }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt RETURN((char*)endbuf);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt UNGETC(c);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt prev = 0;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (;;)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((c = GETC()) == seof || c == '\n' || c == -1 || c == 0)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (re->re_sed)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt { ERROR(36); }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt UNGETC(c);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt re->re_nodelim = 1;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt break;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (c == '\\')
9da57d7b0ddd8d73b676ce12c040362132cdd538bt {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt _re_putc(c);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((c = GETC()) == seof || c == '\n' || c == -1 || c == 0)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt { ERROR(36); }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt _re_putc(c);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (c = _re_comp(re, _re_putc(0), ep, (char*)endbuf - ep))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt { ERROR(c); }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt prev = endbuf;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt RETURN((char*)prev);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt}
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt