home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Python20_source / Modules / pcre.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-25  |  2.1 KB  |  85 lines

  1. /*************************************************
  2. *       Perl-Compatible Regular Expressions      *
  3. *************************************************/
  4.  
  5. /* Copyright (c) 1998 University of Cambridge */
  6.  
  7. #ifndef _PCRE_H
  8. #define _PCRE_H
  9.  
  10. #ifdef FOR_PYTHON
  11. #include "Python.h"
  12. #endif
  13.  
  14. /* Have to include stdlib.h in order to ensure that size_t is defined;
  15. it is needed here for malloc. */
  16.  
  17. #ifndef DONT_HAVE_SYS_TYPES_H
  18. #include <sys/types.h>
  19. #endif
  20. #include <stdlib.h>
  21.  
  22. /* Allow for C++ users */
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. /* Options */
  29.  
  30. #define PCRE_CASELESS        0x0001
  31. #define PCRE_EXTENDED        0x0002
  32. #define PCRE_ANCHORED        0x0004
  33. #define PCRE_MULTILINE       0x0008
  34. #define PCRE_DOTALL          0x0010
  35. #define PCRE_DOLLAR_ENDONLY  0x0020
  36. #define PCRE_EXTRA           0x0040
  37. #define PCRE_NOTBOL          0x0080
  38. #define PCRE_NOTEOL          0x0100
  39. #define PCRE_UNGREEDY        0x0400
  40. #ifdef FOR_PYTHON
  41. #define PCRE_LOCALE          0x0200
  42. #endif
  43.  
  44. /* Exec-time error codes */
  45.  
  46. #define PCRE_ERROR_NOMATCH        (-1)
  47. #define PCRE_ERROR_BADREF         (-2)
  48. #define PCRE_ERROR_NULL           (-3)
  49. #define PCRE_ERROR_BADOPTION      (-4)
  50. #define PCRE_ERROR_BADMAGIC       (-5)
  51. #define PCRE_ERROR_UNKNOWN_NODE   (-6)
  52. #define PCRE_ERROR_NOMEMORY       (-7)
  53.  
  54. /* Types */
  55.  
  56. typedef void pcre;
  57. typedef void pcre_extra;
  58.  
  59. /* Store get and free functions. These can be set to alternative malloc/free
  60. functions if required. */
  61.  
  62. extern void *(*pcre_malloc)(size_t);
  63. extern void  (*pcre_free)(void *);
  64.  
  65. /* Functions */
  66.  
  67. #ifdef FOR_PYTHON
  68. extern pcre *pcre_compile(const char *, int, const char **, int *, PyObject *);
  69. extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
  70.   int, int, int, int *, int);
  71. #else
  72. extern pcre *pcre_compile(const char *, int, const char **, int *);
  73. extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
  74.   int, int, int *, int);
  75. #endif
  76. extern int pcre_info(const pcre *, int *, int *);
  77. extern pcre_extra *pcre_study(const pcre *, int, const char **);
  78. extern const char *pcre_version(void);
  79.  
  80. #ifdef __cplusplus
  81. }  /* extern "C" */
  82. #endif
  83.  
  84. #endif /* End of pcre.h */
  85.