| Line 173... |
Line 173... |
| 173 |
|
173 |
|
| 174 |
/* This global variable defines the particular regexp syntax to use (for
|
174 |
/* This global variable defines the particular regexp syntax to use (for
|
| 175 |
some interfaces). When a regexp is compiled, the syntax used is
|
175 |
some interfaces). When a regexp is compiled, the syntax used is
|
| 176 |
stored in the pattern buffer, so changing this does not affect
|
176 |
stored in the pattern buffer, so changing this does not affect
|
| 177 |
already-compiled regexps. */
|
177 |
already-compiled regexps. */
|
| 178 |
extern reg_syntax_t re_syntax_options;
|
178 |
/* extern reg_syntax_t re_syntax_options; */
|
| 179 |
|
179 |
|
| 180 |
/* Define combinations of the above bits for the standard possibilities.
|
180 |
/* Define combinations of the above bits for the standard possibilities.
|
| 181 |
(The [[[ comments delimit what gets put into the Texinfo file, so
|
181 |
(The [[[ comments delimit what gets put into the Texinfo file, so
|
| 182 |
don't delete them!) */
|
182 |
don't delete them!) */
|
| 183 |
/* [[[begin syntaxes]]] */
|
183 |
/* [[[begin syntaxes]]] */
|
| Line 448... |
Line 448... |
| 448 |
|
448 |
|
| 449 |
# define _RE_ARGS(args) ()
|
449 |
# define _RE_ARGS(args) ()
|
| 450 |
|
450 |
|
| 451 |
#endif /* not __STDC__ */
|
451 |
#endif /* not __STDC__ */
|
| 452 |
|
452 |
|
| 453 |
/* Sets the current default syntax to SYNTAX, and return the old syntax.
|
- |
|
| 454 |
You can also simply assign to the `re_syntax_options' variable. */
|
- |
|
| 455 |
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
- |
|
| 456 |
|
- |
|
| 457 |
/* Compile the regular expression PATTERN, with length LENGTH
|
- |
|
| 458 |
and syntax given by the global `re_syntax_options', into the buffer
|
- |
|
| 459 |
BUFFER. Return NULL if successful, and an error string if not. */
|
- |
|
| 460 |
extern const char *re_compile_pattern
|
- |
|
| 461 |
_RE_ARGS ((const char *pattern, size_t length,
|
- |
|
| 462 |
struct re_pattern_buffer *buffer));
|
- |
|
| 463 |
|
- |
|
| 464 |
|
- |
|
| 465 |
/* Compile a fastmap for the compiled pattern in BUFFER; used to
|
- |
|
| 466 |
accelerate searches. Return 0 if successful and -2 if was an
|
- |
|
| 467 |
internal error. */
|
- |
|
| 468 |
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
- |
|
| 469 |
|
- |
|
| 470 |
|
- |
|
| 471 |
/* Search in the string STRING (with length LENGTH) for the pattern
|
- |
|
| 472 |
compiled into BUFFER. Start searching at position START, for RANGE
|
- |
|
| 473 |
characters. Return the starting position of the match, -1 for no
|
- |
|
| 474 |
match, or -2 for an internal error. Also return register
|
- |
|
| 475 |
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
|
- |
|
| 476 |
extern int re_search
|
- |
|
| 477 |
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
- |
|
| 478 |
int length, int start, int range, struct re_registers *regs));
|
- |
|
| 479 |
|
- |
|
| 480 |
|
- |
|
| 481 |
/* Like `re_search', but search in the concatenation of STRING1 and
|
- |
|
| 482 |
STRING2. Also, stop searching at index START + STOP. */
|
- |
|
| 483 |
extern int re_search_2
|
- |
|
| 484 |
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
- |
|
| 485 |
int length1, const char *string2, int length2,
|
- |
|
| 486 |
int start, int range, struct re_registers *regs, int stop));
|
- |
|
| 487 |
|
- |
|
| 488 |
|
- |
|
| 489 |
/* Like `re_search', but return how many characters in STRING the regexp
|
- |
|
| 490 |
in BUFFER matched, starting at position START. */
|
- |
|
| 491 |
extern int re_match
|
- |
|
| 492 |
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
- |
|
| 493 |
int length, int start, struct re_registers *regs));
|
- |
|
| 494 |
|
- |
|
| 495 |
|
- |
|
| 496 |
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
- |
|
| 497 |
extern int re_match_2
|
- |
|
| 498 |
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
- |
|
| 499 |
int length1, const char *string2, int length2,
|
- |
|
| 500 |
int start, struct re_registers *regs, int stop));
|
- |
|
| 501 |
|
- |
|
| 502 |
|
- |
|
| 503 |
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
|
- |
|
| 504 |
ENDS. Subsequent matches using BUFFER and REGS will use this memory
|
- |
|
| 505 |
for recording register information. STARTS and ENDS must be
|
- |
|
| 506 |
allocated with malloc, and must each be at least `NUM_REGS * sizeof
|
- |
|
| 507 |
(regoff_t)' bytes long.
|
- |
|
| 508 |
|
453 |
|
| 509 |
If NUM_REGS == 0, then subsequent matches should allocate their own
|
- |
|
| 510 |
register data.
|
- |
|
| 511 |
|
454 |
|
| 512 |
Unless this function is called, the first search or match using
|
- |
|
| 513 |
PATTERN_BUFFER will allocate its own register data, without
|
- |
|
| 514 |
freeing the old data. */
|
- |
|
| 515 |
extern void re_set_registers
|
- |
|
| 516 |
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
|
- |
|
| 517 |
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
- |
|
| 518 |
|
455 |
|
| 519 |
#if defined _REGEX_RE_COMP || defined _LIBC
|
456 |
#if defined _REGEX_RE_COMP || defined _LIBC
|
| 520 |
# ifndef _CRAY
|
457 |
# ifndef _CRAY
|
| 521 |
/* 4.2 bsd compatibility. */
|
458 |
/* 4.2 bsd compatibility. */
|
| 522 |
extern char *re_comp _RE_ARGS ((const char *));
|
459 |
extern char *re_comp _RE_ARGS ((const char *));
|