1 |
2401
|
stephane
|
/*
|
2 |
|
|
This source file is part of Scol
|
3 |
|
|
For the latest info, see http://www.scolring.org
|
4 |
|
|
|
5 |
|
|
Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify it under
|
8 |
|
|
the terms of the GNU Lesser General Public License as published by the Free Software
|
9 |
|
|
Foundation; either version 2 of the License, or (at your option) any later
|
10 |
|
|
version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
13 |
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
14 |
|
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
15 |
|
|
|
16 |
|
|
You should have received a copy of the GNU Lesser General Public License along with
|
17 |
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
18 |
|
|
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
19 |
|
|
http://www.gnu.org/copyleft/lesser.txt
|
20 |
|
|
|
21 |
|
|
For others informations, please contact us from http://www.scolring.org/
|
22 |
|
|
*/
|
23 |
|
|
|
24 |
2407
|
stephane
|
#ifndef __SCOL_GLIB_PREGEX_H__
|
25 |
|
|
#define __SCOL_GLIB_PREGEX_H__
|
26 |
2401
|
stephane
|
|
27 |
2407
|
stephane
|
#include <stdio.h>
|
28 |
|
|
#include <stdlib.h>
|
29 |
|
|
#include <string.h>
|
30 |
|
|
#include <math.h>
|
31 |
|
|
#include <libgen.h>
|
32 |
|
|
#include <glib.h>
|
33 |
2401
|
stephane
|
|
34 |
2407
|
stephane
|
#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"
|
42 |
2401
|
stephane
|
|
43 |
2407
|
stephane
|
|
44 |
|
|
|
45 |
|
|
#define bullshit int (__cdecl *)(struct Mmachine *)
|
46 |
|
|
|
47 |
2415
|
stephane
|
#define GLIB_PCRE_PKG_NB 31
|
48 |
2407
|
stephane
|
#define DEFAULT_STRING "Untitle"
|
49 |
|
|
|
50 |
|
|
|
51 |
2677
|
stephane
|
#define MATCH_STANDARD 1
|
52 |
|
|
#define MATCH_DFA 2
|
53 |
2407
|
stephane
|
|
54 |
2677
|
stephane
|
#define MATCH_ANCHORED 1<<4
|
55 |
|
|
#define MATCH_NOTBOL 1<<7
|
56 |
|
|
#define MATCH_NOTEOL 1<<8
|
57 |
|
|
#define MATCH_NOTEMPTY 1<<10
|
58 |
|
|
#define MATCH_PARTIAL 1<<15
|
59 |
|
|
#define MATCH_NEWLINE_CR 1<<20
|
60 |
|
|
#define MATCH_NEWLINE_LF 1<<21
|
61 |
|
|
#define MATCH_NEWLINE_CRLF MATCH_NEWLINE_CR | MATCH_NEWLINE_LF
|
62 |
|
|
#define MATCH_NEWLINE_ANY 1<<22
|
63 |
2407
|
stephane
|
|
64 |
2677
|
stephane
|
#define REGEX_CASELESS 1 << 0
|
65 |
|
|
#define REGEX_MULTILINE 1 << 1
|
66 |
|
|
#define REGEX_DOTALL 1 << 2
|
67 |
|
|
#define REGEX_EXTENDED 1 << 3
|
68 |
|
|
#define REGEX_ANCHORED 1 << 4
|
69 |
|
|
#define REGEX_DOLLAR_ENDONLY 1 << 5
|
70 |
|
|
#define REGEX_UNGREEDY 1 << 9
|
71 |
|
|
#define REGEX_RAW 1 << 11
|
72 |
|
|
#define REGEX_NO_AUTO_CAPTURE 1 << 12
|
73 |
|
|
#define REGEX_OPTIMIZE 1 << 13
|
74 |
|
|
#define REGEX_DUPNAMES 1 << 19
|
75 |
|
|
#define REGEX_NEWLINE_CR 1 << 20
|
76 |
|
|
#define REGEX_NEWLINE_LF 1 << 21
|
77 |
|
|
#define REGEX_NEWLINE_CRLF REGEX_NEWLINE_CR | REGEX_NEWLINE_LF
|
78 |
2407
|
stephane
|
|
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__ */
|