~ubuntu-branches/ubuntu/gutsy/findutils/gutsy-proposed

« back to all changes in this revision

Viewing changes to gnulib/lib/regex.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050704113737-ll89ui8be35r0pir
Tags: 4.2.22-2
* Remove locatedb on purge. (Closes: #315343)
* revert regex-syntax back to emacs-re. (Closes: #315136) Future versions
  will allow to select this by commandline parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
   You should have received a copy of the GNU General Public License along
18
18
   with this program; if not, write to the Free Software Foundation,
19
 
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
19
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
20
 
21
21
#ifndef _REGEX_H
22
22
#define _REGEX_H 1
193
193
   & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS            \
194
194
       | RE_CONTEXT_INVALID_OPS ))
195
195
 
196
 
#define RE_SYNTAX_POSIX_AWK                                             \
 
196
#define RE_SYNTAX_POSIX_AWK                                             \
197
197
  (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS              \
198
198
   | RE_INTERVALS           | RE_NO_GNU_OPS)
199
199
 
434
434
 
435
435
/* Declarations for routines.  */
436
436
 
437
 
/* To avoid duplicating every routine declaration -- once with a
438
 
   prototype (if we are ANSI), and once without (if we aren't) -- we
439
 
   use the following macro to declare argument types.  This
440
 
   unfortunately clutters up the declarations a bit, but I think it's
441
 
   worth it.  */
442
 
 
443
 
#if __STDC__
444
 
 
445
 
# define _RE_ARGS(args) args
446
 
 
447
 
#else /* not __STDC__ */
448
 
 
449
 
# define _RE_ARGS(args) ()
450
 
 
451
 
#endif /* not __STDC__ */
452
 
 
453
437
/* Sets the current default syntax to SYNTAX, and return the old syntax.
454
438
   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));
 
439
extern reg_syntax_t re_set_syntax (reg_syntax_t syntax);
456
440
 
457
441
/* Compile the regular expression PATTERN, with length LENGTH
458
442
   and syntax given by the global `re_syntax_options', into the buffer
459
443
   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));
 
444
extern const char *re_compile_pattern (const char *pattern, size_t length,
 
445
                                       struct re_pattern_buffer *buffer);
463
446
 
464
447
 
465
448
/* Compile a fastmap for the compiled pattern in BUFFER; used to
466
449
   accelerate searches.  Return 0 if successful and -2 if was an
467
450
   internal error.  */
468
 
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
 
451
extern int re_compile_fastmap (struct re_pattern_buffer *buffer);
469
452
 
470
453
 
471
454
/* Search in the string STRING (with length LENGTH) for the pattern
473
456
   characters.  Return the starting position of the match, -1 for no
474
457
   match, or -2 for an internal error.  Also return register
475
458
   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));
 
459
extern int re_search (struct re_pattern_buffer *buffer, const char *string,
 
460
                      int length, int start, int range,
 
461
                      struct re_registers *regs);
479
462
 
480
463
 
481
464
/* Like `re_search', but search in the concatenation of STRING1 and
482
465
   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));
 
466
extern int re_search_2 (struct re_pattern_buffer *buffer, const char *string1,
 
467
                        int length1, const char *string2, int length2,
 
468
                        int start, int range, struct re_registers *regs,
 
469
                        int stop);
487
470
 
488
471
 
489
472
/* Like `re_search', but return how many characters in STRING the regexp
490
473
   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));
 
474
extern int re_match (struct re_pattern_buffer *buffer, const char *string,
 
475
                     int length, int start, struct re_registers *regs);
494
476
 
495
477
 
496
478
/* 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));
 
479
extern int re_match_2 (struct re_pattern_buffer *buffer, const char *string1,
 
480
                       int length1, const char *string2, int length2,
 
481
                       int start, struct re_registers *regs, int stop);
501
482
 
502
483
 
503
484
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
512
493
   Unless this function is called, the first search or match using
513
494
   PATTERN_BUFFER will allocate its own register data, without
514
495
   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));
 
496
extern void re_set_registers (struct re_pattern_buffer *buffer,
 
497
                              struct re_registers *regs, unsigned num_regs,
 
498
                              regoff_t *starts, regoff_t *ends);
518
499
 
519
500
#if defined _REGEX_RE_COMP || defined _LIBC
520
501
# ifndef _CRAY
521
502
/* 4.2 bsd compatibility.  */
522
 
extern char *re_comp _RE_ARGS ((const char *));
523
 
extern int re_exec _RE_ARGS ((const char *));
 
503
extern char *re_comp (const char *);
 
504
extern int re_exec (const char *);
524
505
# endif
525
506
#endif
526
507
 
545
526
#endif
546
527
 
547
528
/* POSIX compatibility.  */
548
 
extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
549
 
                              const char *__restrict __pattern,
550
 
                              int __cflags));
551
 
 
552
 
extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
553
 
                              const char *__restrict __string, size_t __nmatch,
554
 
                              regmatch_t __pmatch[__restrict_arr],
555
 
                              int __eflags));
556
 
 
557
 
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
558
 
                                  char *__errbuf, size_t __errbuf_size));
559
 
 
560
 
extern void regfree _RE_ARGS ((regex_t *__preg));
 
529
extern int regcomp (regex_t *__restrict __preg,
 
530
                    const char *__restrict __pattern,
 
531
                    int __cflags);
 
532
 
 
533
extern int regexec (const regex_t *__restrict __preg,
 
534
                    const char *__restrict __string, size_t __nmatch,
 
535
                    regmatch_t __pmatch[__restrict_arr],
 
536
                    int __eflags);
 
537
 
 
538
extern size_t regerror (int __errcode, const regex_t *__preg,
 
539
                        char *__errbuf, size_t __errbuf_size);
 
540
 
 
541
extern void regfree (regex_t *__preg);
561
542
 
562
543
 
563
544
#ifdef __cplusplus