Project

General

Profile

« Previous | Next » 

Revision 2407

Added by stephane almost 14 years ago

UTILS_G
- PCRE (regex)
- - add _pcreEasyMatch, _pcreEasySplit, _pcreEasyReplace
- - add _pcreNormalMatch, _pcreNormalSplit

View differences:

scol_glib_pregex.h
21 21
For others informations, please contact us from http://www.scolring.org/
22 22
*/
23 23

  
24
#ifndef __SCOL_GTK_MISC_H__
25
#define __SCOL_GTK_MISC_H__
24
#ifndef __SCOL_GLIB_PREGEX_H__
25
#define __SCOL_GLIB_PREGEX_H__
26 26

  
27
#include "main.h"
27
#include <stdio.h>
28
#include <stdlib.h>
29
#include <string.h>
30
#include <math.h>
31
#include <libgen.h>
32
#include <glib.h>
28 33

  
29
#define GLIB_PCRE_PKG_NB         1
34
#if ((defined __WIN32__) || (defined WIN32))
35
#include <windows.h>
36
#include "scol_plugin_win.h"
37
#else
38
#include "scol_plugin_lin.h"
39
#endif
40

  
41
#include "macros.h"
30 42

  
31
#endif  /* __SCOL_GTK_MISC_H__ */
43

  
44

  
45
#define bullshit int (__cdecl *)(struct Mmachine *)
46

  
47
#define GLIB_PCRE_PKG_NB         30
48
#define DEFAULT_STRING   "Untitle"
49

  
50

  
51
#define PCRE_MATCH_STANDARD     1
52
#define PCRE_MATCH_DFA          2
53

  
54
#define PCRE_MATCH_ANCHORED       1<<4
55
#define PCRE_MATCH_NOTBOL         1<<7
56
#define PCRE_MATCH_NOTEOL         1<<8
57
#define PCRE_MATCH_NOTEMPTY       1<<10
58
#define PCRE_MATCH_PARTIAL        1<<15
59
#define PCRE_MATCH_NEWLINE_CR     1<<20
60
#define PCRE_MATCH_NEWLINE_LF     1<<21
61
#define PCRE_MATCH_NEWLINE_CRLF   PCRE_MATCH_NEWLINE_CR | PCRE_MATCH_NEWLINE_LF
62
#define PCRE_MATCH_NEWLINE_ANY    1<<22
63

  
64
#define PCRE_REGEX_CASELESS          1 << 0
65
#define PCRE_REGEX_MULTILINE         1 << 1
66
#define PCRE_REGEX_DOTALL            1 << 2
67
#define PCRE_REGEX_EXTENDED          1 << 3
68
#define PCRE_REGEX_ANCHORED          1 << 4
69
#define PCRE_REGEX_DOLLAR_ENDONLY    1 << 5
70
#define PCRE_REGEX_UNGREEDY          1 << 9
71
#define PCRE_REGEX_RAW               1 << 11
72
#define PCRE_REGEX_NO_AUTO_CAPTURE   1 << 12
73
#define PCRE_REGEX_OPTIMIZE          1 << 13
74
#define PCRE_REGEX_DUPNAMES          1 << 19
75
#define PCRE_REGEX_NEWLINE_CR        1 << 20
76
#define PCRE_REGEX_NEWLINE_LF        1 << 21
77
#define PCRE_REGEX_NEWLINE_CRLF      PCRE_REGEX_NEWLINE_CR | PCRE_REGEX_NEWLINE_LF
78

  
79

  
80

  
81

  
82

  
83

  
84
int PcreRelease ();
85
int SCOLinitPcreClass (mmachine m);
86
int SCOL_pcreEasyMatch (mmachine m);
87
int SCOL_pcreEasySplit (mmachine m);
88
int SCOL_pcreEasyReplace (mmachine m);
89
int SCOL_pcreNormalMatch (mmachine m);
90
int SCOL_pcreNormalSplit (mmachine m);
91
int SCOL_pcreNormalReplace (mmachine m);
92

  
93
GRegex * scol_pcre_regex_new (const gchar * pattern, GRegexCompileFlags compile, GRegexMatchFlags match);
94
void scol_pcre_match_standard (mmachine m, const gchar *pattern, const gchar *string, GRegexCompileFlags compile, GRegexMatchFlags match, gint start);
95
void scol_pcre_match_DFA (mmachine m, const gchar *pattern, const gchar *string, GRegexCompileFlags compile, GRegexMatchFlags match, gint start);
96

  
97

  
98
#if ((defined _WIN32) || (defined __WIN32__))
99
__declspec (dllexport) int SCOLloadPCRE (mmachine m, cbmachine w);
100
__declspec (dllexport) int SCOLfreePCRE ();
101
#else
102
int SCOLloadPCRE (mmachine m);
103
int SCOLfreePCRE ();
104
#endif
105

  
106
#endif  /* __SCOL_GLIB_PREGEX_H__ */

Also available in: Unified diff