/[dtapublic]/projs/trunk/shared_source/c_tcl_base_7_5_w_mods/regcustom.h
ViewVC logotype

Diff of /projs/trunk/shared_source/c_tcl_base_7_5_w_mods/regcustom.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 70 by dashley, Mon Oct 31 00:57:34 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  /* $Header$ */  /* $Header$ */
2  /*  /*
3   * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.   * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
4   *   *
5   * Development of this software was funded, in part, by Cray Research Inc.,   * Development of this software was funded, in part, by Cray Research Inc.,
6   * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics   * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
7   * Corporation, none of whom are responsible for the results.  The author   * Corporation, none of whom are responsible for the results.  The author
8   * thanks all of them.   * thanks all of them.
9   *   *
10   * Redistribution and use in source and binary forms -- with or without   * Redistribution and use in source and binary forms -- with or without
11   * modification -- are permitted for any purpose, provided that   * modification -- are permitted for any purpose, provided that
12   * redistributions in source form retain this entire copyright notice and   * redistributions in source form retain this entire copyright notice and
13   * indicate the origin and nature of any modifications.   * indicate the origin and nature of any modifications.
14   *   *
15   * I'd appreciate being given credit for this package in the documentation   * I'd appreciate being given credit for this package in the documentation
16   * of software which uses it, but that is not a requirement.   * of software which uses it, but that is not a requirement.
17   *   *
18   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20   * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL   * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
21   * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,   * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24   * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,   * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26   * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28   */   */
29    
30  /* headers if any */  /* headers if any */
31  #include "tclInt.h"  #include "tclInt.h"
32    
33  /* overrides for regguts.h definitions, if any */  /* overrides for regguts.h definitions, if any */
34  #define FUNCPTR(name, args)     (*name) _ANSI_ARGS_(args)  #define FUNCPTR(name, args)     (*name) _ANSI_ARGS_(args)
35  #define MALLOC(n)               ckalloc(n)  #define MALLOC(n)               ckalloc(n)
36  #define FREE(p)                 ckfree(VS(p))  #define FREE(p)                 ckfree(VS(p))
37  #define REALLOC(p,n)            ckrealloc(VS(p),n)  #define REALLOC(p,n)            ckrealloc(VS(p),n)
38    
39    
40    
41  /*  /*
42   * Do not insert extras between the "begin" and "end" lines -- this   * Do not insert extras between the "begin" and "end" lines -- this
43   * chunk is automatically extracted to be fitted into regex.h.   * chunk is automatically extracted to be fitted into regex.h.
44   */   */
45  /* --- begin --- */  /* --- begin --- */
46  /* ensure certain things don't sneak in from system headers */  /* ensure certain things don't sneak in from system headers */
47  #ifdef __REG_WIDE_T  #ifdef __REG_WIDE_T
48  #undef __REG_WIDE_T  #undef __REG_WIDE_T
49  #endif  #endif
50  #ifdef __REG_WIDE_COMPILE  #ifdef __REG_WIDE_COMPILE
51  #undef __REG_WIDE_COMPILE  #undef __REG_WIDE_COMPILE
52  #endif  #endif
53  #ifdef __REG_WIDE_EXEC  #ifdef __REG_WIDE_EXEC
54  #undef __REG_WIDE_EXEC  #undef __REG_WIDE_EXEC
55  #endif  #endif
56  #ifdef __REG_REGOFF_T  #ifdef __REG_REGOFF_T
57  #undef __REG_REGOFF_T  #undef __REG_REGOFF_T
58  #endif  #endif
59  #ifdef __REG_VOID_T  #ifdef __REG_VOID_T
60  #undef __REG_VOID_T  #undef __REG_VOID_T
61  #endif  #endif
62  #ifdef __REG_CONST  #ifdef __REG_CONST
63  #undef __REG_CONST  #undef __REG_CONST
64  #endif  #endif
65  #ifdef __REG_NOFRONT  #ifdef __REG_NOFRONT
66  #undef __REG_NOFRONT  #undef __REG_NOFRONT
67  #endif  #endif
68  #ifdef __REG_NOCHAR  #ifdef __REG_NOCHAR
69  #undef __REG_NOCHAR  #undef __REG_NOCHAR
70  #endif  #endif
71  /* interface types */  /* interface types */
72  #define __REG_WIDE_T    Tcl_UniChar  #define __REG_WIDE_T    Tcl_UniChar
73  #define __REG_REGOFF_T  long    /* not really right, but good enough... */  #define __REG_REGOFF_T  long    /* not really right, but good enough... */
74  #define __REG_VOID_T    VOID  #define __REG_VOID_T    VOID
75  #define __REG_CONST     CONST  #define __REG_CONST     CONST
76  /* names and declarations */  /* names and declarations */
77  #define __REG_WIDE_COMPILE      TclReComp  #define __REG_WIDE_COMPILE      TclReComp
78  #define __REG_WIDE_EXEC         TclReExec  #define __REG_WIDE_EXEC         TclReExec
79  #define __REG_NOFRONT           /* don't want regcomp() and regexec() */  #define __REG_NOFRONT           /* don't want regcomp() and regexec() */
80  #define __REG_NOCHAR            /* or the char versions */  #define __REG_NOCHAR            /* or the char versions */
81  #define regfree         TclReFree  #define regfree         TclReFree
82  #define regerror        TclReError  #define regerror        TclReError
83  /* --- end --- */  /* --- end --- */
84    
85    
86    
87  /* internal character type and related */  /* internal character type and related */
88  typedef Tcl_UniChar chr;        /* the type itself */  typedef Tcl_UniChar chr;        /* the type itself */
89  typedef int pchr;               /* what it promotes to */  typedef int pchr;               /* what it promotes to */
90  typedef unsigned uchr;          /* unsigned type that will hold a chr */  typedef unsigned uchr;          /* unsigned type that will hold a chr */
91  typedef int celt;               /* type to hold chr, MCCE number, or NOCELT */  typedef int celt;               /* type to hold chr, MCCE number, or NOCELT */
92  #define NOCELT  (-1)            /* celt value which is not valid chr or MCCE */  #define NOCELT  (-1)            /* celt value which is not valid chr or MCCE */
93  #define CHR(c)  (UCHAR(c))      /* turn char literal into chr literal */  #define CHR(c)  (UCHAR(c))      /* turn char literal into chr literal */
94  #define DIGITVAL(c)     ((c)-'0')       /* turn chr digit into its value */  #define DIGITVAL(c)     ((c)-'0')       /* turn chr digit into its value */
95  #define CHRBITS 16              /* bits in a chr; must not use sizeof */  #define CHRBITS 16              /* bits in a chr; must not use sizeof */
96  #define CHR_MIN 0x0000          /* smallest and largest chr; the value */  #define CHR_MIN 0x0000          /* smallest and largest chr; the value */
97  #define CHR_MAX 0xffff          /*  CHR_MAX-CHR_MIN+1 should fit in uchr */  #define CHR_MAX 0xffff          /*  CHR_MAX-CHR_MIN+1 should fit in uchr */
98    
99  /* functions operating on chr */  /* functions operating on chr */
100  #define iscalnum(x)     Tcl_UniCharIsAlnum(x)  #define iscalnum(x)     Tcl_UniCharIsAlnum(x)
101  #define iscalpha(x)     Tcl_UniCharIsAlpha(x)  #define iscalpha(x)     Tcl_UniCharIsAlpha(x)
102  #define iscdigit(x)     Tcl_UniCharIsDigit(x)  #define iscdigit(x)     Tcl_UniCharIsDigit(x)
103  #define iscspace(x)     Tcl_UniCharIsSpace(x)  #define iscspace(x)     Tcl_UniCharIsSpace(x)
104    
105  /* name the external functions */  /* name the external functions */
106  #define compile         TclReComp  #define compile         TclReComp
107  #define exec            TclReExec  #define exec            TclReExec
108    
109  /* enable/disable debugging code (by whether REG_DEBUG is defined or not) */  /* enable/disable debugging code (by whether REG_DEBUG is defined or not) */
110  #if 0           /* no debug unless requested by makefile */  #if 0           /* no debug unless requested by makefile */
111  #define REG_DEBUG       /* */  #define REG_DEBUG       /* */
112  #endif  #endif
113    
114  /* and pick up the standard header */  /* and pick up the standard header */
115  #include "regex.h"  #include "regex.h"
116    
117  /* End of regcustom.h */  /* End of regcustom.h */

Legend:
Removed from v.70  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25