aboutsummaryrefslogtreecommitdiffstats
path: root/dfa.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:09:56 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:09:56 +0300
commitbc70de7b3302d5a81515b901cae376b8b51d2004 (patch)
treed36d6743e65697f6923b79d0ea8f9f9bf4ef7398 /dfa.h
parentb9e4a1fd4c8c8753ab8a9887bab55f03efe1e3e2 (diff)
downloadegawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.gz
egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.bz2
egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.zip
Move to gawk-3.1.0.
Diffstat (limited to 'dfa.h')
-rw-r--r--dfa.h48
1 files changed, 28 insertions, 20 deletions
diff --git a/dfa.h b/dfa.h
index dda51816..f2fef4b7 100644
--- a/dfa.h
+++ b/dfa.h
@@ -1,5 +1,5 @@
/* dfa.h - declarations for GNU deterministic regexp compiler
- Copyright (C) 1988 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,6 +22,21 @@
In addition to clobbering modularity, we eat up valuable
name space. */
+# undef PARAMS
+#if __STDC__
+# ifndef _PTR_T
+# define _PTR_T
+ typedef void * ptr_t;
+# endif
+# define PARAMS(x) x
+#else
+# ifndef _PTR_T
+# define _PTR_T
+ typedef char * ptr_t;
+# endif
+# define PARAMS(x) ()
+#endif
+
/* Number of bits in an unsigned char. */
#ifndef CHARBITS
#define CHARBITS 8
@@ -305,16 +320,15 @@ struct dfa
/* Entry points. */
-#ifdef __STDC__
-
-/* dfasyntax() takes two arguments; the first sets the syntax bits described
- earlier in this file, and the second sets the case-folding flag. */
-extern void dfasyntax(reg_syntax_t, int);
+/* dfasyntax() takes three arguments; the first sets the syntax bits described
+ earlier in this file, the second sets the case-folding flag, and the
+ third specifies the line terminator. */
+extern void dfasyntax PARAMS ((reg_syntax_t, int, int));
/* Compile the given string of the given length into the given struct dfa.
Final argument is a flag specifying whether to build a searching or an
exact matcher. */
-extern void dfacomp(char *, size_t, struct dfa *, int);
+extern void dfacomp PARAMS ((char *, size_t, struct dfa *, int));
/* Execute the given struct dfa on the buffer of characters. The
first char * points to the beginning, and the second points to the
@@ -328,26 +342,26 @@ extern void dfacomp(char *, size_t, struct dfa *, int);
order to verify backreferencing; otherwise the flag will be cleared.
Returns NULL if no match is found, or a pointer to the first
character after the first & shortest matching string in the buffer. */
-extern char *dfaexec(struct dfa *, char *, char *, int, int *, int *);
+extern char *dfaexec PARAMS ((struct dfa *, char *, char *, int, int *, int *));
/* Free the storage held by the components of a struct dfa. */
-extern void dfafree(struct dfa *);
+extern void dfafree PARAMS ((struct dfa *));
/* Entry points for people who know what they're doing. */
/* Initialize the components of a struct dfa. */
-extern void dfainit(struct dfa *);
+extern void dfainit PARAMS ((struct dfa *));
/* Incrementally parse a string of given length into a struct dfa. */
-extern void dfaparse(char *, size_t, struct dfa *);
+extern void dfaparse PARAMS ((char *, size_t, struct dfa *));
/* Analyze a parsed regexp; second argument tells whether to build a searching
or an exact matcher. */
-extern void dfaanalyze(struct dfa *, int);
+extern void dfaanalyze PARAMS ((struct dfa *, int));
/* Compute, for each possible character, the transitions out of a given
state, storing them in an array of integers. */
-extern void dfastate(int, struct dfa *, int []);
+extern void dfastate PARAMS ((int, struct dfa *, int []));
/* Error handling. */
@@ -355,10 +369,4 @@ extern void dfastate(int, struct dfa *, int []);
takes a single argument, a NUL-terminated string describing the error.
The default dfaerror() prints the error message to stderr and exits.
The user can provide a different dfafree() if so desired. */
-extern void dfaerror(const char *);
-
-#else /* ! __STDC__ */
-extern void dfasyntax(), dfacomp(), dfafree(), dfainit(), dfaparse();
-extern void dfaanalyze(), dfastate(), dfaerror();
-extern char *dfaexec();
-#endif /* ! __STDC__ */
+extern void dfaerror PARAMS ((const char *));