Project

General

Profile

« Previous | Next » 

Revision 2677

Added by stephane over 13 years ago

PCRE
- change : flags
- add binary to Linux version

View differences:

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]",

Also available in: Unified diff