Project

General

Profile

« Previous | Next » 

Revision 2677

Added by stephane over 13 years ago

PCRE
- change : flags
- add binary to Linux version

View differences:

include/scol_glib_pregex.h
48 48
#define DEFAULT_STRING   "Untitle"
49 49

  
50 50

  
51
#define PCRE_MATCH_STANDARD     1
52
#define PCRE_MATCH_DFA          2
51
#define MATCH_STANDARD     1
52
#define MATCH_DFA          2
53 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
54
#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 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
64
#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 78

  
79 79

  
80 80

  
src/scol_glib_pregex.c
216 216
    if (mstart< 0)
217 217
        mstart = 0;
218 218

  
219
    if (malgo != PCRE_MATCH_DFA)
220
        malgo = PCRE_MATCH_STANDARD;
219
    if (malgo != MATCH_DFA)
220
        malgo = MATCH_STANDARD;
221 221

  
222 222
    if (mcompile == NIL)
223 223
        mcompile = 0;
......
228 228
    pattern = SCOLUTF8 (MMstartstr (m, mpattern), MMsizestr (m, mpattern));
229 229
    string = SCOLUTF8 (MMstartstr (m, mstring), MMsizestr (m, mstring));
230 230

  
231
    if (malgo == PCRE_MATCH_STANDARD)
231
    if (malgo == MATCH_STANDARD)
232 232
        scol_pcre_match_standard (m, pattern, string, mcompile, mmatch, mstart);
233 233
    else
234 234
        scol_pcre_match_DFA (m, pattern, string, mcompile, mmatch, mstart);
......
466 466
    return;
467 467
}
468 468

  
469

  
470

  
471
/* FLAGS */
472

  
473
int PCRE_MATCH_STANDARD (mmachine m) { return MMpush (m, ITOM (MATCH_STANDARD)); }
474
int PCRE_MATCH_DFA (mmachine m) { return MMpush (m, ITOM (MATCH_DFA)); }
475

  
476
int PCRE_MATCH_ANCHORED (mmachine m) { return MMpush (m, ITOM (MATCH_ANCHORED)); }
477
int PCRE_MATCH_NOTBOL (mmachine m) { return MMpush (m, ITOM (MATCH_NOTBOL)); }
478
int PCRE_MATCH_NOTEOL (mmachine m) { return MMpush (m, ITOM (MATCH_NOTEOL)); }
479
int PCRE_MATCH_NOTEMPTY (mmachine m) { return MMpush (m, ITOM (MATCH_NOTEMPTY)); }
480
int PCRE_MATCH_PARTIAL (mmachine m) { return MMpush (m, ITOM (MATCH_PARTIAL)); }
481
int PCRE_MATCH_NEWLINE_CR (mmachine m) { return MMpush (m, ITOM (MATCH_NEWLINE_CR)); }
482
int PCRE_MATCH_NEWLINE_LF (mmachine m) { return MMpush (m, ITOM (MATCH_NEWLINE_LF)); }
483
int PCRE_MATCH_NEWLINE_CRLF (mmachine m) { return MMpush (m, ITOM (MATCH_NEWLINE_CRLF)); }
484
int PCRE_MATCH_NEWLINE_ANY (mmachine m) { return MMpush (m, ITOM (MATCH_NEWLINE_ANY)); }
485

  
486
int PCRE_REGEX_CASELESS (mmachine m) { return MMpush (m, ITOM (REGEX_CASELESS)); }
487
int PCRE_REGEX_MULTILINE (mmachine m) { return MMpush (m, ITOM (REGEX_MULTILINE)); }
488
int PCRE_REGEX_DOTALL (mmachine m) { return MMpush (m, ITOM (REGEX_DOTALL)); }
489
int PCRE_REGEX_EXTENDED (mmachine m) { return MMpush (m, ITOM (REGEX_EXTENDED)); }
490
int PCRE_REGEX_ANCHORED (mmachine m) { return MMpush (m, ITOM (REGEX_ANCHORED)); }
491
int PCRE_REGEX_DOLLAR_ENDONLY (mmachine m) { return MMpush (m, ITOM (REGEX_DOLLAR_ENDONLY)); }
492
int PCRE_REGEX_UNGREEDY (mmachine m) { return MMpush (m, ITOM (REGEX_UNGREEDY)); }
493
int PCRE_REGEX_RAW (mmachine m) { return MMpush (m, ITOM (REGEX_RAW)); }
494
int PCRE_REGEX_NO_AUTO_CAPTURE (mmachine m) { return MMpush (m, ITOM (REGEX_NO_AUTO_CAPTURE)); }
495
int PCRE_REGEX_OPTIMIZE (mmachine m) { return MMpush (m, ITOM (REGEX_OPTIMIZE)); }
496
int PCRE_REGEX_DUPNAMES (mmachine m) { return MMpush (m, ITOM (REGEX_DUPNAMES)); }
497
int PCRE_REGEX_NEWLINE_CR (mmachine m) { return MMpush (m, ITOM (REGEX_NEWLINE_CR)); }
498
int PCRE_REGEX_NEWLINE_LF (mmachine m) { return MMpush (m, ITOM (REGEX_NEWLINE_LF)); }
499
int PCRE_REGEX_NEWLINE_CRLF (mmachine m) { return MMpush (m, ITOM (REGEX_NEWLINE_CRLF)); }
469 500

  
470 501

  
471

  
472 502
/* API definitions : */
473 503

  
474 504
char* glib_pcre_name[GLIB_PCRE_PKG_NB]=
......
496 526

  
497 527
int (*glib_pcre_fun[GLIB_PCRE_PKG_NB])(mmachine m)=
498 528
{
499
    (bullshit) (1*2), (bullshit) (2*2),
529
    PCRE_MATCH_STANDARD, PCRE_MATCH_DFA,
500 530

  
501
    (bullshit) (1<<4), (bullshit) (1<<7), (bullshit) (1<<8),
502
    (bullshit) (1<<10), (bullshit) (1<<15), (bullshit) (1<<20),
503
    (bullshit) (1<<21), (bullshit) (1<<20|1<<21), (bullshit) (1<<22),
531
    PCRE_MATCH_ANCHORED, PCRE_MATCH_NOTBOL, PCRE_MATCH_NOTEOL,
532
    PCRE_MATCH_NOTEMPTY, PCRE_MATCH_PARTIAL, PCRE_MATCH_NEWLINE_CR,
533
    PCRE_MATCH_NEWLINE_LF, PCRE_MATCH_NEWLINE_CRLF, PCRE_MATCH_NEWLINE_ANY,
504 534

  
505
    (bullshit) (1<<0), (bullshit) (1<<1), (bullshit) (1<<2),
506
    (bullshit) (1<<3), (bullshit) (1<<4), (bullshit) (1<<5),
507
    (bullshit) (1<<9), (bullshit) (1<<11), (bullshit) (1<<12),
508
    (bullshit) (1<<13), (bullshit) (1<<19), (bullshit) (1<<20),
509
    (bullshit) (1<<21), (bullshit) (1<<20|1<<21),
535
    PCRE_REGEX_CASELESS, PCRE_REGEX_MULTILINE, PCRE_REGEX_DOTALL,
536
    PCRE_REGEX_EXTENDED, PCRE_REGEX_ANCHORED, PCRE_REGEX_DOLLAR_ENDONLY,
537
    PCRE_REGEX_UNGREEDY, PCRE_REGEX_RAW, PCRE_REGEX_NO_AUTO_CAPTURE,
538
    PCRE_REGEX_OPTIMIZE, PCRE_REGEX_DUPNAMES, PCRE_REGEX_NEWLINE_CR,
539
    PCRE_REGEX_NEWLINE_LF, PCRE_REGEX_NEWLINE_CRLF,
510 540

  
511 541
    SCOL_pcreEasyMatch,
512 542
    SCOL_pcreEasySplit,
......
519 549

  
520 550
int glib_pcre_narg[GLIB_PCRE_PKG_NB]=
521 551
{
522
    TYPVAR, TYPVAR,
552
    0, 0,
523 553

  
524
    TYPVAR, TYPVAR, TYPVAR,
525
    TYPVAR, TYPVAR, TYPVAR,
526
    TYPVAR, TYPVAR, TYPVAR,
554
    0, 0, 0,
555
    0, 0, 0,
556
    0, 0, 0,
527 557

  
528
    TYPVAR, TYPVAR, TYPVAR,
529
    TYPVAR, TYPVAR, TYPVAR,
530
    TYPVAR, TYPVAR, TYPVAR,
531
    TYPVAR, TYPVAR, TYPVAR,
532
    TYPVAR, TYPVAR,
558
    0, 0, 0,
559
    0, 0, 0,
560
    0, 0, 0,
561
    0, 0, 0,
562
    0, 0,
533 563

  
534 564
    2,
535 565
    2,
......
542 572

  
543 573
char* glib_pcre_type[GLIB_PCRE_PKG_NB]=
544 574
{
545
    "I", "I",
575
    "fun [] I", "fun [] I",
546 576

  
547
    "I", "I", "I",
548
    "I", "I", "I",
549
    "I", "I", "I",
577
    "fun [] I", "fun [] I", "fun [] I",
578
    "fun [] I", "fun [] I", "fun [] I",
579
    "fun [] I", "fun [] I", "fun [] I",
550 580

  
551
    "I", "I", "I",
552
    "I", "I", "I",
553
    "I", "I", "I",
554
    "I", "I", "I",
555
    "I", "I",
581
    "fun [] I", "fun [] I", "fun [] I",
582
    "fun [] I", "fun [] I", "fun [] I",
583
    "fun [] I", "fun [] I", "fun [] I",
584
    "fun [] I", "fun [] I", "fun [] I",
585
    "fun [] I", "fun [] I",
556 586

  
557 587
    "fun [S S] I",
558 588
    "fun [S S] [S r1]",
pcre.cbp
7 7
		<Option compiler="gcc" />
8 8
		<Build>
9 9
			<Target title="Debug">
10
				<Option output="bin\Debug\pcre" prefix_auto="1" extension_auto="1" />
11
				<Option object_output="obj\Debug\" />
10
				<Option output="bin/Debug/pcre" prefix_auto="1" extension_auto="1" />
11
				<Option object_output="obj/Debug/" />
12 12
				<Option type="3" />
13 13
				<Option compiler="gcc" />
14 14
				<Option createDefFile="1" />
......
27 27
					<Add option="-pedantic" />
28 28
					<Add option="-pg" />
29 29
					<Add option="-g" />
30
					<Add directory="$(#gtk.include)\glib-2.0" />
31
					<Add directory="$(#gtk.lib)\glib-2.0\include" />
30
					<Add directory="$(#gtk.include)/glib-2.0" />
31
					<Add directory="$(#gtk.lib)/glib-2.0/include" />
32 32
				</Compiler>
33 33
				<Linker>
34 34
					<Add option="-pg -lgmon" />
......
36 36
				</Linker>
37 37
			</Target>
38 38
			<Target title="Release">
39
				<Option output="bin\pcre" prefix_auto="1" extension_auto="1" />
40
				<Option object_output="obj\" />
39
				<Option output="bin/pcre" prefix_auto="1" extension_auto="1" />
40
				<Option object_output="obj/" />
41 41
				<Option type="3" />
42 42
				<Option compiler="gcc" />
43 43
				<Option createDefFile="1" />
......
57 57
					<Add option="-Wfatal-errors" />
58 58
					<Add option="-Wextra" />
59 59
					<Add option="-Wall" />
60
					<Add directory="$(#gtk.include)\glib-2.0" />
61
					<Add directory="$(#gtk.lib)\glib-2.0\include" />
60
					<Add directory="$(#gtk.include)/glib-2.0" />
61
					<Add directory="$(#gtk.lib)/glib-2.0/include" />
62 62
				</Compiler>
63 63
				<Linker>
64 64
					<Add option="-s" />
......
82 82
			<Add option="-pedantic" />
83 83
			<Add option="-Wextra" />
84 84
			<Add option="-Wall" />
85
			<Add directory="/usr/include/glib-2.0" />
86
			<Add directory="/usr/lib/glib-2.0/include" />
85 87
		</Compiler>
86
		<Unit filename="include\macros.h" />
87
		<Unit filename="include\scol_glib_pregex.h" />
88
		<Unit filename="include\scol_plugin_lin.h" />
89
		<Unit filename="include\scol_plugin_win.h" />
90
		<Unit filename="src\scol_glib_pregex.c">
88
		<Unit filename="include/macros.h" />
89
		<Unit filename="include/scol_glib_pregex.h" />
90
		<Unit filename="include/scol_plugin_lin.h" />
91
		<Unit filename="include/scol_plugin_win.h" />
92
		<Unit filename="src/scol_glib_pregex.c">
91 93
			<Option compilerVar="CC" />
92 94
		</Unit>
93 95
		<Extensions>
94 96
			<code_completion />
95 97
			<debugger />
98
			<envvars />
96 99
		</Extensions>
97 100
	</Project>
98 101
</CodeBlocks_project_file>
pcre.layout
1 1
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2 2
<CodeBlocks_layout_file>
3 3
	<ActiveTarget name="Release" />
4
	<File name="include\macros.h" open="0" top="0" tabpos="0">
5
		<Cursor position="2418" topLine="30" />
4
	<File name="include/macros.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
5
		<Cursor1 position="2418" topLine="30" />
6 6
	</File>
7
	<File name="include\scol_glib_pregex.h" open="1" top="0" tabpos="2">
8
		<Cursor position="1422" topLine="61" />
7
	<File name="include/scol_glib_pregex.h" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
8
		<Cursor1 position="2456" topLine="47" />
9 9
	</File>
10
	<File name="src\scol_glib_pregex.c" open="1" top="1" tabpos="1">
11
		<Cursor position="14156" topLine="481" />
10
	<File name="src/scol_glib_pregex.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
11
		<Cursor1 position="14031" topLine="465" />
12 12
	</File>
13 13
</CodeBlocks_layout_file>

Also available in: Unified diff