Project

General

Profile

1
/*
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
#ifndef __SCOL_GLIB_PREGEX_H__
25
#define __SCOL_GLIB_PREGEX_H__
26

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

    
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"
42

    
43

    
44

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

    
47
#define GLIB_PCRE_PKG_NB         31
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__ */
(5-5/7)