os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/regcustom.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/regcustom.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,120 @@
     1.4 +/*
     1.5 + * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
     1.6 + * 
     1.7 + * Development of this software was funded, in part, by Cray Research Inc.,
     1.8 + * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
     1.9 + * Corporation, none of whom are responsible for the results.  The author
    1.10 + * thanks all of them. 
    1.11 + * 
    1.12 + * Redistribution and use in source and binary forms -- with or without
    1.13 + * modification -- are permitted for any purpose, provided that
    1.14 + * redistributions in source form retain this entire copyright notice and
    1.15 + * indicate the origin and nature of any modifications.
    1.16 + * 
    1.17 + * I'd appreciate being given credit for this package in the documentation
    1.18 + * of software which uses it, but that is not a requirement.
    1.19 + * 
    1.20 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
    1.21 + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    1.22 + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
    1.23 + * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    1.24 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    1.25 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    1.26 + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    1.27 + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    1.28 + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    1.29 + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.30 + */
    1.31 +
    1.32 +/* headers if any */
    1.33 +#include "tclInt.h"
    1.34 +
    1.35 +/* overrides for regguts.h definitions, if any */
    1.36 +#define	FUNCPTR(name, args)	(*name) _ANSI_ARGS_(args)
    1.37 +#define	MALLOC(n)		ckalloc(n)
    1.38 +#define	FREE(p)			ckfree(VS(p))
    1.39 +#define	REALLOC(p,n)		ckrealloc(VS(p),n)
    1.40 +
    1.41 +
    1.42 +
    1.43 +/*
    1.44 + * Do not insert extras between the "begin" and "end" lines -- this
    1.45 + * chunk is automatically extracted to be fitted into regex.h.
    1.46 + */
    1.47 +/* --- begin --- */
    1.48 +/* ensure certain things don't sneak in from system headers */
    1.49 +#ifdef __REG_WIDE_T
    1.50 +#undef __REG_WIDE_T
    1.51 +#endif
    1.52 +#ifdef __REG_WIDE_COMPILE
    1.53 +#undef __REG_WIDE_COMPILE
    1.54 +#endif
    1.55 +#ifdef __REG_WIDE_EXEC
    1.56 +#undef __REG_WIDE_EXEC
    1.57 +#endif
    1.58 +#ifdef __REG_REGOFF_T
    1.59 +#undef __REG_REGOFF_T
    1.60 +#endif
    1.61 +#ifdef __REG_VOID_T
    1.62 +#undef __REG_VOID_T
    1.63 +#endif
    1.64 +#ifdef __REG_CONST
    1.65 +#undef __REG_CONST
    1.66 +#endif
    1.67 +#ifdef __REG_NOFRONT
    1.68 +#undef __REG_NOFRONT
    1.69 +#endif
    1.70 +#ifdef __REG_NOCHAR
    1.71 +#undef __REG_NOCHAR
    1.72 +#endif
    1.73 +/* interface types */
    1.74 +#define	__REG_WIDE_T	Tcl_UniChar
    1.75 +#define	__REG_REGOFF_T	long	/* not really right, but good enough... */
    1.76 +#define	__REG_VOID_T	VOID
    1.77 +#define	__REG_CONST	CONST
    1.78 +/* names and declarations */
    1.79 +#define	__REG_WIDE_COMPILE	TclReComp
    1.80 +#define	__REG_WIDE_EXEC		TclReExec
    1.81 +#define	__REG_NOFRONT		/* don't want regcomp() and regexec() */
    1.82 +#define	__REG_NOCHAR		/* or the char versions */
    1.83 +#define	regfree		TclReFree
    1.84 +#define	regerror	TclReError
    1.85 +/* --- end --- */
    1.86 +
    1.87 +
    1.88 +
    1.89 +/* internal character type and related */
    1.90 +typedef Tcl_UniChar chr;	/* the type itself */
    1.91 +typedef int pchr;		/* what it promotes to */
    1.92 +typedef unsigned uchr;		/* unsigned type that will hold a chr */
    1.93 +typedef int celt;		/* type to hold chr, MCCE number, or NOCELT */
    1.94 +#define	NOCELT	(-1)		/* celt value which is not valid chr or MCCE */
    1.95 +#define	CHR(c)	(UCHAR(c))	/* turn char literal into chr literal */
    1.96 +#define	DIGITVAL(c)	((c)-'0')	/* turn chr digit into its value */
    1.97 +#if TCL_UTF_MAX > 3
    1.98 +#define	CHRBITS	32		/* bits in a chr; must not use sizeof */
    1.99 +#define	CHR_MIN	0x00000000	/* smallest and largest chr; the value */
   1.100 +#define	CHR_MAX	0xffffffff	/*  CHR_MAX-CHR_MIN+1 should fit in uchr */
   1.101 +#else
   1.102 +#define	CHRBITS	16		/* bits in a chr; must not use sizeof */
   1.103 +#define	CHR_MIN	0x0000		/* smallest and largest chr; the value */
   1.104 +#define	CHR_MAX	0xffff		/*  CHR_MAX-CHR_MIN+1 should fit in uchr */
   1.105 +#endif
   1.106 +
   1.107 +/* functions operating on chr */
   1.108 +#define	iscalnum(x)	Tcl_UniCharIsAlnum(x)
   1.109 +#define	iscalpha(x)	Tcl_UniCharIsAlpha(x)
   1.110 +#define	iscdigit(x)	Tcl_UniCharIsDigit(x)
   1.111 +#define	iscspace(x)	Tcl_UniCharIsSpace(x)
   1.112 +
   1.113 +/* name the external functions */
   1.114 +#define	compile		TclReComp
   1.115 +#define	exec		TclReExec
   1.116 +
   1.117 +/* enable/disable debugging code (by whether REG_DEBUG is defined or not) */
   1.118 +#if 0		/* no debug unless requested by makefile */
   1.119 +#define	REG_DEBUG	/* */
   1.120 +#endif
   1.121 +
   1.122 +/* and pick up the standard header */
   1.123 +#include "regex.h"