/[pcre]/code/trunk/pcre_internal.h
ViewVC logotype

Diff of /code/trunk/pcre_internal.h

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

revision 1046 by ph10, Tue Sep 25 16:27:58 2012 UTC revision 1055 by chpe, Tue Oct 16 15:53:30 2012 UTC
# Line 40  POSSIBILITY OF SUCH DAMAGE. Line 40  POSSIBILITY OF SUCH DAMAGE.
40    
41  /* This header contains definitions that are shared between the different  /* This header contains definitions that are shared between the different
42  modules, but which are not relevant to the exported API. This includes some  modules, but which are not relevant to the exported API. This includes some
43  functions whose names all begin with "_pcre_" or "_pcre16_" depending on  functions whose names all begin with "_pcre_", "_pcre16_" or "_pcre32_"
44  the PRIV macro. */  depending on the PRIV macro. */
45    
46  #ifndef PCRE_INTERNAL_H  #ifndef PCRE_INTERNAL_H
47  #define PCRE_INTERNAL_H  #define PCRE_INTERNAL_H
# Line 53  the PRIV macro. */ Line 53  the PRIV macro. */
53  #endif  #endif
54    
55  /* PCRE is compiled as an 8 bit library if it is not requested otherwise. */  /* PCRE is compiled as an 8 bit library if it is not requested otherwise. */
56  #ifndef COMPILE_PCRE16  #if !defined COMPILE_PCRE16 && ! defined COMPILE_PCRE32
57  #define COMPILE_PCRE8  #define COMPILE_PCRE8
58  #endif  #endif
59    
# Line 78  Until then we define it if SUPPORT_UTF i Line 78  Until then we define it if SUPPORT_UTF i
78  #define SUPPORT_UTF8 1  #define SUPPORT_UTF8 1
79  #endif  #endif
80    
81  /* We do not support both EBCDIC and UTF-8/16 at the same time. The "configure"  /* We do not support both EBCDIC and UTF-8/16/32 at the same time. The "configure"
82  script prevents both being selected, but not everybody uses "configure". */  script prevents both being selected, but not everybody uses "configure". */
83    
84  #if defined EBCDIC && defined SUPPORT_UTF  #if defined EBCDIC && defined SUPPORT_UTF
85  #error The use of both EBCDIC and SUPPORT_UTF8/16 is not supported.  #error The use of both EBCDIC and SUPPORT_UTF is not supported.
86  #endif  #endif
87    
88  /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef  /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef
# Line 243  exactly 256 items. When the character is Line 243  exactly 256 items. When the character is
243  items, some check is needed before accessing these tables.  items, some check is needed before accessing these tables.
244  */  */
245    
246  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
247    
248  typedef unsigned char pcre_uchar;  typedef unsigned char pcre_uchar;
249  #define IN_UCHARS(x) (x)  #define IN_UCHARS(x) (x)
250  #define MAX_255(c) 1  #define MAX_255(c) 1
251  #define TABLE_GET(c, table, default) ((table)[c])  #define TABLE_GET(c, table, default) ((table)[c])
252    
253  #else  #elif defined COMPILE_PCRE16
254    
 #ifdef COMPILE_PCRE16  
255  #if USHRT_MAX != 65535  #if USHRT_MAX != 65535
256  /* This is a warning message. Change PCRE_UCHAR16 to a 16 bit data type in  /* This is a warning message. Change PCRE_UCHAR16 to a 16 bit data type in
257  pcre.h(.in) and disable (comment out) this message. */  pcre.h(.in) and disable (comment out) this message. */
# Line 260  pcre.h(.in) and disable (comment out) th Line 259  pcre.h(.in) and disable (comment out) th
259  #endif  #endif
260    
261  typedef pcre_uint16 pcre_uchar;  typedef pcre_uint16 pcre_uchar;
262  #define IN_UCHARS(x) ((x) << 1)  #define UCHAR_SHIFT (1)
263    #define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
264    #define MAX_255(c) ((c) <= 255u)
265    #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
266    
267    #elif defined COMPILE_PCRE32
268    
269    typedef pcre_uint32 pcre_uchar;
270    #define UCHAR_SHIFT (2)
271    #define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
272  #define MAX_255(c) ((c) <= 255u)  #define MAX_255(c) ((c) <= 255u)
273  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
274    
275    /* Assert that pcre_uchar32 is a 32-bit type */
276    typedef int __assert_pcre_uchar32_size[sizeof(pcre_uchar) == 4 ? 1 : -1];
277    
278  #else  #else
279  #error Unsupported compiling mode  #error Unsupported compiling mode
280  #endif /* COMPILE_PCRE16 */  #endif /* COMPILE_PCRE[8|16|32] */
   
 #endif /* COMPILE_PCRE8 */  
281    
282  /* This is an unsigned int value that no character can ever have. UTF-8  /* This is an unsigned int value that no character can ever have. UTF-8
283  characters only go up to 0x7fffffff (though Unicode doesn't go beyond  characters only go up to 0x7fffffff (though Unicode doesn't go beyond
# Line 396  The macros are controlled by the value o Line 405  The macros are controlled by the value o
405  the config.h file, but can be overridden by using -D on the command line. This  the config.h file, but can be overridden by using -D on the command line. This
406  is automated on Unix systems via the "configure" command. */  is automated on Unix systems via the "configure" command. */
407    
408  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
409    
410  #if LINK_SIZE == 2  #if LINK_SIZE == 2
411    
# Line 441  is automated on Unix systems via the "co Line 450  is automated on Unix systems via the "co
450  #error LINK_SIZE must be either 2, 3, or 4  #error LINK_SIZE must be either 2, 3, or 4
451  #endif  #endif
452    
453  #else /* COMPILE_PCRE8 */  #elif defined COMPILE_PCRE16
   
 #ifdef COMPILE_PCRE16  
454    
455  #if LINK_SIZE == 2  #if LINK_SIZE == 2
456    
457    /* Redefine LINK_SIZE as a multiple of sizeof(pcre_uchar) */
458  #undef LINK_SIZE  #undef LINK_SIZE
459  #define LINK_SIZE 1  #define LINK_SIZE 1
460    
# Line 460  is automated on Unix systems via the "co Line 468  is automated on Unix systems via the "co
468    
469  #elif LINK_SIZE == 3 || LINK_SIZE == 4  #elif LINK_SIZE == 3 || LINK_SIZE == 4
470    
471    /* Redefine LINK_SIZE as a multiple of sizeof(pcre_uchar) */
472  #undef LINK_SIZE  #undef LINK_SIZE
473  #define LINK_SIZE 2  #define LINK_SIZE 2
474    
# Line 477  is automated on Unix systems via the "co Line 486  is automated on Unix systems via the "co
486  #error LINK_SIZE must be either 2, 3, or 4  #error LINK_SIZE must be either 2, 3, or 4
487  #endif  #endif
488    
489    #elif defined COMPILE_PCRE32
490    
491    /* Only supported LINK_SIZE is 4 */
492    /* Redefine LINK_SIZE as a multiple of sizeof(pcre_uchar) */
493    #undef LINK_SIZE
494    #define LINK_SIZE 1
495    
496    #define PUT(a,n,d)   \
497      (a[n] = (d))
498    
499    #define GET(a,n) \
500      (a[n])
501    
502    /* Keep it positive */
503    #define MAX_PATTERN_SIZE (1 << 30)
504    
505  #else  #else
506  #error Unsupported compiling mode  #error Unsupported compiling mode
507  #endif /* COMPILE_PCRE16 */  #endif /* COMPILE_PCRE[8|16|32] */
   
 #endif /* COMPILE_PCRE8 */  
508    
509  /* Convenience macro defined in terms of the others */  /* Convenience macro defined in terms of the others */
510    
# Line 492  is automated on Unix systems via the "co Line 515  is automated on Unix systems via the "co
515  offsets changes. There are used for repeat counts and for other things such as  offsets changes. There are used for repeat counts and for other things such as
516  capturing parenthesis numbers in back references. */  capturing parenthesis numbers in back references. */
517    
518  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
519    
520  #define IMM2_SIZE 2  #define IMM2_SIZE 2
521    
# Line 503  capturing parenthesis numbers in back re Line 526  capturing parenthesis numbers in back re
526  #define GET2(a,n) \  #define GET2(a,n) \
527    (((a)[n] << 8) | (a)[(n)+1])    (((a)[n] << 8) | (a)[(n)+1])
528    
529  #else /* COMPILE_PCRE8 */  #elif defined COMPILE_PCRE16
530    
531  #ifdef COMPILE_PCRE16  #define IMM2_SIZE 1
532    
533    #define PUT2(a,n,d)   \
534       a[n] = d
535    
536    #define GET2(a,n) \
537       a[n]
538    
539    #elif defined COMPILE_PCRE32
540    
541  #define IMM2_SIZE 1  #define IMM2_SIZE 1
542    
# Line 517  capturing parenthesis numbers in back re Line 548  capturing parenthesis numbers in back re
548    
549  #else  #else
550  #error Unsupported compiling mode  #error Unsupported compiling mode
551  #endif /* COMPILE_PCRE16 */  #endif /* COMPILE_PCRE[8|16|32] */
   
 #endif /* COMPILE_PCRE8 */  
552    
553  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE
554    
555  /* The maximum length of a MARK name is currently one data unit; it may be  /* The maximum length of a MARK name is currently one data unit; it may be
556  changed in future to be a fixed number of bytes or to depend on LINK_SIZE. */  changed in future to be a fixed number of bytes or to depend on LINK_SIZE. */
557    
558  #define MAX_MARK ((1 << (sizeof(pcre_uchar)*8)) - 1)  #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
559    #define MAX_MARK ((1u << 16) - 1)
560    #else
561    #define MAX_MARK ((1u << 8) - 1)
562    #endif
563    
564  /* When UTF encoding is being used, a character is no longer just a single  /* When UTF encoding is being used, a character is no longer just a single
565  byte. The macros for character handling generate simple sequences when used in  byte. The macros for character handling generate simple sequences when used in
# Line 553  we don't even define them. */ Line 586  we don't even define them. */
586    
587  #else   /* SUPPORT_UTF */  #else   /* SUPPORT_UTF */
588    
589  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
590    
591  /* These macros were originally written in the form of loops that used data  /* These macros were originally written in the form of loops that used data
592  from the tables whose names start with PRIV(utf8_table). They were rewritten by  from the tables whose names start with PRIV(utf8_table). They were rewritten by
# Line 727  because almost all calls are already wit Line 760  because almost all calls are already wit
760  #define ACROSSCHAR(condition, eptr, action) \  #define ACROSSCHAR(condition, eptr, action) \
761    while((condition) && ((eptr) & 0xc0) == 0x80) action    while((condition) && ((eptr) & 0xc0) == 0x80) action
762    
763  #else /* COMPILE_PCRE8 */  #elif defined COMPILE_PCRE16
   
 #ifdef COMPILE_PCRE16  
764    
765  /* Tells the biggest code point which can be encoded as a single character. */  /* Tells the biggest code point which can be encoded as a single character. */
766    
# Line 825  code. */ Line 856  code. */
856  #define ACROSSCHAR(condition, eptr, action) \  #define ACROSSCHAR(condition, eptr, action) \
857    if ((condition) && ((eptr) & 0xfc00) == 0xdc00) action    if ((condition) && ((eptr) & 0xfc00) == 0xdc00) action
858    
859  #endif  #elif defined COMPILE_PCRE32
860    
861  #endif /* COMPILE_PCRE8 */  /* These are unnecessary for the 32-bit library */
862    #undef MAX_VALUE_FOR_SINGLE_CHAR
863    #undef HAS_EXTRALEN
864    #undef GET_EXTRALEN
865    #undef NOT_FIRSTCHAR
866    
867  #endif  /* SUPPORT_UTF */  /* Get the next UTF-32 character, not advancing the pointer. This is called when
868    we know we are in UTF-32 mode. */
869    
870    #define GETCHAR(c, eptr) \
871      c = *eptr;
872    
873    /* Get the next UTF-32 character, testing for UTF-32 mode, and not advancing the
874    pointer. */
875    
876    #define GETCHARTEST(c, eptr) \
877      c = *eptr;
878    
879    /* Get the next UTF-32 character, advancing the pointer. This is called when we
880    know we are in UTF-32 mode. */
881    
882    #define GETCHARINC(c, eptr) \
883      c = *eptr++;
884    
885    /* Get the next character, testing for UTF-32 mode, and advancing the pointer.
886    This is called when we don't know if we are in UTF-32 mode. */
887    
888    #define GETCHARINCTEST(c, eptr) \
889      c = *eptr++;
890    
891    /* Get the next UTF-32 character, not advancing the pointer, not incrementing
892    length (since all UTF-32 is of length 1). This is called when we know we are in
893    UTF-32 mode. */
894    
895    #define GETCHARLEN(c, eptr, len) \
896      c = *eptr;
897    
898    /* Get the next UTF-832character, testing for UTF-32 mode, not advancing the
899    pointer, not incrementing the length (since all UTF-32 is of length 1).
900    This is called when we do not know if we are in UTF-32 mode. */
901    
902    #define GETCHARLENTEST(c, eptr, len) \
903      c = *eptr;
904    
905    /* If the pointer is not at the start of a character, move it back until
906    it is. This is called only in UTF-32 mode - we don't put a test within the
907    macro because almost all calls are already within a block of UTF-32 only
908    code. */
909    
910    #define BACKCHAR(eptr) do { } while (0)
911    
912    /* Same as above, just in the other direction. */
913    #define FORWARDCHAR(eptr) do { } while (0)
914    
915    /* Same as above, but it allows a fully customizable form. */
916    #define ACROSSCHAR(condition, eptr, action) do { } while (0)
917    
918    #else
919    #error Unsupported compiling mode
920    #endif /* COMPILE_PCRE[8|16|32] */
921    
922    #endif  /* SUPPORT_UTF */
923    
924  /* Tests for Unicode horizontal and vertical whitespace characters must check a  /* Tests for Unicode horizontal and vertical whitespace characters must check a
925  number of different values. Using a switch statement for this generates the  number of different values. Using a switch statement for this generates the
# Line 935  other. NOTE: The values also appear in p Line 1024  other. NOTE: The values also appear in p
1024  /* ------ End of whitespace macros ------ */  /* ------ End of whitespace macros ------ */
1025    
1026    
 /* In case there is no definition of offsetof() provided - though any proper  
 Standard C system should have one. */  
   
 #ifndef offsetof  
 #define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))  
 #endif  
   
1027    
1028  /* Private flags containing information about the compiled regex. They used to  /* Private flags containing information about the compiled regex. They used to
1029  live at the top end of the options word, but that got almost full, so now they  live at the top end of the options word, but that got almost full, so now they
# Line 949  are in a 16-bit flags word. From release Line 1031  are in a 16-bit flags word. From release
1031  the restrictions on partial matching have been lifted. It remains for backwards  the restrictions on partial matching have been lifted. It remains for backwards
1032  compatibility. */  compatibility. */
1033    
1034  #ifdef COMPILE_PCRE8  #define PCRE_MODE8         0x0001  /* compiled in 8 bit mode */
1035  #define PCRE_MODE          0x0001  /* compiled in 8 bit mode */  #define PCRE_MODE16        0x0002  /* compiled in 16 bit mode */
1036  #endif  #define PCRE_MODE32        0x0004  /* compiled in 32 bit mode */
 #ifdef COMPILE_PCRE16  
 #define PCRE_MODE          0x0002  /* compiled in 16 bit mode */  
 #endif  
1037  #define PCRE_FIRSTSET      0x0010  /* first_char is set */  #define PCRE_FIRSTSET      0x0010  /* first_char is set */
1038  #define PCRE_FCH_CASELESS  0x0020  /* caseless first char */  #define PCRE_FCH_CASELESS  0x0020  /* caseless first char */
1039  #define PCRE_REQCHSET      0x0040  /* req_byte is set */  #define PCRE_REQCHSET      0x0040  /* req_byte is set */
# Line 965  compatibility. */ Line 1044  compatibility. */
1044  #define PCRE_HASCRORLF     0x0800  /* explicit \r or \n in pattern */  #define PCRE_HASCRORLF     0x0800  /* explicit \r or \n in pattern */
1045  #define PCRE_HASTHEN       0x1000  /* pattern contains (*THEN) */  #define PCRE_HASTHEN       0x1000  /* pattern contains (*THEN) */
1046    
1047    #if defined COMPILE_PCRE8
1048    #define PCRE_MODE          PCRE_MODE8
1049    #elif defined COMPILE_PCRE16
1050    #define PCRE_MODE          PCRE_MODE16
1051    #elif defined COMPILE_PCRE32
1052    #define PCRE_MODE          PCRE_MODE32
1053    #endif
1054    #define PCRE_MODE_MASK     (PCRE_MODE8 | PCRE_MODE16 | PCRE_MODE32)
1055    
1056  /* Flags for the "extra" block produced by pcre_study(). */  /* Flags for the "extra" block produced by pcre_study(). */
1057    
1058  #define PCRE_STUDY_MAPPED  0x0001  /* a map of starting chars exists */  #define PCRE_STUDY_MAPPED  0x0001  /* a map of starting chars exists */
# Line 1351  a positive value. */ Line 1439  a positive value. */
1439  #ifdef COMPILE_PCRE16  #ifdef COMPILE_PCRE16
1440  #define STRING_UTF_RIGHTPAR            "UTF16)"  #define STRING_UTF_RIGHTPAR            "UTF16)"
1441  #endif  #endif
1442    #ifdef COMPILE_PCRE32
1443    #define STRING_UTF_RIGHTPAR            "UTF32)"
1444    #endif
1445  #define STRING_UCP_RIGHTPAR            "UCP)"  #define STRING_UCP_RIGHTPAR            "UCP)"
1446  #define STRING_NO_START_OPT_RIGHTPAR   "NO_START_OPT)"  #define STRING_NO_START_OPT_RIGHTPAR   "NO_START_OPT)"
1447    
# Line 1613  only. */ Line 1704  only. */
1704  #ifdef COMPILE_PCRE16  #ifdef COMPILE_PCRE16
1705  #define STRING_UTF_RIGHTPAR            STR_U STR_T STR_F STR_1 STR_6 STR_RIGHT_PARENTHESIS  #define STRING_UTF_RIGHTPAR            STR_U STR_T STR_F STR_1 STR_6 STR_RIGHT_PARENTHESIS
1706  #endif  #endif
1707    #ifdef COMPILE_PCRE32
1708    #define STRING_UTF_RIGHTPAR            STR_U STR_T STR_F STR_3 STR_2 STR_RIGHT_PARENTHESIS
1709    #endif
1710  #define STRING_UCP_RIGHTPAR            STR_U STR_C STR_P STR_RIGHT_PARENTHESIS  #define STRING_UCP_RIGHTPAR            STR_U STR_C STR_P STR_RIGHT_PARENTHESIS
1711  #define STRING_NO_START_OPT_RIGHTPAR   STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS  #define STRING_NO_START_OPT_RIGHTPAR   STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS
1712    
# Line 2091  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4, Line 2185  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,
2185         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
2186         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
2187         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
2188         ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERRCOUNT };         ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERRCOUNT };
2189    
2190  /* JIT compiling modes. The function list is indexed by them. */  /* JIT compiling modes. The function list is indexed by them. */
2191  enum { JIT_COMPILE, JIT_PARTIAL_SOFT_COMPILE, JIT_PARTIAL_HARD_COMPILE,  enum { JIT_COMPILE, JIT_PARTIAL_SOFT_COMPILE, JIT_PARTIAL_HARD_COMPILE,
# Line 2114  fields are present. Currently PCRE alway Line 2208  fields are present. Currently PCRE alway
2208  NOTE NOTE NOTE  NOTE NOTE NOTE
2209  */  */
2210    
2211  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
2212  #define REAL_PCRE real_pcre  #define REAL_PCRE real_pcre
2213  #else  #elif defined COMPILE_PCRE16
2214  #define REAL_PCRE real_pcre16  #define REAL_PCRE real_pcre16
2215    #elif defined COMPILE_PCRE32
2216    #define REAL_PCRE real_pcre32
2217  #endif  #endif
2218    
2219  typedef struct REAL_PCRE {  /* It is necessary to fork the struct for 32 bit, since it needs to use
2220     * pcre_uchar for first_char and req_char. Can't put an ifdef inside the
2221     * typedef since pcretest needs access to  the struct of the 8-, 16-
2222     * and 32-bit variants. */
2223    
2224    typedef struct real_pcre8_or_16 {
2225    pcre_uint32 magic_number;    pcre_uint32 magic_number;
2226    pcre_uint32 size;               /* Total that was malloced */    pcre_uint32 size;               /* Total that was malloced */
2227    pcre_uint32 options;            /* Public options */    pcre_uint32 options;            /* Public options */
# Line 2136  typedef struct REAL_PCRE { Line 2237  typedef struct REAL_PCRE {
2237    pcre_uint16 ref_count;          /* Reference count */    pcre_uint16 ref_count;          /* Reference count */
2238    const pcre_uint8 *tables;       /* Pointer to tables or NULL for std */    const pcre_uint8 *tables;       /* Pointer to tables or NULL for std */
2239    const pcre_uint8 *nullpad;      /* NULL padding */    const pcre_uint8 *nullpad;      /* NULL padding */
2240  } REAL_PCRE;  } real_pcre8_or_16;
2241    
2242    typedef struct real_pcre8_or_16 real_pcre;
2243    typedef struct real_pcre8_or_16 real_pcre16;
2244    
2245    typedef struct real_pcre32 {
2246      pcre_uint32 magic_number;
2247      pcre_uint32 size;               /* Total that was malloced */
2248      pcre_uint32 options;            /* Public options */
2249      pcre_uint16 flags;              /* Private flags */
2250      pcre_uint16 max_lookbehind;     /* Longest lookbehind (characters) */
2251      pcre_uint16 top_bracket;        /* Highest numbered group */
2252      pcre_uint16 top_backref;        /* Highest numbered back reference */
2253      pcre_uint32 first_char;         /* Starting character */
2254      pcre_uint32 req_char;           /* This character must be seen */
2255      pcre_uint16 name_table_offset;  /* Offset to name table that follows */
2256      pcre_uint16 name_entry_size;    /* Size of any name items */
2257      pcre_uint16 name_count;         /* Number of name items */
2258      pcre_uint16 ref_count;          /* Reference count */
2259      pcre_uint16 dummy1;             /* for later expansion */
2260      pcre_uint16 dummy2;             /* for later expansion */
2261      const pcre_uint8 *tables;       /* Pointer to tables or NULL for std */
2262      void *nullpad;                  /* for later expansion */
2263    } real_pcre32;
2264    
2265    /* Assert that the size of REAL_PCRE is divisible by 8 */
2266    typedef int __assert_real_pcre_size_divisible_8[(sizeof(REAL_PCRE) % 8) == 0 ? 1 : -1];
2267    
2268    /* Needed in pcretest to access some fields in the real_pcre* structures
2269     * directly. They're unified for 8/16/32 bits since the structs only differ
2270     * after these fields; if that ever changes, need to fork those defines into
2271     * 8/16 and 32 bit versions. */
2272    #define REAL_PCRE_MAGIC(re)     (((REAL_PCRE*)re)->magic_number)
2273    #define REAL_PCRE_SIZE(re)      (((REAL_PCRE*)re)->size)
2274    #define REAL_PCRE_OPTIONS(re)   (((REAL_PCRE*)re)->options)
2275    #define REAL_PCRE_FLAGS(re)     (((REAL_PCRE*)re)->flags)
2276    
2277  /* The format of the block used to store data from pcre_study(). The same  /* The format of the block used to store data from pcre_study(). The same
2278  remark (see NOTE above) about extending this structure applies. */  remark (see NOTE above) about extending this structure applies. */
# Line 2341  total length. */ Line 2477  total length. */
2477    
2478  /* Internal function and data prefixes. */  /* Internal function and data prefixes. */
2479    
2480  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
2481  #ifndef PUBL  #ifndef PUBL
2482  #define PUBL(name) pcre_##name  #define PUBL(name) pcre_##name
2483  #endif  #endif
2484  #ifndef PRIV  #ifndef PRIV
2485  #define PRIV(name) _pcre_##name  #define PRIV(name) _pcre_##name
2486  #endif  #endif
2487  #else /* COMPILE_PCRE8 */  #elif defined COMPILE_PCRE16
 #ifdef COMPILE_PCRE16  
2488  #ifndef PUBL  #ifndef PUBL
2489  #define PUBL(name) pcre16_##name  #define PUBL(name) pcre16_##name
2490  #endif  #endif
2491  #ifndef PRIV  #ifndef PRIV
2492  #define PRIV(name) _pcre16_##name  #define PRIV(name) _pcre16_##name
2493  #endif  #endif
2494    #elif defined COMPILE_PCRE32
2495    #ifndef PUBL
2496    #define PUBL(name) pcre32_##name
2497    #endif
2498    #ifndef PRIV
2499    #define PRIV(name) _pcre32_##name
2500    #endif
2501  #else  #else
2502  #error Unsupported compiling mode  #error Unsupported compiling mode
2503  #endif /* COMPILE_PCRE16 */  #endif /* COMPILE_PCRE[8|16|32] */
 #endif /* COMPILE_PCRE8 */  
2504    
2505  /* Layout of the UCP type table that translates property names into types and  /* Layout of the UCP type table that translates property names into types and
2506  codes. Each entry used to point directly to a name, but to reduce the number of  codes. Each entry used to point directly to a name, but to reduce the number of
# Line 2402  one of the exported public functions. Th Line 2543  one of the exported public functions. Th
2543  sense, but are not part of the PCRE public API. */  sense, but are not part of the PCRE public API. */
2544    
2545  /* String comparison functions. */  /* String comparison functions. */
2546  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
2547    
2548  #define STRCMP_UC_UC(str1, str2) \  #define STRCMP_UC_UC(str1, str2) \
2549    strcmp((char *)(str1), (char *)(str2))    strcmp((char *)(str1), (char *)(str2))
# Line 2414  sense, but are not part of the PCRE publ Line 2555  sense, but are not part of the PCRE publ
2555    strncmp((char *)(str1), (str2), (num))    strncmp((char *)(str1), (str2), (num))
2556  #define STRLEN_UC(str) strlen((const char *)str)  #define STRLEN_UC(str) strlen((const char *)str)
2557    
2558  #else  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
2559    
2560  extern int               PRIV(strcmp_uc_uc)(const pcre_uchar *,  extern int               PRIV(strcmp_uc_uc)(const pcre_uchar *,
2561                             const pcre_uchar *);                             const pcre_uchar *);
# Line 2436  extern unsigned int      PRIV(strlen_uc) Line 2577  extern unsigned int      PRIV(strlen_uc)
2577    PRIV(strncmp_uc_c8)((str1), (str2), (num))    PRIV(strncmp_uc_c8)((str1), (str2), (num))
2578  #define STRLEN_UC(str) PRIV(strlen_uc)(str)  #define STRLEN_UC(str) PRIV(strlen_uc)(str)
2579    
2580  #endif /* COMPILE_PCRE8 */  #endif /* COMPILE_PCRE[8|16|32] */
2581    
2582  extern const pcre_uchar *PRIV(find_bracket)(const pcre_uchar *, BOOL, int);  extern const pcre_uchar *PRIV(find_bracket)(const pcre_uchar *, BOOL, int);
2583  extern BOOL              PRIV(is_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,  extern BOOL              PRIV(is_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,

Legend:
Removed from v.1046  
changed lines
  Added in v.1055

  ViewVC Help
Powered by ViewVC 1.1.5