/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* RE character class support
*/
#include "reglib.h"
struct Ctype_s
{
const char* name;
#if _lib_wctype
#endif
};
/*
* this stuff gets around posix failure to define isblank,
* and the fact that ctype functions are macros
* and any local extensions that may not even have functions or macros
*/
#if _need_iswblank
int
{
static int initialized;
if (!initialized)
{
initialized = 1;
}
}
#endif
#if _lib_wctype
static int Is_wc_1(int);
static int Is_wc_2(int);
static int Is_wc_3(int);
static int Is_wc_4(int);
static int Is_wc_5(int);
static int Is_wc_6(int);
static int Is_wc_7(int);
static int Is_wc_8(int);
static int Is_wc_9(int);
static int Is_wc_10(int);
static int Is_wc_11(int);
static int Is_wc_12(int);
static int Is_wc_13(int);
static int Is_wc_14(int);
static int Is_wc_15(int);
static int Is_wc_16(int);
#endif
{
#if _lib_wctype
{ 0, 0, Is_wc_1 },
{ 0, 0, Is_wc_2 },
{ 0, 0, Is_wc_3 },
{ 0, 0, Is_wc_4 },
{ 0, 0, Is_wc_5 },
{ 0, 0, Is_wc_6 },
{ 0, 0, Is_wc_7 },
{ 0, 0, Is_wc_8 },
{ 0, 0, Is_wc_9 },
{ 0, 0, Is_wc_10 },
{ 0, 0, Is_wc_11 },
{ 0, 0, Is_wc_12 },
{ 0, 0, Is_wc_13 },
{ 0, 0, Is_wc_14 },
{ 0, 0, Is_wc_15 },
{ 0, 0, Is_wc_16 },
#else
#define WTYPES 0
#endif
};
#if _lib_wctype
#endif
/*
* return pointer to ctype function for :class:] in s
* s points to the first char after the initial [
* dynamic wctype classes are locale-specific
* dynamic entry locale is punned in Ctype_t.next
* the search does a lazy (one entry at a time) flush on locale mismatch
* if e!=0 it points to next char in s
* 0 returned on error
*/
regclass(const char* s, char** e)
{
register int c;
register size_t n;
register const char* t;
if (!(c = *s++))
return 0;
for (t = s; *t && (*t != c || *(t + 1) != ']'); t++);
if (*t != c || !(n = t - s))
return 0;
goto found;
{
#if _lib_wctype
if (!zp)
{
}
#endif
goto found;
}
#if _lib_wctype
{
return 0;
{
}
}
{
return 0;
}
/* mvs.390 needs the (char*) cast -- barf */
{
return 0;
}
#endif
if (e)
*e = (char*)t + 2;
}
/*
* associate the ctype function fun with name
*/
int
{
register size_t n;
{
return 0;
}
return REG_ESPACE;
return 0;
}
/*
* return pointer to ctype function for token
*/
{
switch (type)
{
case T_ALNUM_NOT: return Notword;
case T_DIGIT_NOT: return Notdigit;
case T_SPACE_NOT: return Notspace;
}
return 0;
}