Changeset 3058 for branches/libc-0.6/src/emx/include
- Timestamp:
- Apr 8, 2007, 8:51:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/include/regex.h
r2240 r3058 1 1 /* Definitions for data structures and routines for the regular 2 2 expression library. 3 Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003 3 Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006 4 4 Free Software Foundation, Inc. 5 5 This file is part of the GNU C Library. … … 28 28 #ifdef __cplusplus 29 29 extern "C" { 30 #endif31 32 /* POSIX says that <sys/types.h> must be included (by the caller) before33 <regex.h>. */34 35 #if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS36 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it37 should be there. */38 # include <stddef.h>39 30 #endif 40 31 … … 209 200 | RE_CONTEXT_INVALID_OPS )) 210 201 211 #define RE_SYNTAX_POSIX_AWK 202 #define RE_SYNTAX_POSIX_AWK \ 212 203 (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ 213 204 | RE_INTERVALS | RE_NO_GNU_OPS) … … 350 341 351 342 #ifndef RE_TRANSLATE_TYPE 352 # define RE_TRANSLATE_TYPE char *343 # define RE_TRANSLATE_TYPE unsigned char * 353 344 #endif 354 345 355 346 struct re_pattern_buffer 356 347 { 357 /* [[[begin pattern_buffer]]] */ 358 /* Space that holds the compiled pattern. It is declared as 359 `unsigned char *' because its elements are 360 sometimes used as array indexes. */ 348 /* Space that holds the compiled pattern. It is declared as 349 `unsigned char *' because its elements are sometimes used as 350 array indexes. */ 361 351 unsigned char *buffer; 362 352 363 353 /* Number of bytes to which `buffer' points. */ 364 354 unsigned long int allocated; 365 355 366 356 /* Number of bytes actually used in `buffer'. */ 367 357 unsigned long int used; 368 358 369 359 /* Syntax setting with which the pattern was compiled. */ 370 360 reg_syntax_t syntax; 371 361 372 /* Pointer to a fastmap, if any, otherwise zero. re_search uses373 the fastmap, if there is one, to skip over impossible374 starting pointsfor matches. */362 /* Pointer to a fastmap, if any, otherwise zero. re_search uses the 363 fastmap, if there is one, to skip over impossible starting points 364 for matches. */ 375 365 char *fastmap; 376 366 377 378 comparing them, or zero for no translation. The translation379 is applied to a pattern when it is compiled and to a string380 when itis matched. */367 /* Either a translate table to apply to all characters before 368 comparing them, or zero for no translation. The translation is 369 applied to a pattern when it is compiled and to a string when it 370 is matched. */ 381 371 RE_TRANSLATE_TYPE translate; 382 372 383 373 /* Number of subexpressions found by the compiler. */ 384 374 size_t re_nsub; 385 375 386 /* Zero if this pattern cannot match the empty string, one else. 387 Well, in truth it's used only in `re_search_2', to see 388 whether or not we should use the fastmap, so we don't set 389 this absolutely perfectly; see `re_compile_fastmap' (the 390 `duplicate' case). */ 376 /* Zero if this pattern cannot match the empty string, one else. 377 Well, in truth it's used only in `re_search_2', to see whether or 378 not we should use the fastmap, so we don't set this absolutely 379 perfectly; see `re_compile_fastmap' (the `duplicate' case). */ 391 380 unsigned can_be_null : 1; 392 381 393 394 395 396 382 /* If REGS_UNALLOCATED, allocate space in the `regs' structure 383 for `max (RE_NREGS, re_nsub + 1)' groups. 384 If REGS_REALLOCATE, reallocate space if necessary. 385 If REGS_FIXED, use what's there. */ 397 386 #define REGS_UNALLOCATED 0 398 387 #define REGS_REALLOCATE 1 … … 400 389 unsigned regs_allocated : 2; 401 390 402 403 391 /* Set to zero when `regex_compile' compiles a pattern; set to one 392 by `re_compile_fastmap' if it updates the fastmap. */ 404 393 unsigned fastmap_accurate : 1; 405 394 406 407 395 /* If set, `re_match_2' does not return information about 396 subexpressions. */ 408 397 unsigned no_sub : 1; 409 398 410 /* If set, a beginning-of-line anchor doesn't match at the411 beginningof the string. */399 /* If set, a beginning-of-line anchor doesn't match at the beginning 400 of the string. */ 412 401 unsigned not_bol : 1; 413 402 414 403 /* Similarly for an end-of-line anchor. */ 415 404 unsigned not_eol : 1; 416 405 417 406 /* If true, an anchor at a newline matches. */ 418 407 unsigned newline_anchor : 1; 419 420 /* [[[end pattern_buffer]]] */421 408 }; 422 409 … … 458 445 /* Declarations for routines. */ 459 446 460 /* To avoid duplicating every routine declaration -- once with a461 prototype (if we are ANSI), and once without (if we aren't) -- we462 use the following macro to declare argument types. This463 unfortunately clutters up the declarations a bit, but I think it's464 worth it. */465 466 #if __STDC__467 468 # define _RE_ARGS(args) args469 470 #else /* not __STDC__ */471 472 # define _RE_ARGS(args) ()473 #error "asdf"474 475 #endif /* not __STDC__ */476 477 447 /* Sets the current default syntax to SYNTAX, and return the old syntax. 478 448 You can also simply assign to the `re_syntax_options' variable. */ 479 extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));449 extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); 480 450 481 451 /* Compile the regular expression PATTERN, with length LENGTH 482 452 and syntax given by the global `re_syntax_options', into the buffer 483 453 BUFFER. Return NULL if successful, and an error string if not. */ 484 extern const char *re_compile_pattern 485 _RE_ARGS ((const char *pattern, size_t length, 486 struct re_pattern_buffer *buffer)); 454 extern const char *re_compile_pattern (const char *__pattern, size_t __length, 455 struct re_pattern_buffer *__buffer); 487 456 488 457 … … 490 459 accelerate searches. Return 0 if successful and -2 if was an 491 460 internal error. */ 492 extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));461 extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); 493 462 494 463 … … 498 467 match, or -2 for an internal error. Also return register 499 468 information in REGS (if REGS and BUFFER->no_sub are nonzero). */ 500 extern int re_search 501 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,502 int length, int start, int range, struct re_registers *regs));469 extern int re_search (struct re_pattern_buffer *__buffer, const char *__string, 470 int __length, int __start, int __range, 471 struct re_registers *__regs); 503 472 504 473 505 474 /* Like `re_search', but search in the concatenation of STRING1 and 506 475 STRING2. Also, stop searching at index START + STOP. */ 507 extern int re_search_2 508 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,509 int length1, const char *string2, int length2,510 int start, int range, struct re_registers *regs, int stop));476 extern int re_search_2 (struct re_pattern_buffer *__buffer, 477 const char *__string1, int __length1, 478 const char *__string2, int __length2, int __start, 479 int __range, struct re_registers *__regs, int __stop); 511 480 512 481 513 482 /* Like `re_search', but return how many characters in STRING the regexp 514 483 in BUFFER matched, starting at position START. */ 515 extern int re_match 516 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 517 int length, int start, struct re_registers *regs)); 484 extern int re_match (struct re_pattern_buffer *__buffer, const char *__string, 485 int __length, int __start, struct re_registers *__regs); 518 486 519 487 520 488 /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ 521 extern int re_match_2 522 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,523 int length1, const char *string2, int length2,524 int start, struct re_registers *regs, int stop));489 extern int re_match_2 (struct re_pattern_buffer *__buffer, 490 const char *__string1, int __length1, 491 const char *__string2, int __length2, int __start, 492 struct re_registers *__regs, int __stop); 525 493 526 494 … … 537 505 PATTERN_BUFFER will allocate its own register data, without 538 506 freeing the old data. */ 539 extern void re_set_registers 540 _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, 541 unsigned num_regs, regoff_t *starts, regoff_t *ends)); 507 extern void re_set_registers (struct re_pattern_buffer *__buffer, 508 struct re_registers *__regs, 509 unsigned int __num_regs, 510 regoff_t *__starts, regoff_t *__ends); 542 511 543 512 #if defined _REGEX_RE_COMP || defined _LIBC 544 513 # ifndef _CRAY 545 514 /* 4.2 bsd compatibility. */ 546 extern char *re_comp _RE_ARGS ((const char *));547 extern int re_exec _RE_ARGS ((const char *));515 extern char *re_comp (const char *); 516 extern int re_exec (const char *); 548 517 # endif 549 518 #endif … … 562 531 /* gcc 3.1 and up support the [restrict] syntax. */ 563 532 #ifndef __restrict_arr 564 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) 533 # if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) \ 534 && !defined __GNUG__ 565 535 # define __restrict_arr __restrict 566 536 # else … … 570 540 571 541 /* POSIX compatibility. */ 572 extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,573 574 int __cflags));575 576 extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,577 578 579 int __eflags));580 581 extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,582 char *__errbuf, size_t __errbuf_size));583 584 extern void regfree _RE_ARGS ((regex_t *__preg));542 extern int regcomp (regex_t *__restrict __preg, 543 const char *__restrict __pattern, 544 int __cflags); 545 546 extern int regexec (const regex_t *__restrict __preg, 547 const char *__restrict __string, size_t __nmatch, 548 regmatch_t __pmatch[__restrict_arr], 549 int __eflags); 550 551 extern size_t regerror (int __errcode, const regex_t *__restrict __preg, 552 char *__restrict __errbuf, size_t __errbuf_size); 553 554 extern void regfree (regex_t *__preg); 585 555 586 556 … … 590 560 591 561 #endif /* regex.h */ 592 593 594 /*595 Local variables:596 make-backup-files: t597 version-control: t598 trim-versions-without-asking: nil599 End:600 */
Note:
See TracChangeset
for help on using the changeset viewer.