]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ANSIFY
authorwessels <>
Sat, 14 Sep 1996 14:45:41 +0000 (14:45 +0000)
committerwessels <>
Sat, 14 Sep 1996 14:45:41 +0000 (14:45 +0000)
41 files changed:
ChangeLog
include/GNUregex.h
include/tempnam.h
include/util.h
lib/GNUregex.c
lib/base64.c
lib/getfullhostname.c
lib/rfc1738.c
lib/tempnam.c
lib/util.c
lib/uudecode.c
src/client.cc
src/client_side.cc
src/comm.cc
src/debug.cc
src/disk.cc
src/dns.cc
src/dnsserver.cc
src/errorpage.cc
src/filemap.cc
src/fqdncache.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/ident.cc
src/ipcache.cc
src/main.cc
src/mime.cc
src/neighbors.cc
src/recv-announce.cc
src/redirect.cc
src/send-announce.cc
src/squid.h
src/ssl.cc
src/stat.cc
src/stmem.cc
src/store.cc
src/tools.cc
src/tunnel.cc
src/url.cc
src/wais.cc

index 6c5489188f8bf041b060b61303c86d39cd090437..c64536d01d6ea83af1747afead8fd997b3d52089 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 Changes to squid-1.1.beta2 (:
 
+       - Fixed UDP_HIT_OBJ objects ignoring 'proxy-only' setting.
        - Added setting cachemgr.cgi fields from query string
          (Neil Murray).
        - Split log type TCP_IFMODSINCE into TCP_IMS_HIT and
index 408dd210348f0fdbea5b19115130107daf496f19..ac38879c3e189ed592a75be9b1689d93b9606a62 100644 (file)
 /* Definitions for data structures and routines for the regular
  expression library, version 0.12.
-
  Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 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
  the Free Software Foundation; either version 2, or (at your option)
  any later version.
-
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
* expression library, version 0.12.
+ * 
* Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 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
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
+ * 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
+ * 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #ifndef __REGEXP_LIBRARY_H__
 #define __REGEXP_LIBRARY_H__
 
 /* POSIX says that <sys/types.h> must be included (by the caller) before
  <regex.h>.  */
* <regex.h>.  */
 
 #ifdef VMS
 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
  should be there.  */
* should be there.  */
 #include <stddef.h>
 #endif
 
 
 /* The following bits are used to determine the regexp syntax we
  recognize.  The set/not-set meanings are chosen so that Emacs syntax
  remains the value 0.  The bits are given in alphabetical order, and
  the definitions shifted by one from the previous bit; thus, when we
  add or remove a bit, only one other definition need change.  */
* recognize.  The set/not-set meanings are chosen so that Emacs syntax
* remains the value 0.  The bits are given in alphabetical order, and
* the definitions shifted by one from the previous bit; thus, when we
* add or remove a bit, only one other definition need change.  */
 typedef unsigned reg_syntax_t;
 
 /* If this bit is not set, then \ inside a bracket expression is literal.
  If set, then such a \ quotes the following character.  */
* If set, then such a \ quotes the following character.  */
 #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
 
 /* If this bit is not set, then + and ? are operators, and \+ and \? are
    literals. 
  If set, then \+ and \? are operators and + and ? are literals.  */
* literals. 
* If set, then \+ and \? are operators and + and ? are literals.  */
 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
 
 /* If this bit is set, then character classes are supported.  They are:
    [:alpha:], [:upper:], [:lower:],  [:digit:], [:alnum:], [:xdigit:],
    [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
  If not set, then character classes are not supported.  */
* [:alpha:], [:upper:], [:lower:],  [:digit:], [:alnum:], [:xdigit:],
* [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
* If not set, then character classes are not supported.  */
 #define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
 
 /* If this bit is set, then ^ and $ are always anchors (outside bracket
    expressions, of course).
  If this bit is not set, then it depends:
       ^  is an anchor if it is at the beginning of a regular
          expression or after an open-group or an alternation operator;
       $  is an anchor if it is at the end of a regular expression, or
          before a close-group or an alternation operator.  
-
  This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
  POSIX draft 11.2 says that * etc. in leading positions is undefined.
  We already implemented a previous draft which made those constructs
  invalid, though, so we haven't changed the code back.  */
* expressions, of course).
* If this bit is not set, then it depends:
* ^  is an anchor if it is at the beginning of a regular
* expression or after an open-group or an alternation operator;
* $  is an anchor if it is at the end of a regular expression, or
* before a close-group or an alternation operator.  
+ * 
* This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
* POSIX draft 11.2 says that * etc. in leading positions is undefined.
* We already implemented a previous draft which made those constructs
* invalid, though, so we haven't changed the code back.  */
 #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
 
 /* If this bit is set, then special characters are always special
    regardless of where they are in the pattern.
  If this bit is not set, then special characters are special only in
    some contexts; otherwise they are ordinary.  Specifically, 
    * + ? and intervals are only special when not after the beginning,
    open-group, or alternation operator.  */
* regardless of where they are in the pattern.
* If this bit is not set, then special characters are special only in
* some contexts; otherwise they are ordinary.  Specifically, 
* * + ? and intervals are only special when not after the beginning,
* open-group, or alternation operator.  */
 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
 
 /* If this bit is set, then *, +, ?, and { cannot be first in an re or
    immediately after an alternation or begin-group operator.  */
* immediately after an alternation or begin-group operator.  */
 #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
 
 /* If this bit is set, then . matches newline.
  If not set, then it doesn't.  */
* If not set, then it doesn't.  */
 #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
 
 /* If this bit is set, then . doesn't match NUL.
  If not set, then it does.  */
* If not set, then it does.  */
 #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
 
 /* If this bit is set, nonmatching lists [^...] do not match newline.
  If not set, they do.  */
* If not set, they do.  */
 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
 
 /* If this bit is set, either \{...\} or {...} defines an
    interval, depending on RE_NO_BK_BRACES. 
  If not set, \{, \}, {, and } are literals.  */
* interval, depending on RE_NO_BK_BRACES. 
* If not set, \{, \}, {, and } are literals.  */
 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
 /* If this bit is set, +, ? and | aren't recognized as operators.
  If not set, they are.  */
* If not set, they are.  */
 #define RE_LIMITED_OPS (RE_INTERVALS << 1)
 
 /* If this bit is set, newline is an alternation operator.
  If not set, newline is literal.  */
* If not set, newline is literal.  */
 #define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
 
 /* If this bit is set, then `{...}' defines an interval, and \{ and \}
    are literals.
-  If not set, then `\{...\}' defines an interval.  */
* are literals.
* If not set, then `\{...\}' defines an interval.  */
 #define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
 
 /* If this bit is set, (...) defines a group, and \( and \) are literals.
  If not set, \(...\) defines a group, and ( and ) are literals.  */
* If not set, \(...\) defines a group, and ( and ) are literals.  */
 #define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
 
 /* If this bit is set, then \<digit> matches <digit>.
  If not set, then \<digit> is a back-reference.  */
* If not set, then \<digit> is a back-reference.  */
 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
 
 /* If this bit is set, then | is an alternation operator, and \| is literal. 
  If not set, then \| is an alternation operator, and | is literal.  */
* If not set, then \| is an alternation operator, and | is literal.  */
 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
 
 /* If this bit is set, then an ending range point collating higher
    than the starting range point, as in [z-a], is invalid.
  If not set, then when ending range point collates higher than the
    starting range point, the range is ignored.  */
* than the starting range point, as in [z-a], is invalid.
* If not set, then when ending range point collates higher than the
* starting range point, the range is ignored.  */
 #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
 
 /* If this bit is set, then an unmatched ) is ordinary.
  If not set, then an unmatched ) is invalid.  */
* If not set, then an unmatched ) is invalid.  */
 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
 
 /* This global variable defines the particular regexp syntax to use (for
  some interfaces).  When a regexp is compiled, the syntax used is
  stored in the pattern buffer, so changing this does not affect
  already-compiled regexps.  */
* some interfaces).  When a regexp is compiled, the syntax used is
* stored in the pattern buffer, so changing this does not affect
* already-compiled regexps.  */
 extern reg_syntax_t re_syntax_options;
 \f
 /* Define combinations of the above bits for the standard possibilities.
  (The [[[ comments delimit what gets put into the Texinfo file, so
-   don't delete them!)  */ 
* (The [[[ comments delimit what gets put into the Texinfo file, so
+ * don't delete them!)  */
 /* [[[begin syntaxes]]] */
 #define RE_SYNTAX_EMACS 0
 
@@ -179,8 +179,8 @@ extern reg_syntax_t re_syntax_options;
   (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
 
 /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
  RE_LIMITED_OPS, i.e., \? \+ \| are not recognized.  Actually, this
  isn't minimal, since other operators, such as \`, aren't disabled.  */
* RE_LIMITED_OPS, i.e., \? \+ \| are not recognized.  Actually, this
* isn't minimal, since other operators, such as \`, aren't disabled.  */
 #define RE_SYNTAX_POSIX_MINIMAL_BASIC                                  \
   (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
 
@@ -191,7 +191,7 @@ extern reg_syntax_t re_syntax_options;
    | RE_UNMATCHED_RIGHT_PAREN_ORD)
 
 /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
  replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added.  */
* replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added.  */
 #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED                               \
   (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS                 \
    | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES                          \
@@ -200,41 +200,41 @@ extern reg_syntax_t re_syntax_options;
 /* [[[end syntaxes]]] */
 \f
 /* Maximum number of duplicates an interval can allow.  Some systems
  (erroneously) define this in other header files, but we want our
  value, so remove any previous define.  */
* (erroneously) define this in other header files, but we want our
* value, so remove any previous define.  */
 #ifdef RE_DUP_MAX
 #undef RE_DUP_MAX
 #endif
-#define RE_DUP_MAX ((1 << 15) - 1) 
+#define RE_DUP_MAX ((1 << 15) - 1)
 
 
 /* POSIX `cflags' bits (i.e., information for `regcomp').  */
 
 /* If this bit is set, then use extended regular expression syntax.
  If not set, then use basic regular expression syntax.  */
* If not set, then use basic regular expression syntax.  */
 #define REG_EXTENDED 1
 
 /* If this bit is set, then ignore case when matching.
  If not set, then case is significant.  */
* If not set, then case is significant.  */
 #define REG_ICASE (REG_EXTENDED << 1)
+
 /* If this bit is set, then anchors do not match at newline
    characters in the string.
  If not set, then anchors do match at newlines.  */
* characters in the string.
* If not set, then anchors do match at newlines.  */
 #define REG_NEWLINE (REG_ICASE << 1)
 
 /* If this bit is set, then report only success or fail in regexec.
  If not set, then returns differ between not matching and errors.  */
* If not set, then returns differ between not matching and errors.  */
 #define REG_NOSUB (REG_NEWLINE << 1)
 
 
 /* POSIX `eflags' bits (i.e., information for regexec).  */
 
 /* If this bit is set, then the beginning-of-line operator doesn't match
    the beginning of the string (presumably because it's not the
    beginning of a line).
  If not set, then the beginning-of-line operator does match the
    beginning of the string.  */
* the beginning of the string (presumably because it's not the
* beginning of a line).
* If not set, then the beginning-of-line operator does match the
* beginning of the string.  */
 #define REG_NOTBOL 1
 
 /* Like REG_NOTBOL, except for the end-of-line.  */
@@ -242,103 +242,101 @@ extern reg_syntax_t re_syntax_options;
 
 
 /* If any error codes are removed, changed, or added, update the
-   `re_error_msg' table in regex.c.  */
-typedef enum
-{
-  REG_NOERROR = 0,     /* Success.  */
-  REG_NOMATCH,         /* Didn't find a match (for regexec).  */
-
-  /* POSIX regcomp return error codes.  (In the order listed in the
-     standard.)  */
-  REG_BADPAT,          /* Invalid pattern.  */
-  REG_ECOLLATE,                /* Not implemented.  */
-  REG_ECTYPE,          /* Invalid character class name.  */
-  REG_EESCAPE,         /* Trailing backslash.  */
-  REG_ESUBREG,         /* Invalid back reference.  */
-  REG_EBRACK,          /* Unmatched left bracket.  */
-  REG_EPAREN,          /* Parenthesis imbalance.  */ 
-  REG_EBRACE,          /* Unmatched \{.  */
-  REG_BADBR,           /* Invalid contents of \{\}.  */
-  REG_ERANGE,          /* Invalid range end.  */
-  REG_ESPACE,          /* Ran out of memory.  */
-  REG_BADRPT,          /* No preceding re for repetition op.  */
-
-  /* Error codes we've added.  */
-  REG_EEND,            /* Premature end.  */
-  REG_ESIZE,           /* Compiled pattern bigger than 2^16 bytes.  */
-  REG_ERPAREN          /* Unmatched ) or \); not returned from regcomp.  */
+ * `re_error_msg' table in regex.c.  */
+typedef enum {
+    REG_NOERROR = 0,           /* Success.  */
+    REG_NOMATCH,               /* Didn't find a match (for regexec).  */
+
+    /* POSIX regcomp return error codes.  (In the order listed in the
+     * standard.)  */
+    REG_BADPAT,                        /* Invalid pattern.  */
+    REG_ECOLLATE,              /* Not implemented.  */
+    REG_ECTYPE,                        /* Invalid character class name.  */
+    REG_EESCAPE,               /* Trailing backslash.  */
+    REG_ESUBREG,               /* Invalid back reference.  */
+    REG_EBRACK,                        /* Unmatched left bracket.  */
+    REG_EPAREN,                        /* Parenthesis imbalance.  */
+    REG_EBRACE,                        /* Unmatched \{.  */
+    REG_BADBR,                 /* Invalid contents of \{\}.  */
+    REG_ERANGE,                        /* Invalid range end.  */
+    REG_ESPACE,                        /* Ran out of memory.  */
+    REG_BADRPT,                        /* No preceding re for repetition op.  */
+
+    /* Error codes we've added.  */
+    REG_EEND,                  /* Premature end.  */
+    REG_ESIZE,                 /* Compiled pattern bigger than 2^16 bytes.  */
+    REG_ERPAREN                        /* Unmatched ) or \); not returned from regcomp.  */
 } reg_errcode_t;
 \f
 /* This data structure represents a compiled pattern.  Before calling
  the pattern compiler, the fields `buffer', `allocated', `fastmap',
  `translate', and `no_sub' can be set.  After the pattern has been
  compiled, the `re_nsub' field is available.  All other fields are
  private to the regex routines.  */
* the pattern compiler, the fields `buffer', `allocated', `fastmap',
* `translate', and `no_sub' can be set.  After the pattern has been
* compiled, the `re_nsub' field is available.  All other fields are
* private to the regex routines.  */
 
-struct re_pattern_buffer
-{
+struct re_pattern_buffer {
 /* [[[begin pattern_buffer]]] */
-       /* Space that holds the compiled pattern.  It is declared as
-          `unsigned char *' because its elements are
-           sometimes used as array indexes.  */
-  unsigned char *buffer;
-
-       /* Number of bytes to which `buffer' points.  */
-  unsigned long allocated;
-
-       /* Number of bytes actually used in `buffer'.  */
-  unsigned long used;  
-
-        /* Syntax setting with which the pattern was compiled.  */
-  reg_syntax_t syntax;
-
-        /* Pointer to a fastmap, if any, otherwise zero.  re_search uses
-           the fastmap, if there is one, to skip over impossible
-           starting points for matches.  */
-  char *fastmap;
-
-        /* Either a translate table to apply to all characters before
-           comparing them, or zero for no translation.  The translation
-           is applied to a pattern when it is compiled and to a string
-           when it is matched.  */
-  char *translate;
-
-       /* Number of subexpressions found by the compiler.  */
-  size_t re_nsub;
-
-        /* Zero if this pattern cannot match the empty string, one else.
-           Well, in truth it's used only in `re_search_2', to see
-           whether or not we should use the fastmap, so we don't set
-           this absolutely perfectly; see `re_compile_fastmap' (the
-           `duplicate' case).  */
-  unsigned can_be_null : 1;
-
-        /* If REGS_UNALLOCATED, allocate space in the `regs' structure
-             for `max (RE_NREGS, re_nsub + 1)' groups.
-           If REGS_REALLOCATE, reallocate space if necessary.
-           If REGS_FIXED, use what's there.  */
+    /* Space that holds the compiled pattern.  It is declared as
+     * `unsigned char *' because its elements are
+     * sometimes used as array indexes.  */
+    unsigned char *buffer;
+
+    /* Number of bytes to which `buffer' points.  */
+    unsigned long allocated;
+
+    /* Number of bytes actually used in `buffer'.  */
+    unsigned long used;
+
+    /* Syntax setting with which the pattern was compiled.  */
+    reg_syntax_t syntax;
+
+    /* Pointer to a fastmap, if any, otherwise zero.  re_search uses
+     * the fastmap, if there is one, to skip over impossible
+     * starting points for matches.  */
+    char *fastmap;
+
+    /* Either a translate table to apply to all characters before
+     * comparing them, or zero for no translation.  The translation
+     * is applied to a pattern when it is compiled and to a string
+     * when it is matched.  */
+    char *translate;
+
+    /* Number of subexpressions found by the compiler.  */
+    size_t re_nsub;
+
+    /* Zero if this pattern cannot match the empty string, one else.
+     * Well, in truth it's used only in `re_search_2', to see
+     * whether or not we should use the fastmap, so we don't set
+     * this absolutely perfectly; see `re_compile_fastmap' (the
+     * `duplicate' case).  */
+    unsigned can_be_null:1;
+
+    /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+     * for `max (RE_NREGS, re_nsub + 1)' groups.
+     * If REGS_REALLOCATE, reallocate space if necessary.
+     * If REGS_FIXED, use what's there.  */
 #define REGS_UNALLOCATED 0
 #define REGS_REALLOCATE 1
 #define REGS_FIXED 2
-  unsigned regs_allocated : 2;
+    unsigned regs_allocated:2;
 
-        /* Set to zero when `regex_compile' compiles a pattern; set to one
-           by `re_compile_fastmap' if it updates the fastmap.  */
-  unsigned fastmap_accurate : 1;
+    /* Set to zero when `regex_compile' compiles a pattern; set to one
+     * by `re_compile_fastmap' if it updates the fastmap.  */
+    unsigned fastmap_accurate:1;
 
-        /* If set, `re_match_2' does not return information about
-           subexpressions.  */
-  unsigned no_sub : 1;
+    /* If set, `re_match_2' does not return information about
+     * subexpressions.  */
+    unsigned no_sub:1;
 
-        /* If set, a beginning-of-line anchor doesn't match at the
-           beginning of the string.  */ 
-  unsigned not_bol : 1;
+    /* If set, a beginning-of-line anchor doesn't match at the
+     * beginning of the string.  */
+    unsigned not_bol:1;
 
-        /* Similarly for an end-of-line anchor.  */
-  unsigned not_eol : 1;
+    /* Similarly for an end-of-line anchor.  */
+    unsigned not_eol:1;
 
-        /* If true, an anchor at a newline matches.  */
-  unsigned newline_anchor : 1;
+    /* If true, an anchor at a newline matches.  */
+    unsigned newline_anchor:1;
 
 /* [[[end pattern_buffer]]] */
 };
@@ -347,7 +345,7 @@ typedef struct re_pattern_buffer regex_t;
 
 
 /* search.c (search_buffer) in Emacs needs this one opcode value.  It is
  defined both in `regex.c' and here.  */
* defined both in `regex.c' and here.  */
 #define RE_EXACTN_VALUE 1
 \f
 /* Type for byte offsets within the string.  POSIX mandates this.  */
@@ -355,39 +353,37 @@ typedef int regoff_t;
 
 
 /* This is the structure we store register match data in.  See
-   regex.texinfo for a full description of what registers match.  */
-struct re_registers
-{
-  unsigned num_regs;
-  regoff_t *start;
-  regoff_t *end;
+ * regex.texinfo for a full description of what registers match.  */
+struct re_registers {
+    unsigned num_regs;
+    regoff_t *start;
+    regoff_t *end;
 };
 
 
 /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
  `re_match_2' returns information about at least this many registers
  the first time a `regs' structure is passed.  */
* `re_match_2' returns information about at least this many registers
* the first time a `regs' structure is passed.  */
 #ifndef RE_NREGS
 #define RE_NREGS 30
 #endif
 
 
 /* POSIX specification for registers.  Aside from the different names than
-   `re_registers', POSIX uses an array of structures, instead of a
-   structure of arrays.  */
-typedef struct
-{
-  regoff_t rm_so;  /* Byte offset from string's start to substring's start.  */
-  regoff_t rm_eo;  /* Byte offset from string's start to substring's end.  */
+ * `re_registers', POSIX uses an array of structures, instead of a
+ * structure of arrays.  */
+typedef struct {
+    regoff_t rm_so;            /* Byte offset from string's start to substring's start.  */
+    regoff_t rm_eo;            /* Byte offset from string's start to substring's end.  */
 } regmatch_t;
 \f
 /* Declarations for routines.  */
 
 /* To avoid duplicating every routine declaration -- once with a
  prototype (if we are ANSI), and once without (if we aren't) -- we
  use the following macro to declare argument types.  This
  unfortunately clutters up the declarations a bit, but I think it's
  worth it.  */
* prototype (if we are ANSI), and once without (if we aren't) -- we
* use the following macro to declare argument types.  This
* unfortunately clutters up the declarations a bit, but I think it's
* worth it.  */
 
 #if __STDC__
 
@@ -400,91 +396,91 @@ typedef struct
 #endif /* not __STDC__ */
 
 /* Sets the current default syntax to SYNTAX, and return the old syntax.
  You can also simply assign to the `re_syntax_options' variable.  */
-extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
* You can also simply assign to the `re_syntax_options' variable.  */
+extern reg_syntax_t re_set_syntax _RE_ARGS((reg_syntax_t syntax));
 
 /* Compile the regular expression PATTERN, with length LENGTH
  and syntax given by the global `re_syntax_options', into the buffer
  BUFFER.  Return NULL if successful, and an error string if not.  */
* and syntax given by the global `re_syntax_options', into the buffer
* BUFFER.  Return NULL if successful, and an error string if not.  */
 extern const char *re_compile_pattern
-  _RE_ARGS ((const char *pattern, int length,
-             struct re_pattern_buffer *buffer));
+     _RE_ARGS((const char *pattern, int length,
+       struct re_pattern_buffer * buffer));
 
 
 /* Compile a fastmap for the compiled pattern in BUFFER; used to
  accelerate searches.  Return 0 if successful and -2 if was an
  internal error.  */
-extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
* accelerate searches.  Return 0 if successful and -2 if was an
* internal error.  */
+extern int re_compile_fastmap _RE_ARGS((struct re_pattern_buffer * buffer));
 
 
 /* Search in the string STRING (with length LENGTH) for the pattern
  compiled into BUFFER.  Start searching at position START, for RANGE
  characters.  Return the starting position of the match, -1 for no
  match, or -2 for an internal error.  Also return register
  information in REGS (if REGS and BUFFER->no_sub are nonzero).  */
* compiled into BUFFER.  Start searching at position START, for RANGE
* characters.  Return the starting position of the match, -1 for no
* match, or -2 for an internal error.  Also return register
* information in REGS (if REGS and BUFFER->no_sub are nonzero).  */
 extern int re_search
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
-            int length, int start, int range, struct re_registers *regs));
+    _RE_ARGS((struct re_pattern_buffer * buffer, const char *string,
+       int length, int start, int range, struct re_registers * regs));
 
 
 /* Like `re_search', but search in the concatenation of STRING1 and
  STRING2.  Also, stop searching at index START + STOP.  */
* STRING2.  Also, stop searching at index START + STOP.  */
 extern int re_search_2
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
-             int length1, const char *string2, int length2,
-             int start, int range, struct re_registers *regs, int stop));
+    _RE_ARGS((struct re_pattern_buffer * buffer, const char *string1,
+       int length1, const char *string2, int length2,
+       int start, int range, struct re_registers * regs, int stop));
 
 
 /* Like `re_search', but return how many characters in STRING the regexp
  in BUFFER matched, starting at position START.  */
* in BUFFER matched, starting at position START.  */
 extern int re_match
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
-             int length, int start, struct re_registers *regs));
+    _RE_ARGS((struct re_pattern_buffer * buffer, const char *string,
+       int length, int start, struct re_registers * regs));
 
 
 /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
-extern int re_match_2 
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
-             int length1, const char *string2, int length2,
-             int start, struct re_registers *regs, int stop));
+extern int re_match_2
+    _RE_ARGS((struct re_pattern_buffer * buffer, const char *string1,
+       int length1, const char *string2, int length2,
+       int start, struct re_registers * regs, int stop));
 
 
 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
  ENDS.  Subsequent matches using BUFFER and REGS will use this memory
  for recording register information.  STARTS and ENDS must be
  allocated with malloc, and must each be at least `NUM_REGS * sizeof
  (regoff_t)' bytes long.
-
  If NUM_REGS == 0, then subsequent matches should allocate their own
  register data.
-
  Unless this function is called, the first search or match using
  PATTERN_BUFFER will allocate its own register data, without
  freeing the old data.  */
* ENDS.  Subsequent matches using BUFFER and REGS will use this memory
* for recording register information.  STARTS and ENDS must be
* allocated with malloc, and must each be at least `NUM_REGS * sizeof
* (regoff_t)' bytes long.
+ * 
* If NUM_REGS == 0, then subsequent matches should allocate their own
* register data.
+ * 
* Unless this function is called, the first search or match using
* PATTERN_BUFFER will allocate its own register data, without
* freeing the old data.  */
 extern void re_set_registers
-  _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
-             unsigned num_regs, regoff_t *starts, regoff_t *ends));
+     _RE_ARGS((struct re_pattern_buffer * buffer, struct re_registers * regs,
+       unsigned num_regs, regoff_t * starts, regoff_t * ends));
 
 /* 4.2 bsd compatibility.  */
-extern char *re_comp _RE_ARGS ((const char *));
-extern int re_exec _RE_ARGS ((const char *));
+extern char *re_comp _RE_ARGS((const char *));
+extern int re_exec _RE_ARGS((const char *));
 
 /* POSIX compatibility.  */
-extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
+extern int regcomp _RE_ARGS((regex_t * preg, const char *pattern, int cflags));
 extern int regexec
-  _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
-             regmatch_t pmatch[], int eflags));
+    _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch,
+       regmatch_t pmatch[], int eflags));
 extern size_t regerror
-  _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
-             size_t errbuf_size));
-extern void regfree _RE_ARGS ((regex_t *preg));
+       _RE_ARGS((int errcode, const regex_t * preg, char *errbuf,
+       size_t errbuf_size));
+extern void regfree _RE_ARGS((regex_t * preg));
 
 #endif /* not __REGEXP_LIBRARY_H__ */
 \f
 /*
-Local variables:
-make-backup-files: t
-version-control: t
-trim-versions-without-asking: nil
-End:
-*/
+ * Local variables:
+ * make-backup-files: t
+ * version-control: t
+ * trim-versions-without-asking: nil
+ * End:
+ */
index 311a4b4a518d8c335563ce62b0e07a553efe15ea..186d2d6f2540c1d7926a6c3ec84e8b49eb375c27 100644 (file)
@@ -1,21 +1,21 @@
 /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+ * This file is part of the GNU C Library.
+ * The GNU C Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Library General Public
+ * License along with the GNU C Library; see the file COPYING.LIB.  If
+ * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+ * Cambridge, MA 02139, USA.  */
 
 #ifndef _TEMPNAM_H
 #define _TEMPNAM_H
-extern char *tempnam (const char *, const char *);
+extern char *tempnam(const char *, const char *);
 #endif /* _TEMPNAM_H */
index 1cdfac3a60dbdcc956e41cb0afb143a99e9055c7..4400d4ec9645971d708e6ea88ccc55a83edf3f4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.11 1996/09/04 22:51:13 wessels Exp $
+ * $Id: util.h,v 1.12 1996/09/14 08:50:43 wessels Exp $
  *
  * AUTHOR: Harvest Derived
  *
 #endif /* _PARAMS */
 
 #if !HAVE_STRDUP
-extern char *strdup _PARAMS((char *));
+extern char *strdup(char *);
 #endif
 extern char *xstrdup _PARAMS((char *));                /* Duplicate a string */
 
@@ -140,13 +140,13 @@ void *xrealloc _PARAMS((void *, size_t)); /* Wrapper for realloc(3) */
 void *xcalloc _PARAMS((int, size_t));  /* Wrapper for calloc(3) */
 void xfree _PARAMS((void *));  /* Wrapper for free(3) */
 void xxfree _PARAMS((void *)); /* Wrapper for free(3) */
-char *xstrdup _PARAMS((char *));
-char *xstrerror _PARAMS((void));
-char *getfullhostname _PARAMS((void));
-void xmemcpy _PARAMS((void *, void*, int));
+char *xstrdup(char *);
+char *xstrerror(void);
+char *getfullhostname(void);
+void xmemcpy(void *, void *, int);
 
 #if XMALLOC_STATISTICS
-void malloc_statistics _PARAMS((void (*)(int, int, void *), void *));
+void malloc_statistics(void (*)(int, int, void *), void *);
 #endif
 
 /* from debug.c */
@@ -180,25 +180,25 @@ extern int Harvest_debug_levels[];
         {if (debug_ok_fast((section),(level))) {Log X;}}
 #endif
 
-void debug_flag _PARAMS((char *));
+void debug_flag(char *);
 
-char *mkhttpdlogtime _PARAMS((time_t *));
-extern char *mkrfc850 _PARAMS((time_t));
-extern time_t parse_rfc850 _PARAMS((char *str));
-extern void init_log3 _PARAMS((char *pn, FILE * a, FILE * b));
+char *mkhttpdlogtime(time_t *);
+extern char *mkrfc850(time_t);
+extern time_t parse_rfc850(char *str);
+extern void init_log3(char *pn, FILE * a, FILE * b);
 extern void debug_init();
-extern void log_errno2 _PARAMS((char *, int, char *));
+extern void log_errno2(char *, int, char *);
 
 #if defined(__STRICT_ANSI__)
-extern void Log _PARAMS((char *,...));
-extern void errorlog _PARAMS((char *,...));
+extern void Log(char *,...);
+extern void errorlog(char *,...);
 #else
 extern void Log();
 extern void errorlog();
 #endif /* __STRICT_ANSI__ */
 
-extern void Tolower _PARAMS((char *));
+extern void Tolower(char *);
 
-extern char *uudecode _PARAMS((char *));
+extern char *uudecode(char *);
 
 #endif /* ndef _UTIL_H_ */
index 47a580353c800e3aa3991ed6a2f5108f11bc7407..be5b0563fc42ee34629029a92e004aa9b0dbc684 100644 (file)
@@ -1,27 +1,27 @@
 /* Extended regular expression matching and search library,
  version 0.12.
  (Implements POSIX draft P10003.2/D11.2, except for
  internationalization features.)
-
  Copyright (C) 1993 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
  the Free Software Foundation; either version 2, or (at your option)
  any later version.
-
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
* version 0.12.
* (Implements POSIX draft P10003.2/D11.2, except for
* internationalization features.)
+ * 
* Copyright (C) 1993 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
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
+ * 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
+ * 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* AIX requires this to be the first thing in the file. */
 #if defined (_AIX) && !defined (REGEX_MALLOC)
-  #pragma alloca
+#pragma alloca
 #endif
 
 #define _GNU_SOURCE
@@ -33,7 +33,7 @@
 #endif
 
 /* The `emacs' switch turns on certain matching commands
  that make sense only in Emacs. */
* that make sense only in Emacs. */
 #ifdef emacs
 
 #include "lisp.h"
 /* Emacs uses `NULL' as a predicate.  */
 #undef NULL
 
-#else  /* not emacs */
+#else /* not emacs */
 
 /* We used to test for `BSTRING' here, but only GCC and Emacs define
  `BSTRING', as far as I know, and neither of them use this code.  */
* `BSTRING', as far as I know, and neither of them use this code.  */
 #if HAVE_STRING_H || STDC_HEADERS
 #include <string.h>
 #ifndef bcmp
 #ifdef STDC_HEADERS
 #include <stdlib.h>
 #else
-char *malloc ();
-char *realloc ();
+char *malloc();
+char *realloc();
 #endif
 
 
 /* Define the syntax stuff for \<, \>, etc.  */
 
 /* This must be nonzero for the wordchar and notwordchar pattern
  commands in re_match_2.  */
-#ifndef Sword 
* commands in re_match_2.  */
+#ifndef Sword
 #define Sword 1
 #endif
 
@@ -90,28 +90,28 @@ extern char *re_syntax_table;
 static char re_syntax_table[CHAR_SET_SIZE];
 
 static void
-init_syntax_once ()
+init_syntax_once()
 {
-   register int c;
-   static int done = 0;
+    register int c;
+    static int done = 0;
 
-   if (done)
-     return;
+    if (done)
+       return;
 
-   bzero (re_syntax_table, sizeof re_syntax_table);
+    bzero(re_syntax_table, sizeof re_syntax_table);
 
-   for (c = 'a'; c <= 'z'; c++)
-     re_syntax_table[c] = Sword;
+    for (c = 'a'; c <= 'z'; c++)
+       re_syntax_table[c] = Sword;
 
-   for (c = 'A'; c <= 'Z'; c++)
-     re_syntax_table[c] = Sword;
+    for (c = 'A'; c <= 'Z'; c++)
+       re_syntax_table[c] = Sword;
 
-   for (c = '0'; c <= '9'; c++)
-     re_syntax_table[c] = Sword;
+    for (c = '0'; c <= '9'; c++)
+       re_syntax_table[c] = Sword;
 
-   re_syntax_table['_'] = Sword;
+    re_syntax_table['_'] = Sword;
 
-   done = 1;
+    done = 1;
 }
 
 #endif /* not SYNTAX_TABLE */
@@ -157,26 +157,26 @@ init_syntax_once ()
 #endif
 
 /* We remove any previous definition of `SIGN_EXTEND_CHAR',
  since ours (we hope) works properly with all combinations of
  machines, compilers, `char' and `unsigned char' argument types.
  (Per Bothner suggested the basic approach.)  */
* since ours (we hope) works properly with all combinations of
* machines, compilers, `char' and `unsigned char' argument types.
* (Per Bothner suggested the basic approach.)  */
 #undef SIGN_EXTEND_CHAR
 #if __STDC__
 #define SIGN_EXTEND_CHAR(c) ((signed char) (c))
-#else  /* not __STDC__ */
+#else /* not __STDC__ */
 /* As in Harbison and Steele.  */
 #define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
 #endif
 \f
 /* Should we use malloc or alloca?  If REGEX_MALLOC is not defined, we
  use `alloca' instead of `malloc'.  This is because using malloc in
  re_search* or re_match* could cause memory leaks when C-g is used in
  Emacs; also, malloc is slower and causes storage fragmentation.  On
  the other hand, malloc is more portable, and easier to debug.  
-   
  Because we sometimes use alloca, some routines have to be macros,
  not functions -- `alloca'-allocated space disappears at the end of the
  function it is called in.  */
* use `alloca' instead of `malloc'.  This is because using malloc in
* re_search* or re_match* could cause memory leaks when C-g is used in
* Emacs; also, malloc is slower and causes storage fragmentation.  On
* the other hand, malloc is more portable, and easier to debug.  
+ * 
* Because we sometimes use alloca, some routines have to be macros,
* not functions -- `alloca'-allocated space disappears at the end of the
* function it is called in.  */
 
 #ifdef REGEX_MALLOC
 
@@ -195,10 +195,10 @@ init_syntax_once ()
 #if HAVE_ALLOCA_H
 #include <alloca.h>
 #else /* not __GNUC__ or HAVE_ALLOCA_H */
-#ifndef _AIX /* Already did AIX, up at the top.  */
-char *alloca ();
+#ifndef _AIX                   /* Already did AIX, up at the top.  */
+char *alloca();
 #endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */ 
+#endif /* not HAVE_ALLOCA_H */
 #endif /* not __GNUC__ */
 
 #endif /* not alloca */
@@ -215,8 +215,8 @@ char *alloca ();
 
 
 /* True if `size1' is non-NULL and PTR is pointing anywhere inside
  `string1' or just past its end.  This works if PTR is NULL, which is
  a good thing.  */
* `string1' or just past its end.  This works if PTR is NULL, which is
* a good thing.  */
 #define FIRST_STRING_P(ptr)                                    \
   (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
 
@@ -225,7 +225,7 @@ char *alloca ();
 #define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
 #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
 
-#define BYTEWIDTH 8 /* In bits.  */
+#define BYTEWIDTH 8            /* In bits.  */
 
 #define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
 
@@ -237,143 +237,142 @@ typedef char boolean;
 #define true 1
 \f
 /* These are the command codes that appear in compiled regular
-   expressions.  Some opcodes are followed by argument bytes.  A
-   command code can specify any interpretation whatsoever for its
-   arguments.  Zero bytes may appear in the compiled regular expression.
-
-   The value of `exactn' is needed in search.c (search_buffer) in Emacs.
-   So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
-   `exactn' we use here must also be 1.  */
-
-typedef enum
-{
-  no_op = 0,
-
-        /* Followed by one byte giving n, then by n literal bytes.  */
-  exactn = 1,
-
-        /* Matches any (more or less) character.  */
-  anychar,
-
-        /* Matches any one char belonging to specified set.  First
-           following byte is number of bitmap bytes.  Then come bytes
-           for a bitmap saying which chars are in.  Bits in each byte
-           are ordered low-bit-first.  A character is in the set if its
-           bit is 1.  A character too large to have a bit in the map is
-           automatically not in the set.  */
-  charset,
-
-        /* Same parameters as charset, but match any character that is
-           not one of those specified.  */
-  charset_not,
-
-        /* Start remembering the text that is matched, for storing in a
-           register.  Followed by one byte with the register number, in
-           the range 0 to one less than the pattern buffer's re_nsub
-           field.  Then followed by one byte with the number of groups
-           inner to this one.  (This last has to be part of the
-           start_memory only because we need it in the on_failure_jump
-           of re_match_2.)  */
-  start_memory,
-
-        /* Stop remembering the text that is matched and store it in a
-           memory register.  Followed by one byte with the register
-           number, in the range 0 to one less than `re_nsub' in the
-           pattern buffer, and one byte with the number of inner groups,
-           just like `start_memory'.  (We need the number of inner
-           groups here because we don't have any easy way of finding the
-           corresponding start_memory when we're at a stop_memory.)  */
-  stop_memory,
-
-        /* Match a duplicate of something remembered. Followed by one
-           byte containing the register number.  */
-  duplicate,
-
-        /* Fail unless at beginning of line.  */
-  begline,
-
-        /* Fail unless at end of line.  */
-  endline,
-
-        /* Succeeds if at beginning of buffer (if emacs) or at beginning
-           of string to be matched (if not).  */
-  begbuf,
-
-        /* Analogously, for end of buffer/string.  */
-  endbuf,
-        /* Followed by two byte relative address to which to jump.  */
-  jump, 
-
-       /* Same as jump, but marks the end of an alternative.  */
-  jump_past_alt,
-
-        /* Followed by two-byte relative address of place to resume at
-           in case of failure.  */
-  on_failure_jump,
-       
-        /* Like on_failure_jump, but pushes a placeholder instead of the
-           current string position when executed.  */
-  on_failure_keep_string_jump,
-  
-        /* Throw away latest failure point and then jump to following
-           two-byte relative address.  */
-  pop_failure_jump,
-
-        /* Change to pop_failure_jump if know won't have to backtrack to
-           match; otherwise change to jump.  This is used to jump
-           back to the beginning of a repeat.  If what follows this jump
-           clearly won't match what the repeat does, such that we can be
-           sure that there is no use backtracking out of repetitions
-           already matched, then we change it to a pop_failure_jump.
-           Followed by two-byte address.  */
-  maybe_pop_jump,
-
-        /* Jump to following two-byte address, and push a dummy failure
-           point. This failure point will be thrown away if an attempt
-           is made to use it for a failure.  A `+' construct makes this
-           before the first repeat.  Also used as an intermediary kind
-           of jump when compiling an alternative.  */
-  dummy_failure_jump,
-
-       /* Push a dummy failure point and continue.  Used at the end of
-          alternatives.  */
-  push_dummy_failure,
-
-        /* Followed by two-byte relative address and two-byte number n.
-           After matching N times, jump to the address upon failure.  */
-  succeed_n,
-
-        /* Followed by two-byte relative address, and two-byte number n.
-           Jump to the address N times, then fail.  */
-  jump_n,
-
-        /* Set the following two-byte relative address to the
-           subsequent two-byte number.  The address *includes* the two
-           bytes of number.  */
-  set_number_at,
-
-  wordchar,    /* Matches any word-constituent character.  */
-  notwordchar, /* Matches any char that is not a word-constituent.  */
-
-  wordbeg,     /* Succeeds if at word beginning.  */
-  wordend,     /* Succeeds if at word end.  */
-
-  wordbound,   /* Succeeds if at a word boundary.  */
-  notwordbound /* Succeeds if not at a word boundary.  */
+ * expressions.  Some opcodes are followed by argument bytes.  A
+ * command code can specify any interpretation whatsoever for its
+ * arguments.  Zero bytes may appear in the compiled regular expression.
+ * 
+ * The value of `exactn' is needed in search.c (search_buffer) in Emacs.
+ * So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
+ * `exactn' we use here must also be 1.  */
+
+typedef enum {
+    no_op = 0,
+
+    /* Followed by one byte giving n, then by n literal bytes.  */
+    exactn = 1,
+
+    /* Matches any (more or less) character.  */
+    anychar,
+
+    /* Matches any one char belonging to specified set.  First
+     * following byte is number of bitmap bytes.  Then come bytes
+     * for a bitmap saying which chars are in.  Bits in each byte
+     * are ordered low-bit-first.  A character is in the set if its
+     * bit is 1.  A character too large to have a bit in the map is
+     * automatically not in the set.  */
+    charset,
+
+    /* Same parameters as charset, but match any character that is
+     * not one of those specified.  */
+    charset_not,
+
+    /* Start remembering the text that is matched, for storing in a
+     * register.  Followed by one byte with the register number, in
+     * the range 0 to one less than the pattern buffer's re_nsub
+     * field.  Then followed by one byte with the number of groups
+     * inner to this one.  (This last has to be part of the
+     * start_memory only because we need it in the on_failure_jump
+     * of re_match_2.)  */
+    start_memory,
+
+    /* Stop remembering the text that is matched and store it in a
+     * memory register.  Followed by one byte with the register
+     * number, in the range 0 to one less than `re_nsub' in the
+     * pattern buffer, and one byte with the number of inner groups,
+     * just like `start_memory'.  (We need the number of inner
+     * groups here because we don't have any easy way of finding the
+     * corresponding start_memory when we're at a stop_memory.)  */
+    stop_memory,
+
+    /* Match a duplicate of something remembered. Followed by one
+     * byte containing the register number.  */
+    duplicate,
+
+    /* Fail unless at beginning of line.  */
+    begline,
+
+    /* Fail unless at end of line.  */
+    endline,
+
+    /* Succeeds if at beginning of buffer (if emacs) or at beginning
+     * of string to be matched (if not).  */
+    begbuf,
+
+    /* Analogously, for end of buffer/string.  */
+    endbuf,
+
+    /* Followed by two byte relative address to which to jump.  */
+    jump,
+
+    /* Same as jump, but marks the end of an alternative.  */
+    jump_past_alt,
+
+    /* Followed by two-byte relative address of place to resume at
+     * in case of failure.  */
+    on_failure_jump,
+
+    /* Like on_failure_jump, but pushes a placeholder instead of the
+     * current string position when executed.  */
+    on_failure_keep_string_jump,
+
+    /* Throw away latest failure point and then jump to following
+     * two-byte relative address.  */
+    pop_failure_jump,
+
+    /* Change to pop_failure_jump if know won't have to backtrack to
+     * match; otherwise change to jump.  This is used to jump
+     * back to the beginning of a repeat.  If what follows this jump
+     * clearly won't match what the repeat does, such that we can be
+     * sure that there is no use backtracking out of repetitions
+     * already matched, then we change it to a pop_failure_jump.
+     * Followed by two-byte address.  */
+    maybe_pop_jump,
+
+    /* Jump to following two-byte address, and push a dummy failure
+     * point. This failure point will be thrown away if an attempt
+     * is made to use it for a failure.  A `+' construct makes this
+     * before the first repeat.  Also used as an intermediary kind
+     * of jump when compiling an alternative.  */
+    dummy_failure_jump,
+
+    /* Push a dummy failure point and continue.  Used at the end of
+     * alternatives.  */
+    push_dummy_failure,
+
+    /* Followed by two-byte relative address and two-byte number n.
+     * After matching N times, jump to the address upon failure.  */
+    succeed_n,
+
+    /* Followed by two-byte relative address, and two-byte number n.
+     * Jump to the address N times, then fail.  */
+    jump_n,
+
+    /* Set the following two-byte relative address to the
+     * subsequent two-byte number.  The address *includes* the two
+     * bytes of number.  */
+    set_number_at,
+
+    wordchar,                  /* Matches any word-constituent character.  */
+    notwordchar,               /* Matches any char that is not a word-constituent.  */
+
+    wordbeg,                   /* Succeeds if at word beginning.  */
+    wordend,                   /* Succeeds if at word end.  */
+
+    wordbound,                 /* Succeeds if at a word boundary.  */
+    notwordbound               /* Succeeds if not at a word boundary.  */
 
 #ifdef emacs
-  ,before_dot, /* Succeeds if before point.  */
-  at_dot,      /* Succeeds if at point.  */
-  after_dot,   /* Succeeds if after point.  */
+    ,before_dot,               /* Succeeds if before point.  */
+    at_dot,                    /* Succeeds if at point.  */
+    after_dot,                 /* Succeeds if after point.  */
 
-       /* Matches any character whose syntax is specified.  Followed by
-           a byte which contains a syntax code, e.g., Sword.  */
-  syntaxspec,
+    /* Matches any character whose syntax is specified.  Followed by
+     * a byte which contains a syntax code, e.g., Sword.  */
+    syntaxspec,
 
-       /* Matches any character whose syntax is not that specified.  */
-  notsyntaxspec
-#endif /* emacs */
+    /* Matches any character whose syntax is not that specified.  */
+    notsyntaxspec
+#endif                         /* emacs */
 } re_opcode_t;
 \f
 /* Common operations on the compiled pattern.  */
@@ -387,8 +386,8 @@ typedef enum
   } while (0)
 
 /* Same as STORE_NUMBER, except increment DESTINATION to
  the byte after where the number is stored.  Therefore, DESTINATION
  must be an lvalue.  */
* the byte after where the number is stored.  Therefore, DESTINATION
* must be an lvalue.  */
 
 #define STORE_NUMBER_AND_INCR(destination, number)                     \
   do {                                                                 \
@@ -397,7 +396,7 @@ typedef enum
   } while (0)
 
 /* Put into DESTINATION a number stored in two contiguous bytes starting
  at SOURCE.  */
* at SOURCE.  */
 
 #define EXTRACT_NUMBER(destination, source)                            \
   do {                                                                 \
@@ -407,16 +406,16 @@ typedef enum
 
 #ifdef DEBUG
 static void
-extract_number (dest, source)
-    int *dest;
-    unsigned char *source;
+extract_number(dest, source)
+     int *dest;
+     unsigned char *source;
 {
-  int temp = SIGN_EXTEND_CHAR (*(source + 1)); 
-  *dest = *source & 0377;
-  *dest += temp << 8;
+    int temp = SIGN_EXTEND_CHAR(*(source + 1));
+    *dest = *source & 0377;
+    *dest += temp << 8;
 }
 
-#ifndef EXTRACT_MACROS /* To debug the macros.  */
+#ifndef EXTRACT_MACROS         /* To debug the macros.  */
 #undef EXTRACT_NUMBER
 #define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
 #endif /* not EXTRACT_MACROS */
@@ -424,7 +423,7 @@ extract_number (dest, source)
 #endif /* DEBUG */
 
 /* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
  SOURCE must be an lvalue.  */
* SOURCE must be an lvalue.  */
 
 #define EXTRACT_NUMBER_AND_INCR(destination, source)                   \
   do {                                                                 \
@@ -434,12 +433,12 @@ extract_number (dest, source)
 
 #ifdef DEBUG
 static void
-extract_number_and_incr (destination, source)
-    int *destination;
-    unsigned char **source;
-{ 
-  extract_number (destination, *source);
-  *source += 2;
+extract_number_and_incr(destination, source)
+     int *destination;
+     unsigned char **source;
+{
+    extract_number(destination, *source);
+    *source += 2;
 }
 
 #ifndef EXTRACT_MACROS
@@ -451,10 +450,10 @@ extract_number_and_incr (destination, source)
 #endif /* DEBUG */
 \f
 /* If DEBUG is defined, Regex prints many voluminous messages about what
  it is doing (if the variable `debug' is nonzero).  If linked with the
  main program in `iregex.c', you can enter patterns and strings
  interactively.  And if linked with the main program in `main.c' and
  the other test files, you can run the already-written tests.  */
* it is doing (if the variable `debug' is nonzero).  If linked with the
* main program in `iregex.c', you can enter patterns and strings
* interactively.  And if linked with the main program in `main.c' and
* the other test files, you can run the already-written tests.  */
 
 #ifdef DEBUG
 
@@ -477,301 +476,286 @@ static int debug = 0;
   if (debug) print_double_string (w, s1, sz1, s2, sz2)
 
 
-extern void printchar ();
+extern void printchar();
 
 /* Print the fastmap in human-readable form.  */
 
 void
-print_fastmap (fastmap)
-    char *fastmap;
+print_fastmap(fastmap)
+     char *fastmap;
 {
-  unsigned was_a_range = 0;
-  unsigned i = 0;  
-  
-  while (i < (1 << BYTEWIDTH))
-    {
-      if (fastmap[i++])
-       {
-         was_a_range = 0;
-          printchar (i - 1);
-          while (i < (1 << BYTEWIDTH)  &&  fastmap[i])
-            {
-              was_a_range = 1;
-              i++;
-            }
-         if (was_a_range)
-            {
-              printf ("-");
-              printchar (i - 1);
-            }
-        }
+    unsigned was_a_range = 0;
+    unsigned i = 0;
+
+    while (i < (1 << BYTEWIDTH)) {
+       if (fastmap[i++]) {
+           was_a_range = 0;
+           printchar(i - 1);
+           while (i < (1 << BYTEWIDTH) && fastmap[i]) {
+               was_a_range = 1;
+               i++;
+           }
+           if (was_a_range) {
+               printf("-");
+               printchar(i - 1);
+           }
+       }
     }
-  putchar ('\n'); 
+    putchar('\n');
 }
 
 
 /* Print a compiled pattern string in human-readable form, starting at
  the START pointer into it and ending just before the pointer END.  */
* the START pointer into it and ending just before the pointer END.  */
 
 void
-print_partial_compiled_pattern (start, end)
-    unsigned char *start;
-    unsigned char *end;
+print_partial_compiled_pattern(start, end)
+     unsigned char *start;
+     unsigned char *end;
 {
-  int mcnt, mcnt2;
-  unsigned char *p = start;
-  unsigned char *pend = end;
-
-  if (start == NULL)
-    {
-      printf ("(null)\n");
-      return;
+    int mcnt, mcnt2;
+    unsigned char *p = start;
+    unsigned char *pend = end;
+
+    if (start == NULL) {
+       printf("(null)\n");
+       return;
     }
-    
-  /* Loop over pattern commands.  */
-  while (p < pend)
-    {
-      switch ((re_opcode_t) *p++)
-       {
-        case no_op:
-          printf ("/no_op");
-          break;
+    /* Loop over pattern commands.  */
+    while (p < pend) {
+       switch ((re_opcode_t) * p++) {
+       case no_op:
+           printf("/no_op");
+           break;
 
        case exactn:
-         mcnt = *p++;
-          printf ("/exactn/%d", mcnt);
-          do
-           {
-              putchar ('/');
-             printchar (*p++);
-            }
-          while (--mcnt);
-          break;
+           mcnt = *p++;
+           printf("/exactn/%d", mcnt);
+           do {
+               putchar('/');
+               printchar(*p++);
+           }
+           while (--mcnt);
+           break;
 
        case start_memory:
-          mcnt = *p++;
-          printf ("/start_memory/%d/%d", mcnt, *p++);
-          break;
+           mcnt = *p++;
+           printf("/start_memory/%d/%d", mcnt, *p++);
+           break;
 
        case stop_memory:
-          mcnt = *p++;
-         printf ("/stop_memory/%d/%d", mcnt, *p++);
-          break;
+           mcnt = *p++;
+           printf("/stop_memory/%d/%d", mcnt, *p++);
+           break;
 
        case duplicate:
-         printf ("/duplicate/%d", *p++);
-         break;
+           printf("/duplicate/%d", *p++);
+           break;
 
        case anychar:
-         printf ("/anychar");
-         break;
+           printf("/anychar");
+           break;
 
        case charset:
-        case charset_not:
-          {
-            register int c;
-
-            printf ("/charset%s",
-                   (re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-            
-            assert (p + *p < pend);
-
-            for (c = 0; c < *p; c++)
-              {
-                unsigned bit;
-                unsigned char map_byte = p[1 + c];
-                
-                putchar ('/');
-
-               for (bit = 0; bit < BYTEWIDTH; bit++)
-                  if (map_byte & (1 << bit))
-                    printchar (c * BYTEWIDTH + bit);
-              }
-           p += 1 + *p;
-           break;
-         }
+       case charset_not:
+           {
+               register int c;
+
+               printf("/charset%s",
+                   (re_opcode_t) * (p - 1) == charset_not ? "_not" : "");
+
+               assert(p + *p < pend);
+
+               for (c = 0; c < *p; c++) {
+                   unsigned bit;
+                   unsigned char map_byte = p[1 + c];
+
+                   putchar('/');
+
+                   for (bit = 0; bit < BYTEWIDTH; bit++)
+                       if (map_byte & (1 << bit))
+                           printchar(c * BYTEWIDTH + bit);
+               }
+               p += 1 + *p;
+               break;
+           }
 
        case begline:
-         printf ("/begline");
-          break;
+           printf("/begline");
+           break;
 
        case endline:
-          printf ("/endline");
-          break;
+           printf("/endline");
+           break;
 
        case on_failure_jump:
-          extract_number_and_incr (&mcnt, &p);
-         printf ("/on_failure_jump/0/%d", mcnt);
-          break;
+           extract_number_and_incr(&mcnt, &p);
+           printf("/on_failure_jump/0/%d", mcnt);
+           break;
 
        case on_failure_keep_string_jump:
-          extract_number_and_incr (&mcnt, &p);
-         printf ("/on_failure_keep_string_jump/0/%d", mcnt);
-          break;
+           extract_number_and_incr(&mcnt, &p);
+           printf("/on_failure_keep_string_jump/0/%d", mcnt);
+           break;
 
        case dummy_failure_jump:
-          extract_number_and_incr (&mcnt, &p);
-         printf ("/dummy_failure_jump/0/%d", mcnt);
-          break;
+           extract_number_and_incr(&mcnt, &p);
+           printf("/dummy_failure_jump/0/%d", mcnt);
+           break;
 
        case push_dummy_failure:
-          printf ("/push_dummy_failure");
-          break;
-          
-        case maybe_pop_jump:
-          extract_number_and_incr (&mcnt, &p);
-         printf ("/maybe_pop_jump/0/%d", mcnt);
-         break;
-
-        case pop_failure_jump:
-         extract_number_and_incr (&mcnt, &p);
-         printf ("/pop_failure_jump/0/%d", mcnt);
-         break;          
-          
-        case jump_past_alt:
-         extract_number_and_incr (&mcnt, &p);
-         printf ("/jump_past_alt/0/%d", mcnt);
-         break;          
-          
-        case jump:
-         extract_number_and_incr (&mcnt, &p);
-         printf ("/jump/0/%d", mcnt);
-         break;
-
-        case succeed_n: 
-          extract_number_and_incr (&mcnt, &p);
-          extract_number_and_incr (&mcnt2, &p);
-         printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
-          break;
-        
-        case jump_n: 
-          extract_number_and_incr (&mcnt, &p);
-          extract_number_and_incr (&mcnt2, &p);
-         printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
-          break;
-        
-        case set_number_at: 
-          extract_number_and_incr (&mcnt, &p);
-          extract_number_and_incr (&mcnt2, &p);
-         printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
-          break;
-        
-        case wordbound:
-         printf ("/wordbound");
-         break;
+           printf("/push_dummy_failure");
+           break;
+
+       case maybe_pop_jump:
+           extract_number_and_incr(&mcnt, &p);
+           printf("/maybe_pop_jump/0/%d", mcnt);
+           break;
+
+       case pop_failure_jump:
+           extract_number_and_incr(&mcnt, &p);
+           printf("/pop_failure_jump/0/%d", mcnt);
+           break;
+
+       case jump_past_alt:
+           extract_number_and_incr(&mcnt, &p);
+           printf("/jump_past_alt/0/%d", mcnt);
+           break;
+
+       case jump:
+           extract_number_and_incr(&mcnt, &p);
+           printf("/jump/0/%d", mcnt);
+           break;
+
+       case succeed_n:
+           extract_number_and_incr(&mcnt, &p);
+           extract_number_and_incr(&mcnt2, &p);
+           printf("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
+           break;
+
+       case jump_n:
+           extract_number_and_incr(&mcnt, &p);
+           extract_number_and_incr(&mcnt2, &p);
+           printf("/jump_n/0/%d/0/%d", mcnt, mcnt2);
+           break;
+
+       case set_number_at:
+           extract_number_and_incr(&mcnt, &p);
+           extract_number_and_incr(&mcnt2, &p);
+           printf("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
+           break;
+
+       case wordbound:
+           printf("/wordbound");
+           break;
 
        case notwordbound:
-         printf ("/notwordbound");
-          break;
+           printf("/notwordbound");
+           break;
 
        case wordbeg:
-         printf ("/wordbeg");
-         break;
-          
+           printf("/wordbeg");
+           break;
+
        case wordend:
-         printf ("/wordend");
-          
+           printf("/wordend");
+
 #ifdef emacs
        case before_dot:
-         printf ("/before_dot");
-          break;
+           printf("/before_dot");
+           break;
 
        case at_dot:
-         printf ("/at_dot");
-          break;
+           printf("/at_dot");
+           break;
 
        case after_dot:
-         printf ("/after_dot");
-          break;
+           printf("/after_dot");
+           break;
 
        case syntaxspec:
-          printf ("/syntaxspec");
-         mcnt = *p++;
-         printf ("/%d", mcnt);
-          break;
-         
+           printf("/syntaxspec");
+           mcnt = *p++;
+           printf("/%d", mcnt);
+           break;
+
        case notsyntaxspec:
-          printf ("/notsyntaxspec");
-         mcnt = *p++;
-         printf ("/%d", mcnt);
-         break;
+           printf("/notsyntaxspec");
+           mcnt = *p++;
+           printf("/%d", mcnt);
+           break;
 #endif /* emacs */
 
        case wordchar:
-         printf ("/wordchar");
-          break;
-         
+           printf("/wordchar");
+           break;
+
        case notwordchar:
-         printf ("/notwordchar");
-          break;
+           printf("/notwordchar");
+           break;
 
        case begbuf:
-         printf ("/begbuf");
-          break;
+           printf("/begbuf");
+           break;
 
        case endbuf:
-         printf ("/endbuf");
-          break;
+           printf("/endbuf");
+           break;
 
-        default:
-          printf ("?%d", *(p-1));
+       default:
+           printf("?%d", *(p - 1));
        }
     }
-  printf ("/\n");
+    printf("/\n");
 }
 
 
 void
-print_compiled_pattern (bufp)
-    struct re_pattern_buffer *bufp;
+print_compiled_pattern(bufp)
+     struct re_pattern_buffer *bufp;
 {
-  unsigned char *buffer = bufp->buffer;
+    unsigned char *buffer = bufp->buffer;
 
-  print_partial_compiled_pattern (buffer, buffer + bufp->used);
-  printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
+    print_partial_compiled_pattern(buffer, buffer + bufp->used);
+    printf("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
 
-  if (bufp->fastmap_accurate && bufp->fastmap)
-    {
-      printf ("fastmap: ");
-      print_fastmap (bufp->fastmap);
+    if (bufp->fastmap_accurate && bufp->fastmap) {
+       printf("fastmap: ");
+       print_fastmap(bufp->fastmap);
     }
-
-  printf ("re_nsub: %d\t", bufp->re_nsub);
-  printf ("regs_alloc: %d\t", bufp->regs_allocated);
-  printf ("can_be_null: %d\t", bufp->can_be_null);
-  printf ("newline_anchor: %d\n", bufp->newline_anchor);
-  printf ("no_sub: %d\t", bufp->no_sub);
-  printf ("not_bol: %d\t", bufp->not_bol);
-  printf ("not_eol: %d\t", bufp->not_eol);
-  printf ("syntax: %d\n", bufp->syntax);
-  /* Perhaps we should print the translate table?  */
+    printf("re_nsub: %d\t", bufp->re_nsub);
+    printf("regs_alloc: %d\t", bufp->regs_allocated);
+    printf("can_be_null: %d\t", bufp->can_be_null);
+    printf("newline_anchor: %d\n", bufp->newline_anchor);
+    printf("no_sub: %d\t", bufp->no_sub);
+    printf("not_bol: %d\t", bufp->not_bol);
+    printf("not_eol: %d\t", bufp->not_eol);
+    printf("syntax: %d\n", bufp->syntax);
+    /* Perhaps we should print the translate table?  */
 }
 
 
 void
-print_double_string (where, string1, size1, string2, size2)
-    const char *where;
-    const char *string1;
-    const char *string2;
-    int size1;
-    int size2;
+print_double_string(where, string1, size1, string2, size2)
+     const char *where;
+     const char *string1;
+     const char *string2;
+     int size1;
+     int size2;
 {
-  unsigned this_char;
-  
-  if (where == NULL)
-    printf ("(null)");
-  else
-    {
-      if (FIRST_STRING_P (where))
-        {
-          for (this_char = where - string1; this_char < size1; this_char++)
-            printchar (string1[this_char]);
-
-          where = string2;    
-        }
-
-      for (this_char = where - string2; this_char < size2; this_char++)
-        printchar (string2[this_char]);
+    unsigned this_char;
+
+    if (where == NULL)
+       printf("(null)");
+    else {
+       if (FIRST_STRING_P(where)) {
+           for (this_char = where - string1; this_char < size1; this_char++)
+               printchar(string1[this_char]);
+
+           where = string2;
+       }
+       for (this_char = where - string2; this_char < size2; this_char++)
+           printchar(string2[this_char]);
     }
 }
 
@@ -791,63 +775,63 @@ print_double_string (where, string1, size1, string2, size2)
 #endif /* not DEBUG */
 \f
 /* Set by `re_set_syntax' to the current regexp syntax to recognize.  Can
  also be assigned to arbitrarily: each pattern buffer stores its own
  syntax, so it can be changed between regex compilations.  */
* also be assigned to arbitrarily: each pattern buffer stores its own
* syntax, so it can be changed between regex compilations.  */
 reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
 
 
 /* Specify the precise syntax of regexps for compilation.  This provides
  for compatibility for various utilities which historically have
  different, incompatible syntaxes.
-
  The argument SYNTAX is a bit mask comprised of the various bits
  defined in regex.h.  We return the old syntax.  */
* for compatibility for various utilities which historically have
* different, incompatible syntaxes.
+ * 
* The argument SYNTAX is a bit mask comprised of the various bits
* defined in regex.h.  We return the old syntax.  */
 
 reg_syntax_t
-re_set_syntax (syntax)
-    reg_syntax_t syntax;
+re_set_syntax(syntax)
+     reg_syntax_t syntax;
 {
-  reg_syntax_t ret = re_syntax_options;
-  
-  re_syntax_options = syntax;
-  return ret;
+    reg_syntax_t ret = re_syntax_options;
+
+    re_syntax_options = syntax;
+    return ret;
 }
 \f
 /* This table gives an error message for each of the error codes listed
  in regex.h.  Obviously the order here has to be same as there.  */
* in regex.h.  Obviously the order here has to be same as there.  */
 
 static const char *re_error_msg[] =
-  { NULL,                                      /* REG_NOERROR */
-    "No match",                                        /* REG_NOMATCH */
-    "Invalid regular expression",              /* REG_BADPAT */
-    "Invalid collation character",             /* REG_ECOLLATE */
-    "Invalid character class name",            /* REG_ECTYPE */
-    "Trailing backslash",                      /* REG_EESCAPE */
-    "Invalid back reference",                  /* REG_ESUBREG */
-    "Unmatched [ or [^",                       /* REG_EBRACK */
-    "Unmatched ( or \\(",                      /* REG_EPAREN */
-    "Unmatched \\{",                           /* REG_EBRACE */
-    "Invalid content of \\{\\}",               /* REG_BADBR */
-    "Invalid range end",                       /* REG_ERANGE */
-    "Memory exhausted",                                /* REG_ESPACE */
+{NULL,                         /* REG_NOERROR */
+    "No match",                        /* REG_NOMATCH */
+    "Invalid regular expression",      /* REG_BADPAT */
+    "Invalid collation character",     /* REG_ECOLLATE */
+    "Invalid character class name",    /* REG_ECTYPE */
+    "Trailing backslash",      /* REG_EESCAPE */
+    "Invalid back reference",  /* REG_ESUBREG */
+    "Unmatched [ or [^",       /* REG_EBRACK */
+    "Unmatched ( or \\(",      /* REG_EPAREN */
+    "Unmatched \\{",           /* REG_EBRACE */
+    "Invalid content of \\{\\}",       /* REG_BADBR */
+    "Invalid range end",       /* REG_ERANGE */
+    "Memory exhausted",                /* REG_ESPACE */
     "Invalid preceding regular expression",    /* REG_BADRPT */
     "Premature end of regular expression",     /* REG_EEND */
-    "Regular expression too big",              /* REG_ESIZE */
-    "Unmatched ) or \\)",                      /* REG_ERPAREN */
-  };
+    "Regular expression too big",      /* REG_ESIZE */
+    "Unmatched ) or \\)",      /* REG_ERPAREN */
+};
 \f
 /* Subroutine declarations and macros for regex_compile.  */
 
-static void store_op1 (), store_op2 ();
-static void insert_op1 (), insert_op2 ();
-static boolean at_begline_loc_p (), at_endline_loc_p ();
-static boolean group_in_compile_stack ();
-static reg_errcode_t compile_range ();
+static void store_op1(), store_op2();
+static void insert_op1(), insert_op2();
+static boolean at_begline_loc_p(), at_endline_loc_p();
+static boolean group_in_compile_stack();
+static reg_errcode_t compile_range();
 
 /* Fetch the next character in the uncompiled pattern---translating it 
  if necessary.  Also cast from a signed character in the constant
  string passed to us by the user to an unsigned char that we can use
  as an array index (in, e.g., `translate').  */
* if necessary.  Also cast from a signed character in the constant
* string passed to us by the user to an unsigned char that we can use
* as an array index (in, e.g., `translate').  */
 #define PATFETCH(c)                                                    \
   do {if (p == pend) return REG_EEND;                                  \
     c = (unsigned char) *p++;                                          \
@@ -855,7 +839,7 @@ static reg_errcode_t compile_range ();
   } while (0)
 
 /* Fetch the next character in the uncompiled pattern, with no
  translation.  */
* translation.  */
 #define PATFETCH_RAW(c)                                                        \
   do {if (p == pend) return REG_EEND;                                  \
     c = (unsigned char) *p++;                                          \
@@ -866,9 +850,9 @@ static reg_errcode_t compile_range ();
 
 
 /* If `translate' is non-null, return translate[D], else just D.  We
  cast the subscript to translate because some data is declared as
  `char *', to avoid warnings when a string constant is passed.  But
  when we use a character as a subscript we must make it unsigned.  */
* cast the subscript to translate because some data is declared as
* `char *', to avoid warnings when a string constant is passed.  But
* when we use a character as a subscript we must make it unsigned.  */
 #define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
 
 
@@ -910,7 +894,7 @@ static reg_errcode_t compile_range ();
 
 
 /* Store a jump with opcode OP at LOC to location TO.  We store a
  relative address offset by the three bytes the jump itself occupies.  */
* relative address offset by the three bytes the jump itself occupies.  */
 #define STORE_JUMP(op, loc, to) \
   store_op1 (op, loc, (to) - (loc) - 3)
 
@@ -928,15 +912,15 @@ static reg_errcode_t compile_range ();
 
 
 /* This is not an arbitrary limit: the arguments which represent offsets
  into the pattern are two bytes long.  So if 2^16 bytes turns out to
  be too small, many things would have to change.  */
* into the pattern are two bytes long.  So if 2^16 bytes turns out to
* be too small, many things would have to change.  */
 #define MAX_BUF_SIZE (1L << 16)
 
 
 /* Extend the buffer by twice its current size via realloc and
  reset the pointers that pointed into the old block to point to the
  correct places in the new one.  If extending the buffer results in it
  being larger than MAX_BUF_SIZE, then flag memory exhausted.  */
* reset the pointers that pointed into the old block to point to the
* correct places in the new one.  If extending the buffer results in it
* being larger than MAX_BUF_SIZE, then flag memory exhausted.  */
 #define EXTEND_BUFFER()                                                        \
   do {                                                                         \
     unsigned char *old_buffer = bufp->buffer;                          \
@@ -964,36 +948,34 @@ static reg_errcode_t compile_range ();
 
 
 /* Since we have one byte reserved for the register number argument to
  {start,stop}_memory, the maximum number of groups we can report
  things about is what fits in that byte.  */
* {start,stop}_memory, the maximum number of groups we can report
* things about is what fits in that byte.  */
 #define MAX_REGNUM 255
 
 /* But patterns can have more than `MAX_REGNUM' registers.  We just
  ignore the excess.  */
* ignore the excess.  */
 typedef unsigned regnum_t;
 
 
 /* Macros for the compile stack.  */
 
 /* Since offsets can go either forwards or backwards, this type needs to
  be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
* be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
 typedef int pattern_offset_t;
 
-typedef struct
-{
-  pattern_offset_t begalt_offset;
-  pattern_offset_t fixup_alt_jump;
-  pattern_offset_t inner_group_offset;
-  pattern_offset_t laststart_offset;  
-  regnum_t regnum;
+typedef struct {
+    pattern_offset_t begalt_offset;
+    pattern_offset_t fixup_alt_jump;
+    pattern_offset_t inner_group_offset;
+    pattern_offset_t laststart_offset;
+    regnum_t regnum;
 } compile_stack_elt_t;
 
 
-typedef struct
-{
-  compile_stack_elt_t *stack;
-  unsigned size;
-  unsigned avail;                      /* Offset of next open position.  */
+typedef struct {
+    compile_stack_elt_t *stack;
+    unsigned size;
+    unsigned avail;            /* Offset of next open position.  */
 } compile_stack_type;
 
 
@@ -1027,9 +1009,9 @@ typedef struct
            PATFETCH (c);                                               \
          }                                                             \
        }                                                               \
-    }          
+    }
 
-#define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
+#define CHAR_CLASS_MAX_LENGTH  6       /* Namely, `xdigit'.  */
 
 #define IS_CHAR_CLASS(string)                                          \
    (STREQ (string, "alpha") || STREQ (string, "upper")                 \
@@ -1040,1231 +1022,1184 @@ typedef struct
     || STREQ (string, "cntrl") || STREQ (string, "blank"))
 \f
 /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
  Returns one of error codes defined in `regex.h', or zero for success.
-
  Assumes the `allocated' (and perhaps `buffer') and `translate'
  fields are set in BUFP on entry.
-
  If it succeeds, results are put in BUFP (if it returns an error, the
  contents of BUFP are undefined):
    `buffer' is the compiled pattern;
    `syntax' is set to SYNTAX;
    `used' is set to the length of the compiled pattern;
    `fastmap_accurate' is zero;
    `re_nsub' is the number of subexpressions in PATTERN;
    `not_bol' and `not_eol' are zero;
-   
  The `fastmap' and `newline_anchor' fields are neither
  examined nor set.  */
* Returns one of error codes defined in `regex.h', or zero for success.
+ * 
* Assumes the `allocated' (and perhaps `buffer') and `translate'
* fields are set in BUFP on entry.
+ * 
* If it succeeds, results are put in BUFP (if it returns an error, the
* contents of BUFP are undefined):
* `buffer' is the compiled pattern;
* `syntax' is set to SYNTAX;
* `used' is set to the length of the compiled pattern;
* `fastmap_accurate' is zero;
* `re_nsub' is the number of subexpressions in PATTERN;
* `not_bol' and `not_eol' are zero;
+ * 
* The `fastmap' and `newline_anchor' fields are neither
* examined nor set.  */
 
 static reg_errcode_t
-regex_compile (pattern, size, syntax, bufp)
+regex_compile(pattern, size, syntax, bufp)
      const char *pattern;
      int size;
      reg_syntax_t syntax;
      struct re_pattern_buffer *bufp;
 {
-  /* We fetch characters from PATTERN here.  Even though PATTERN is
-     `char *' (i.e., signed), we declare these variables as unsigned, so
-     they can be reliably used as array indices.  */
-  register unsigned char c, c1;
-  
-  /* A random tempory spot in PATTERN.  */
-  const char *p1;
-
-  /* Points to the end of the buffer, where we should append.  */
-  register unsigned char *b;
-  
-  /* Keeps track of unclosed groups.  */
-  compile_stack_type compile_stack;
-
-  /* Points to the current (ending) position in the pattern.  */
-  const char *p = pattern;
-  const char *pend = pattern + size;
-  
-  /* How to translate the characters in the pattern.  */
-  char *translate = bufp->translate;
-
-  /* Address of the count-byte of the most recently inserted `exactn'
-     command.  This makes it possible to tell if a new exact-match
-     character can be added to that command or if the character requires
-     a new `exactn' command.  */
-  unsigned char *pending_exact = 0;
-
-  /* Address of start of the most recently finished expression.
-     This tells, e.g., postfix * where to find the start of its
-     operand.  Reset at the beginning of groups and alternatives.  */
-  unsigned char *laststart = 0;
-
-  /* Address of beginning of regexp, or inside of last group.  */
-  unsigned char *begalt;
-
-  /* Place in the uncompiled pattern (i.e., the {) to
-     which to go back if the interval is invalid.  */
-  const char *beg_interval;
-                
-  /* Address of the place where a forward jump should go to the end of
-     the containing expression.  Each alternative of an `or' -- except the
-     last -- ends with a forward jump of this sort.  */
-  unsigned char *fixup_alt_jump = 0;
-
-  /* Counts open-groups as they are encountered.  Remembered for the
-     matching close-group on the compile stack, so the same register
-     number is put in the stop_memory as the start_memory.  */
-  regnum_t regnum = 0;
+    /* We fetch characters from PATTERN here.  Even though PATTERN is
+     `char *' (i.e., signed), we declare these variables as unsigned, so
+     they can be reliably used as array indices.  */
+    register unsigned char c, c1;
+
+    /* A random tempory spot in PATTERN.  */
+    const char *p1;
+
+    /* Points to the end of the buffer, where we should append.  */
+    register unsigned char *b;
+
+    /* Keeps track of unclosed groups.  */
+    compile_stack_type compile_stack;
+
+    /* Points to the current (ending) position in the pattern.  */
+    const char *p = pattern;
+    const char *pend = pattern + size;
+
+    /* How to translate the characters in the pattern.  */
+    char *translate = bufp->translate;
+
+    /* Address of the count-byte of the most recently inserted `exactn'
+     command.  This makes it possible to tell if a new exact-match
+     character can be added to that command or if the character requires
+     a new `exactn' command.  */
+    unsigned char *pending_exact = 0;
+
+    /* Address of start of the most recently finished expression.
+     This tells, e.g., postfix * where to find the start of its
+     operand.  Reset at the beginning of groups and alternatives.  */
+    unsigned char *laststart = 0;
+
+    /* Address of beginning of regexp, or inside of last group.  */
+    unsigned char *begalt;
+
+    /* Place in the uncompiled pattern (i.e., the {) to
+     which to go back if the interval is invalid.  */
+    const char *beg_interval;
+
+    /* Address of the place where a forward jump should go to the end of
+     the containing expression.  Each alternative of an `or' -- except the
+     last -- ends with a forward jump of this sort.  */
+    unsigned char *fixup_alt_jump = 0;
+
+    /* Counts open-groups as they are encountered.  Remembered for the
+     matching close-group on the compile stack, so the same register
+     number is put in the stop_memory as the start_memory.  */
+    regnum_t regnum = 0;
 
 #ifdef DEBUG
-  DEBUG_PRINT1 ("\nCompiling pattern: ");
-  if (debug)
-    {
-      unsigned debug_count;
-      
-      for (debug_count = 0; debug_count < size; debug_count++)
-        printchar (pattern[debug_count]);
-      putchar ('\n');
+    DEBUG_PRINT1("\nCompiling pattern: ");
+    if (debug) {
+       unsigned debug_count;
+
+       for (debug_count = 0; debug_count < size; debug_count++)
+           printchar(pattern[debug_count]);
+       putchar('\n');
     }
 #endif /* DEBUG */
 
-  /* Initialize the compile stack.  */
-  compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
-  if (compile_stack.stack == NULL)
-    return REG_ESPACE;
+    /* Initialize the compile stack.  */
+    compile_stack.stack = TALLOC(INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
+    if (compile_stack.stack == NULL)
+       return REG_ESPACE;
 
-  compile_stack.size = INIT_COMPILE_STACK_SIZE;
-  compile_stack.avail = 0;
+    compile_stack.size = INIT_COMPILE_STACK_SIZE;
+    compile_stack.avail = 0;
 
-  /* Initialize the pattern buffer.  */
-  bufp->syntax = syntax;
-  bufp->fastmap_accurate = 0;
-  bufp->not_bol = bufp->not_eol = 0;
+    /* Initialize the pattern buffer.  */
+    bufp->syntax = syntax;
+    bufp->fastmap_accurate = 0;
+    bufp->not_bol = bufp->not_eol = 0;
 
-  /* Set `used' to zero, so that if we return an error, the pattern
-     printer (for debugging) will think there's no pattern.  We reset it
-     at the end.  */
-  bufp->used = 0;
-  
-  /* Always count groups, whether or not bufp->no_sub is set.  */
-  bufp->re_nsub = 0;                           
+    /* Set `used' to zero, so that if we return an error, the pattern
+     printer (for debugging) will think there's no pattern.  We reset it
+     at the end.  */
+    bufp->used = 0;
+
+    /* Always count groups, whether or not bufp->no_sub is set.  */
+    bufp->re_nsub = 0;
 
 #if !defined (emacs) && !defined (SYNTAX_TABLE)
-  /* Initialize the syntax table.  */
-   init_syntax_once ();
+    /* Initialize the syntax table.  */
+    init_syntax_once();
 #endif
 
-  if (bufp->allocated == 0)
-    {
-      if (bufp->buffer)
-       { /* If zero allocated, but buffer is non-null, try to realloc
-             enough space.  This loses if buffer's address is bogus, but
-             that is the user's responsibility.  */
-          RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
-        }
-      else
-        { /* Caller did not allocate a buffer.  Do it for them.  */
-          bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
-        }
-      if (!bufp->buffer) return REG_ESPACE;
-
-      bufp->allocated = INIT_BUF_SIZE;
+    if (bufp->allocated == 0) {
+       if (bufp->buffer) {     /* If zero allocated, but buffer is non-null, try to realloc
+                                * enough space.  This loses if buffer's address is bogus, but
+                                * that is the user's responsibility.  */
+           RETALLOC(bufp->buffer, INIT_BUF_SIZE, unsigned char);
+       } else {                /* Caller did not allocate a buffer.  Do it for them.  */
+           bufp->buffer = TALLOC(INIT_BUF_SIZE, unsigned char);
+       }
+       if (!bufp->buffer)
+           return REG_ESPACE;
+
+       bufp->allocated = INIT_BUF_SIZE;
     }
+    begalt = b = bufp->buffer;
 
-  begalt = b = bufp->buffer;
-
-  /* Loop through the uncompiled pattern until we're at the end.  */
-  while (p != pend)
-    {
-      PATFETCH (c);
-
-      switch (c)
-        {
-        case '^':
-          {
-            if (   /* If at start of pattern, it's an operator.  */
-                   p == pattern + 1
-                   /* If context independent, it's an operator.  */
-                || syntax & RE_CONTEXT_INDEP_ANCHORS
-                   /* Otherwise, depends on what's come before.  */
-                || at_begline_loc_p (pattern, p, syntax))
-              BUF_PUSH (begline);
-            else
-              goto normal_char;
-          }
-          break;
-
-
-        case '$':
-          {
-            if (   /* If at end of pattern, it's an operator.  */
-                   p == pend 
-                   /* If context independent, it's an operator.  */
-                || syntax & RE_CONTEXT_INDEP_ANCHORS
-                   /* Otherwise, depends on what's next.  */
-                || at_endline_loc_p (p, pend, syntax))
-               BUF_PUSH (endline);
-             else
-               goto normal_char;
-           }
-           break;
+    /* Loop through the uncompiled pattern until we're at the end.  */
+    while (p != pend) {
+       PATFETCH(c);
+
+       switch (c) {
+       case '^':
+           {
+               if (            /* If at start of pattern, it's an operator.  */
+                   p == pattern + 1
+               /* If context independent, it's an operator.  */
+                   || syntax & RE_CONTEXT_INDEP_ANCHORS
+               /* Otherwise, depends on what's come before.  */
+                   || at_begline_loc_p(pattern, p, syntax))
+                   BUF_PUSH(begline);
+               else
+                   goto normal_char;
+           }
+           break;
+
+
+       case '$':
+           {
+               if (            /* If at end of pattern, it's an operator.  */
+                   p == pend
+               /* If context independent, it's an operator.  */
+                   || syntax & RE_CONTEXT_INDEP_ANCHORS
+               /* Otherwise, depends on what's next.  */
+                   || at_endline_loc_p(p, pend, syntax))
+                   BUF_PUSH(endline);
+               else
+                   goto normal_char;
+           }
+           break;
 
 
        case '+':
-        case '?':
-          if ((syntax & RE_BK_PLUS_QM)
-              || (syntax & RE_LIMITED_OPS))
-            goto normal_char;
-        handle_plus:
-        case '*':
-          /* If there is no previous pattern... */
-          if (!laststart)
-            {
-              if (syntax & RE_CONTEXT_INVALID_OPS)
-                return REG_BADRPT;
-              else if (!(syntax & RE_CONTEXT_INDEP_OPS))
-                goto normal_char;
-            }
-
-          {
-            /* Are we optimizing this jump?  */
-            boolean keep_string_p = false;
-            
-            /* 1 means zero (many) matches is allowed.  */
-            char zero_times_ok = 0, many_times_ok = 0;
-
-            /* If there is a sequence of repetition chars, collapse it
-               down to just one (the right one).  We can't combine
-               interval operators with these because of, e.g., `a{2}*',
-               which should only match an even number of `a's.  */
-
-            for (;;)
-              {
-                zero_times_ok |= c != '+';
-                many_times_ok |= c != '?';
-
-                if (p == pend)
-                  break;
-
-                PATFETCH (c);
-
-                if (c == '*'
-                    || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
-                  ;
-
-                else if (syntax & RE_BK_PLUS_QM  &&  c == '\\')
-                  {
-                    if (p == pend) return REG_EESCAPE;
-
-                    PATFETCH (c1);
-                    if (!(c1 == '+' || c1 == '?'))
-                      {
-                        PATUNFETCH;
-                        PATUNFETCH;
-                        break;
-                      }
-
-                    c = c1;
-                  }
-                else
-                  {
-                    PATUNFETCH;
-                    break;
-                  }
-
-                /* If we get here, we found another repeat character.  */
-               }
-
-            /* Star, etc. applied to an empty pattern is equivalent
-               to an empty pattern.  */
-            if (!laststart)  
-              break;
-
-            /* Now we know whether or not zero matches is allowed
-               and also whether or not two or more matches is allowed.  */
-            if (many_times_ok)
-              { /* More than one repetition is allowed, so put in at the
-                   end a backward relative jump from `b' to before the next
-                   jump we're going to put in below (which jumps from
-                   laststart to after this jump).  
-
-                   But if we are at the `*' in the exact sequence `.*\n',
-                   insert an unconditional jump backwards to the .,
-                   instead of the beginning of the loop.  This way we only
-                   push a failure point once, instead of every time
-                   through the loop.  */
-                assert (p - 1 > pattern);
-
-                /* Allocate the space for the jump.  */
-                GET_BUFFER_SPACE (3);
-
-                /* We know we are not at the first character of the pattern,
-                   because laststart was nonzero.  And we've already
-                   incremented `p', by the way, to be the character after
-                   the `*'.  Do we have to do something analogous here
-                   for null bytes, because of RE_DOT_NOT_NULL?  */
-                if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
-                   && zero_times_ok
-                    && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
-                    && !(syntax & RE_DOT_NEWLINE))
-                  { /* We have .*\n.  */
-                    STORE_JUMP (jump, b, laststart);
-                    keep_string_p = true;
-                  }
-                else
-                  /* Anything else.  */
-                  STORE_JUMP (maybe_pop_jump, b, laststart - 3);
-
-                /* We've added more stuff to the buffer.  */
-                b += 3;
-              }
-
-            /* On failure, jump from laststart to b + 3, which will be the
-               end of the buffer after this jump is inserted.  */
-            GET_BUFFER_SPACE (3);
-            INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
-                                       : on_failure_jump,
-                         laststart, b + 3);
-            pending_exact = 0;
-            b += 3;
-
-            if (!zero_times_ok)
-              {
-                /* At least one repetition is required, so insert a
-                   `dummy_failure_jump' before the initial
-                   `on_failure_jump' instruction of the loop. This
-                   effects a skip over that instruction the first time
-                   we hit that loop.  */
-                GET_BUFFER_SPACE (3);
-                INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
-                b += 3;
-              }
-            }
-         break;
+       case '?':
+           if ((syntax & RE_BK_PLUS_QM)
+               || (syntax & RE_LIMITED_OPS))
+               goto normal_char;
+         handle_plus:
+       case '*':
+           /* If there is no previous pattern... */
+           if (!laststart) {
+               if (syntax & RE_CONTEXT_INVALID_OPS)
+                   return REG_BADRPT;
+               else if (!(syntax & RE_CONTEXT_INDEP_OPS))
+                   goto normal_char;
+           } {
+               /* Are we optimizing this jump?  */
+               boolean keep_string_p = false;
+
+               /* 1 means zero (many) matches is allowed.  */
+               char zero_times_ok = 0, many_times_ok = 0;
+
+               /* If there is a sequence of repetition chars, collapse it
+                * down to just one (the right one).  We can't combine
+                * interval operators with these because of, e.g., `a{2}*',
+                * which should only match an even number of `a's.  */
+
+               for (;;) {
+                   zero_times_ok |= c != '+';
+                   many_times_ok |= c != '?';
+
+                   if (p == pend)
+                       break;
+
+                   PATFETCH(c);
+
+                   if (c == '*'
+                       || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')));
+
+                   else if (syntax & RE_BK_PLUS_QM && c == '\\') {
+                       if (p == pend)
+                           return REG_EESCAPE;
+
+                       PATFETCH(c1);
+                       if (!(c1 == '+' || c1 == '?')) {
+                           PATUNFETCH;
+                           PATUNFETCH;
+                           break;
+                       }
+                       c = c1;
+                   } else {
+                       PATUNFETCH;
+                       break;
+                   }
+
+                   /* If we get here, we found another repeat character.  */
+               }
+
+               /* Star, etc. applied to an empty pattern is equivalent
+                * to an empty pattern.  */
+               if (!laststart)
+                   break;
+
+               /* Now we know whether or not zero matches is allowed
+                * and also whether or not two or more matches is allowed.  */
+               if (many_times_ok) {    /* More than one repetition is allowed, so put in at the
+                                        * end a backward relative jump from `b' to before the next
+                                        * jump we're going to put in below (which jumps from
+                                        * laststart to after this jump).  
+                                        * 
+                                        * But if we are at the `*' in the exact sequence `.*\n',
+                                        * insert an unconditional jump backwards to the .,
+                                        * instead of the beginning of the loop.  This way we only
+                                        * push a failure point once, instead of every time
+                                        * through the loop.  */
+                   assert(p - 1 > pattern);
+
+                   /* Allocate the space for the jump.  */
+                   GET_BUFFER_SPACE(3);
+
+                   /* We know we are not at the first character of the pattern,
+                    * because laststart was nonzero.  And we've already
+                    * incremented `p', by the way, to be the character after
+                    * the `*'.  Do we have to do something analogous here
+                    * for null bytes, because of RE_DOT_NOT_NULL?  */
+                   if (TRANSLATE(*(p - 2)) == TRANSLATE('.')
+                       && zero_times_ok
+                       && p < pend && TRANSLATE(*p) == TRANSLATE('\n')
+                       && !(syntax & RE_DOT_NEWLINE)) {        /* We have .*\n.  */
+                       STORE_JUMP(jump, b, laststart);
+                       keep_string_p = true;
+                   } else
+                       /* Anything else.  */
+                       STORE_JUMP(maybe_pop_jump, b, laststart - 3);
+
+                   /* We've added more stuff to the buffer.  */
+                   b += 3;
+               }
+               /* On failure, jump from laststart to b + 3, which will be the
+                * end of the buffer after this jump is inserted.  */
+               GET_BUFFER_SPACE(3);
+               INSERT_JUMP(keep_string_p ? on_failure_keep_string_jump
+                   : on_failure_jump,
+                   laststart, b + 3);
+               pending_exact = 0;
+               b += 3;
+
+               if (!zero_times_ok) {
+                   /* At least one repetition is required, so insert a
+                    * `dummy_failure_jump' before the initial
+                    * `on_failure_jump' instruction of the loop. This
+                    * effects a skip over that instruction the first time
+                    * we hit that loop.  */
+                   GET_BUFFER_SPACE(3);
+                   INSERT_JUMP(dummy_failure_jump, laststart, laststart + 6);
+                   b += 3;
+               }
+           }
+           break;
 
 
        case '.':
-          laststart = b;
-          BUF_PUSH (anychar);
-          break;
-
-
-        case '[':
-          {
-            boolean had_char_class = false;
-
-            if (p == pend) return REG_EBRACK;
-
-            /* Ensure that we have enough space to push a charset: the
-               opcode, the length count, and the bitset; 34 bytes in all.  */
-           GET_BUFFER_SPACE (34);
-
-            laststart = b;
-
-            /* We test `*p == '^' twice, instead of using an if
-               statement, so we only need one BUF_PUSH.  */
-            BUF_PUSH (*p == '^' ? charset_not : charset); 
-            if (*p == '^')
-              p++;
-
-            /* Remember the first position in the bracket expression.  */
-            p1 = p;
-
-            /* Push the number of bytes in the bitmap.  */
-            BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
-
-            /* Clear the whole map.  */
-            bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
-
-            /* charset_not matches newline according to a syntax bit.  */
-            if ((re_opcode_t) b[-2] == charset_not
-                && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
-              SET_LIST_BIT ('\n');
-
-            /* Read in characters and ranges, setting map bits.  */
-            for (;;)
-              {
-                if (p == pend) return REG_EBRACK;
-
-                PATFETCH (c);
-
-                /* \ might escape characters inside [...] and [^...].  */
-                if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
-                  {
-                    if (p == pend) return REG_EESCAPE;
-
-                    PATFETCH (c1);
-                    SET_LIST_BIT (c1);
-                    continue;
-                  }
-
-                /* Could be the end of the bracket expression.  If it's
-                   not (i.e., when the bracket expression is `[]' so
-                   far), the ']' character bit gets set way below.  */
-                if (c == ']' && p != p1 + 1)
-                  break;
-
-                /* Look ahead to see if it's a range when the last thing
-                   was a character class.  */
-                if (had_char_class && c == '-' && *p != ']')
-                  return REG_ERANGE;
-
-                /* Look ahead to see if it's a range when the last thing
-                   was a character: if this is a hyphen not at the
-                   beginning or the end of a list, then it's the range
-                   operator.  */
-                if (c == '-' 
-                    && !(p - 2 >= pattern && p[-2] == '[') 
-                    && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
-                    && *p != ']')
-                  {
-                    reg_errcode_t ret
-                      = compile_range (&p, pend, translate, syntax, b);
-                    if (ret != REG_NOERROR) return ret;
-                  }
-
-                else if (p[0] == '-' && p[1] != ']')
-                  { /* This handles ranges made up of characters only.  */
-                    reg_errcode_t ret;
-
-                   /* Move past the `-'.  */
-                    PATFETCH (c1);
-                    
-                    ret = compile_range (&p, pend, translate, syntax, b);
-                    if (ret != REG_NOERROR) return ret;
-                  }
-
-                /* See if we're at the beginning of a possible character
-                   class.  */
-
-                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
-                  { /* Leave room for the null.  */
-                    char str[CHAR_CLASS_MAX_LENGTH + 1];
-
-                    PATFETCH (c);
-                    c1 = 0;
-
-                    /* If pattern is `[[:'.  */
-                    if (p == pend) return REG_EBRACK;
-
-                    for (;;)
-                      {
-                        PATFETCH (c);
-                        if (c == ':' || c == ']' || p == pend
-                            || c1 == CHAR_CLASS_MAX_LENGTH)
-                          break;
-                        str[c1++] = c;
-                      }
-                    str[c1] = '\0';
-
-                    /* If isn't a word bracketed by `[:' and:`]':
-                       undo the ending character, the letters, and leave 
-                       the leading `:' and `[' (but set bits for them).  */
-                    if (c == ':' && *p == ']')
-                      {
-                        int ch;
-                        boolean is_alnum = STREQ (str, "alnum");
-                        boolean is_alpha = STREQ (str, "alpha");
-                        boolean is_blank = STREQ (str, "blank");
-                        boolean is_cntrl = STREQ (str, "cntrl");
-                        boolean is_digit = STREQ (str, "digit");
-                        boolean is_graph = STREQ (str, "graph");
-                        boolean is_lower = STREQ (str, "lower");
-                        boolean is_print = STREQ (str, "print");
-                        boolean is_punct = STREQ (str, "punct");
-                        boolean is_space = STREQ (str, "space");
-                        boolean is_upper = STREQ (str, "upper");
-                        boolean is_xdigit = STREQ (str, "xdigit");
-                        
-                        if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
-
-                        /* Throw away the ] at the end of the character
-                           class.  */
-                        PATFETCH (c);                                  
-
-                        if (p == pend) return REG_EBRACK;
-
-                        for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
-                          {
-                            if (   (is_alnum  && ISALNUM (ch))
-                                || (is_alpha  && ISALPHA (ch))
-                                || (is_blank  && ISBLANK (ch))
-                                || (is_cntrl  && ISCNTRL (ch))
-                                || (is_digit  && ISDIGIT (ch))
-                                || (is_graph  && ISGRAPH (ch))
-                                || (is_lower  && ISLOWER (ch))
-                                || (is_print  && ISPRINT (ch))
-                                || (is_punct  && ISPUNCT (ch))
-                                || (is_space  && ISSPACE (ch))
-                                || (is_upper  && ISUPPER (ch))
-                                || (is_xdigit && ISXDIGIT (ch)))
-                            SET_LIST_BIT (ch);
-                          }
-                        had_char_class = true;
-                      }
-                    else
-                      {
-                        c1++;
-                        while (c1--)    
-                          PATUNFETCH;
-                        SET_LIST_BIT ('[');
-                        SET_LIST_BIT (':');
-                        had_char_class = false;
-                      }
-                  }
-                else
-                  {
-                    had_char_class = false;
-                    SET_LIST_BIT (c);
-                  }
-              }
-
-            /* Discard any (non)matching list bytes that are all 0 at the
-               end of the map.  Decrease the map-length byte too.  */
-            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) 
-              b[-1]--; 
-            b += b[-1];
-          }
-          break;
+           laststart = b;
+           BUF_PUSH(anychar);
+           break;
+
+
+       case '[':
+           {
+               boolean had_char_class = false;
+
+               if (p == pend)
+                   return REG_EBRACK;
+
+               /* Ensure that we have enough space to push a charset: the
+                * opcode, the length count, and the bitset; 34 bytes in all.  */
+               GET_BUFFER_SPACE(34);
+
+               laststart = b;
+
+               /* We test `*p == '^' twice, instead of using an if
+                * statement, so we only need one BUF_PUSH.  */
+               BUF_PUSH(*p == '^' ? charset_not : charset);
+               if (*p == '^')
+                   p++;
+
+               /* Remember the first position in the bracket expression.  */
+               p1 = p;
+
+               /* Push the number of bytes in the bitmap.  */
+               BUF_PUSH((1 << BYTEWIDTH) / BYTEWIDTH);
+
+               /* Clear the whole map.  */
+               bzero(b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+               /* charset_not matches newline according to a syntax bit.  */
+               if ((re_opcode_t) b[-2] == charset_not
+                   && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
+                   SET_LIST_BIT('\n');
+
+               /* Read in characters and ranges, setting map bits.  */
+               for (;;) {
+                   if (p == pend)
+                       return REG_EBRACK;
+
+                   PATFETCH(c);
+
+                   /* \ might escape characters inside [...] and [^...].  */
+                   if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') {
+                       if (p == pend)
+                           return REG_EESCAPE;
+
+                       PATFETCH(c1);
+                       SET_LIST_BIT(c1);
+                       continue;
+                   }
+                   /* Could be the end of the bracket expression.  If it's
+                    * not (i.e., when the bracket expression is `[]' so
+                    * far), the ']' character bit gets set way below.  */
+                   if (c == ']' && p != p1 + 1)
+                       break;
+
+                   /* Look ahead to see if it's a range when the last thing
+                    * was a character class.  */
+                   if (had_char_class && c == '-' && *p != ']')
+                       return REG_ERANGE;
+
+                   /* Look ahead to see if it's a range when the last thing
+                    * was a character: if this is a hyphen not at the
+                    * beginning or the end of a list, then it's the range
+                    * operator.  */
+                   if (c == '-'
+                       && !(p - 2 >= pattern && p[-2] == '[')
+                       && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
+                       && *p != ']') {
+                       reg_errcode_t ret
+                       = compile_range(&p, pend, translate, syntax, b);
+                       if (ret != REG_NOERROR)
+                           return ret;
+                   } else if (p[0] == '-' && p[1] != ']') {    /* This handles ranges made up of characters only.  */
+                       reg_errcode_t ret;
+
+                       /* Move past the `-'.  */
+                       PATFETCH(c1);
+
+                       ret = compile_range(&p, pend, translate, syntax, b);
+                       if (ret != REG_NOERROR)
+                           return ret;
+                   }
+                   /* See if we're at the beginning of a possible character
+                    * class.  */
+
+                   else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') {       /* Leave room for the null.  */
+                       char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+                       PATFETCH(c);
+                       c1 = 0;
+
+                       /* If pattern is `[[:'.  */
+                       if (p == pend)
+                           return REG_EBRACK;
+
+                       for (;;) {
+                           PATFETCH(c);
+                           if (c == ':' || c == ']' || p == pend
+                               || c1 == CHAR_CLASS_MAX_LENGTH)
+                               break;
+                           str[c1++] = c;
+                       }
+                       str[c1] = '\0';
+
+                       /* If isn't a word bracketed by `[:' and:`]':
+                        * undo the ending character, the letters, and leave 
+                        * the leading `:' and `[' (but set bits for them).  */
+                       if (c == ':' && *p == ']') {
+                           int ch;
+                           boolean is_alnum = STREQ(str, "alnum");
+                           boolean is_alpha = STREQ(str, "alpha");
+                           boolean is_blank = STREQ(str, "blank");
+                           boolean is_cntrl = STREQ(str, "cntrl");
+                           boolean is_digit = STREQ(str, "digit");
+                           boolean is_graph = STREQ(str, "graph");
+                           boolean is_lower = STREQ(str, "lower");
+                           boolean is_print = STREQ(str, "print");
+                           boolean is_punct = STREQ(str, "punct");
+                           boolean is_space = STREQ(str, "space");
+                           boolean is_upper = STREQ(str, "upper");
+                           boolean is_xdigit = STREQ(str, "xdigit");
+
+                           if (!IS_CHAR_CLASS(str))
+                               return REG_ECTYPE;
+
+                           /* Throw away the ] at the end of the character
+                            * class.  */
+                           PATFETCH(c);
+
+                           if (p == pend)
+                               return REG_EBRACK;
+
+                           for (ch = 0; ch < 1 << BYTEWIDTH; ch++) {
+                               if ((is_alnum && ISALNUM(ch))
+                                   || (is_alpha && ISALPHA(ch))
+                                   || (is_blank && ISBLANK(ch))
+                                   || (is_cntrl && ISCNTRL(ch))
+                                   || (is_digit && ISDIGIT(ch))
+                                   || (is_graph && ISGRAPH(ch))
+                                   || (is_lower && ISLOWER(ch))
+                                   || (is_print && ISPRINT(ch))
+                                   || (is_punct && ISPUNCT(ch))
+                                   || (is_space && ISSPACE(ch))
+                                   || (is_upper && ISUPPER(ch))
+                                   || (is_xdigit && ISXDIGIT(ch)))
+                                   SET_LIST_BIT(ch);
+                           }
+                           had_char_class = true;
+                       } else {
+                           c1++;
+                           while (c1--)
+                               PATUNFETCH;
+                           SET_LIST_BIT('[');
+                           SET_LIST_BIT(':');
+                           had_char_class = false;
+                       }
+                   } else {
+                       had_char_class = false;
+                       SET_LIST_BIT(c);
+                   }
+               }
+
+               /* Discard any (non)matching list bytes that are all 0 at the
+                * end of the map.  Decrease the map-length byte too.  */
+               while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+                   b[-1]--;
+               b += b[-1];
+           }
+           break;
 
 
        case '(':
-          if (syntax & RE_NO_BK_PARENS)
-            goto handle_open;
-          else
-            goto normal_char;
+           if (syntax & RE_NO_BK_PARENS)
+               goto handle_open;
+           else
+               goto normal_char;
 
 
-        case ')':
-          if (syntax & RE_NO_BK_PARENS)
-            goto handle_close;
-          else
-            goto normal_char;
+       case ')':
+           if (syntax & RE_NO_BK_PARENS)
+               goto handle_close;
+           else
+               goto normal_char;
 
 
-        case '\n':
-          if (syntax & RE_NEWLINE_ALT)
-            goto handle_alt;
-          else
-            goto normal_char;
+       case '\n':
+           if (syntax & RE_NEWLINE_ALT)
+               goto handle_alt;
+           else
+               goto normal_char;
 
 
        case '|':
-          if (syntax & RE_NO_BK_VBAR)
-            goto handle_alt;
-          else
-            goto normal_char;
-
-
-        case '{':
-           if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
-             goto handle_interval;
-           else
-             goto normal_char;
-
-
-        case '\\':
-          if (p == pend) return REG_EESCAPE;
-
-          /* Do not translate the character after the \, so that we can
-             distinguish, e.g., \B from \b, even if we normally would
-             translate, e.g., B to b.  */
-          PATFETCH_RAW (c);
-
-          switch (c)
-            {
-            case '(':
-              if (syntax & RE_NO_BK_PARENS)
-                goto normal_backslash;
-
-            handle_open:
-              bufp->re_nsub++;
-              regnum++;
-
-              if (COMPILE_STACK_FULL)
-                { 
-                  RETALLOC (compile_stack.stack, compile_stack.size << 1,
-                            compile_stack_elt_t);
-                  if (compile_stack.stack == NULL) return REG_ESPACE;
-
-                  compile_stack.size <<= 1;
-                }
-
-              /* These are the values to restore when we hit end of this
-                 group.  They are all relative offsets, so that if the
-                 whole pattern moves because of realloc, they will still
-                 be valid.  */
-              COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
-              COMPILE_STACK_TOP.fixup_alt_jump 
-                = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
-              COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
-              COMPILE_STACK_TOP.regnum = regnum;
-
-              /* We will eventually replace the 0 with the number of
-                 groups inner to this one.  But do not push a
-                 start_memory for groups beyond the last one we can
-                 represent in the compiled pattern.  */
-              if (regnum <= MAX_REGNUM)
-                {
-                  COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
-                  BUF_PUSH_3 (start_memory, regnum, 0);
-                }
-                
-              compile_stack.avail++;
-
-              fixup_alt_jump = 0;
-              laststart = 0;
-              begalt = b;
-             /* If we've reached MAX_REGNUM groups, then this open
-                won't actually generate any code, so we'll have to
-                clear pending_exact explicitly.  */
-             pending_exact = 0;
-              break;
-
-
-            case ')':
-              if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
-
-              if (COMPILE_STACK_EMPTY)
-                if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
-                  goto normal_backslash;
-                else
-                  return REG_ERPAREN;
-
-            handle_close:
-              if (fixup_alt_jump)
-                { /* Push a dummy failure point at the end of the
-                     alternative for a possible future
-                     `pop_failure_jump' to pop.  See comments at
-                     `push_dummy_failure' in `re_match_2'.  */
-                  BUF_PUSH (push_dummy_failure);
-                  
-                  /* We allocated space for this jump when we assigned
-                     to `fixup_alt_jump', in the `handle_alt' case below.  */
-                  STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
-                }
-
-              /* See similar code for backslashed left paren above.  */
-              if (COMPILE_STACK_EMPTY)
-                if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
-                  goto normal_char;
-                else
-                  return REG_ERPAREN;
-
-              /* Since we just checked for an empty stack above, this
-                 ``can't happen''.  */
-              assert (compile_stack.avail != 0);
-              {
-                /* We don't just want to restore into `regnum', because
-                   later groups should continue to be numbered higher,
-                   as in `(ab)c(de)' -- the second group is #2.  */
-                regnum_t this_group_regnum;
-
-                compile_stack.avail--;         
-                begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
-                fixup_alt_jump
-                  = COMPILE_STACK_TOP.fixup_alt_jump
-                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 
-                    : 0;
-                laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
-                this_group_regnum = COMPILE_STACK_TOP.regnum;
+           if (syntax & RE_NO_BK_VBAR)
+               goto handle_alt;
+           else
+               goto normal_char;
+
+
+       case '{':
+           if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
+               goto handle_interval;
+           else
+               goto normal_char;
+
+
+       case '\\':
+           if (p == pend)
+               return REG_EESCAPE;
+
+           /* Do not translate the character after the \, so that we can
+            * distinguish, e.g., \B from \b, even if we normally would
+            * translate, e.g., B to b.  */
+           PATFETCH_RAW(c);
+
+           switch (c) {
+           case '(':
+               if (syntax & RE_NO_BK_PARENS)
+                   goto normal_backslash;
+
+             handle_open:
+               bufp->re_nsub++;
+               regnum++;
+
+               if (COMPILE_STACK_FULL) {
+                   RETALLOC(compile_stack.stack, compile_stack.size << 1,
+                       compile_stack_elt_t);
+                   if (compile_stack.stack == NULL)
+                       return REG_ESPACE;
+
+                   compile_stack.size <<= 1;
+               }
+               /* These are the values to restore when we hit end of this
+                * group.  They are all relative offsets, so that if the
+                * whole pattern moves because of realloc, they will still
+                * be valid.  */
+               COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
+               COMPILE_STACK_TOP.fixup_alt_jump
+                   = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+               COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+               COMPILE_STACK_TOP.regnum = regnum;
+
+               /* We will eventually replace the 0 with the number of
+                * groups inner to this one.  But do not push a
+                * start_memory for groups beyond the last one we can
+                * represent in the compiled pattern.  */
+               if (regnum <= MAX_REGNUM) {
+                   COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+                   BUF_PUSH_3(start_memory, regnum, 0);
+               }
+               compile_stack.avail++;
+
+               fixup_alt_jump = 0;
+               laststart = 0;
+               begalt = b;
                /* If we've reached MAX_REGNUM groups, then this open
-                  won't actually generate any code, so we'll have to
-                  clear pending_exact explicitly.  */
+                * won't actually generate any code, so we'll have to
+                * clear pending_exact explicitly.  */
                pending_exact = 0;
+               break;
+
+
+           case ')':
+               if (syntax & RE_NO_BK_PARENS)
+                   goto normal_backslash;
+
+               if (COMPILE_STACK_EMPTY)
+                   if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+                       goto normal_backslash;
+                   else
+                       return REG_ERPAREN;
+
+             handle_close:
+               if (fixup_alt_jump) {   /* Push a dummy failure point at the end of the
+                                        * alternative for a possible future
+                                        * `pop_failure_jump' to pop.  See comments at
+                                        * `push_dummy_failure' in `re_match_2'.  */
+                   BUF_PUSH(push_dummy_failure);
+
+                   /* We allocated space for this jump when we assigned
+                    * to `fixup_alt_jump', in the `handle_alt' case below.  */
+                   STORE_JUMP(jump_past_alt, fixup_alt_jump, b - 1);
+               }
+               /* See similar code for backslashed left paren above.  */
+               if (COMPILE_STACK_EMPTY)
+                   if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+                       goto normal_char;
+                   else
+                       return REG_ERPAREN;
+
+               /* Since we just checked for an empty stack above, this
+                * ``can't happen''.  */
+               assert(compile_stack.avail != 0);
+               {
+                   /* We don't just want to restore into `regnum', because
+                    * later groups should continue to be numbered higher,
+                    * as in `(ab)c(de)' -- the second group is #2.  */
+                   regnum_t this_group_regnum;
+
+                   compile_stack.avail--;
+                   begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+                   fixup_alt_jump
+                       = COMPILE_STACK_TOP.fixup_alt_jump
+                       ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+                       : 0;
+                   laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+                   this_group_regnum = COMPILE_STACK_TOP.regnum;
+                   /* If we've reached MAX_REGNUM groups, then this open
+                    * won't actually generate any code, so we'll have to
+                    * clear pending_exact explicitly.  */
+                   pending_exact = 0;
+
+                   /* We're at the end of the group, so now we know how many
+                    * groups were inside this one.  */
+                   if (this_group_regnum <= MAX_REGNUM) {
+                       unsigned char *inner_group_loc
+                       = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+
+                       *inner_group_loc = regnum - this_group_regnum;
+                       BUF_PUSH_3(stop_memory, this_group_regnum,
+                           regnum - this_group_regnum);
+                   }
+               }
+               break;
+
+
+           case '|':           /* `\|'.  */
+               if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
+                   goto normal_backslash;
+             handle_alt:
+               if (syntax & RE_LIMITED_OPS)
+                   goto normal_char;
+
+               /* Insert before the previous alternative a jump which
+                * jumps to this alternative if the former fails.  */
+               GET_BUFFER_SPACE(3);
+               INSERT_JUMP(on_failure_jump, begalt, b + 6);
+               pending_exact = 0;
+               b += 3;
+
+               /* The alternative before this one has a jump after it
+                * which gets executed if it gets matched.  Adjust that
+                * jump so it will jump to this alternative's analogous
+                * jump (put in below, which in turn will jump to the next
+                * (if any) alternative's such jump, etc.).  The last such
+                * jump jumps to the correct final destination.  A picture:
+                * _____ _____ 
+                * |   | |   |   
+                * |   v |   v 
+                * a | b   | c   
+                * 
+                * If we are at `b', then fixup_alt_jump right now points to a
+                * three-byte space after `a'.  We'll put in the jump, set
+                * fixup_alt_jump to right after `b', and leave behind three
+                * bytes which we'll fill in when we get to after `c'.  */
+
+               if (fixup_alt_jump)
+                   STORE_JUMP(jump_past_alt, fixup_alt_jump, b);
+
+               /* Mark and leave space for a jump after this alternative,
+                * to be filled in later either by next alternative or
+                * when know we're at the end of a series of alternatives.  */
+               fixup_alt_jump = b;
+               GET_BUFFER_SPACE(3);
+               b += 3;
+
+               laststart = 0;
+               begalt = b;
+               break;
+
+
+           case '{':
+               /* If \{ is a literal.  */
+               if (!(syntax & RE_INTERVALS)
+               /* If we're at `\{' and it's not the open-interval 
+                * operator.  */
+                   || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+                   || (p - 2 == pattern && p == pend))
+                   goto normal_backslash;
+
+             handle_interval:
+               {
+                   /* If got here, then the syntax allows intervals.  */
+
+                   /* At least (most) this many matches must be made.  */
+                   int lower_bound = -1, upper_bound = -1;
+
+                   beg_interval = p - 1;
+
+                   if (p == pend) {
+                       if (syntax & RE_NO_BK_BRACES)
+                           goto unfetch_interval;
+                       else
+                           return REG_EBRACE;
+                   }
+                   GET_UNSIGNED_NUMBER(lower_bound);
+
+                   if (c == ',') {
+                       GET_UNSIGNED_NUMBER(upper_bound);
+                       if (upper_bound < 0)
+                           upper_bound = RE_DUP_MAX;
+                   } else
+                       /* Interval such as `{1}' => match exactly once. */
+                       upper_bound = lower_bound;
+
+                   if (lower_bound < 0 || upper_bound > RE_DUP_MAX
+                       || lower_bound > upper_bound) {
+                       if (syntax & RE_NO_BK_BRACES)
+                           goto unfetch_interval;
+                       else
+                           return REG_BADBR;
+                   }
+                   if (!(syntax & RE_NO_BK_BRACES)) {
+                       if (c != '\\')
+                           return REG_EBRACE;
+
+                       PATFETCH(c);
+                   }
+                   if (c != '}') {
+                       if (syntax & RE_NO_BK_BRACES)
+                           goto unfetch_interval;
+                       else
+                           return REG_BADBR;
+                   }
+                   /* We just parsed a valid interval.  */
+
+                   /* If it's invalid to have no preceding re.  */
+                   if (!laststart) {
+                       if (syntax & RE_CONTEXT_INVALID_OPS)
+                           return REG_BADRPT;
+                       else if (syntax & RE_CONTEXT_INDEP_OPS)
+                           laststart = b;
+                       else
+                           goto unfetch_interval;
+                   }
+                   /* If the upper bound is zero, don't want to succeed at
+                    * all; jump from `laststart' to `b + 3', which will be
+                    * the end of the buffer after we insert the jump.  */
+                   if (upper_bound == 0) {
+                       GET_BUFFER_SPACE(3);
+                       INSERT_JUMP(jump, laststart, b + 3);
+                       b += 3;
+                   }
+                   /* Otherwise, we have a nontrivial interval.  When
+                    * we're all done, the pattern will look like:
+                    * set_number_at <jump count> <upper bound>
+                    * set_number_at <succeed_n count> <lower bound>
+                    * succeed_n <after jump addr> <succed_n count>
+                    * <body of loop>
+                    * jump_n <succeed_n addr> <jump count>
+                    * (The upper bound and `jump_n' are omitted if
+                    * `upper_bound' is 1, though.)  */
+                   else {      /* If the upper bound is > 1, we need to insert
+                                * more at the end of the loop.  */
+                       unsigned nbytes = 10 + (upper_bound > 1) * 10;
+
+                       GET_BUFFER_SPACE(nbytes);
+
+                       /* Initialize lower bound of the `succeed_n', even
+                        * though it will be set during matching by its
+                        * attendant `set_number_at' (inserted next),
+                        * because `re_compile_fastmap' needs to know.
+                        * Jump to the `jump_n' we might insert below.  */
+                       INSERT_JUMP2(succeed_n, laststart,
+                           b + 5 + (upper_bound > 1) * 5,
+                           lower_bound);
+                       b += 5;
+
+                       /* Code to initialize the lower bound.  Insert 
+                        * before the `succeed_n'.  The `5' is the last two
+                        * bytes of this `set_number_at', plus 3 bytes of
+                        * the following `succeed_n'.  */
+                       insert_op2(set_number_at, laststart, 5, lower_bound, b);
+                       b += 5;
+
+                       if (upper_bound > 1) {  /* More than one repetition is allowed, so
+                                                * append a backward jump to the `succeed_n'
+                                                * that starts this interval.
+                                                * 
+                                                * When we've reached this during matching,
+                                                * we'll have matched the interval once, so
+                                                * jump back only `upper_bound - 1' times.  */
+                           STORE_JUMP2(jump_n, b, laststart + 5,
+                               upper_bound - 1);
+                           b += 5;
+
+                           /* The location we want to set is the second
+                            * parameter of the `jump_n'; that is `b-2' as
+                            * an absolute address.  `laststart' will be
+                            * the `set_number_at' we're about to insert;
+                            * `laststart+3' the number to set, the source
+                            * for the relative address.  But we are
+                            * inserting into the middle of the pattern --
+                            * so everything is getting moved up by 5.
+                            * Conclusion: (b - 2) - (laststart + 3) + 5,
+                            * i.e., b - laststart.
+                            * 
+                            * We insert this at the beginning of the loop
+                            * so that if we fail during matching, we'll
+                            * reinitialize the bounds.  */
+                           insert_op2(set_number_at, laststart, b - laststart,
+                               upper_bound - 1, b);
+                           b += 5;
+                       }
+                   }
+                   pending_exact = 0;
+                   beg_interval = NULL;
+               }
+               break;
+
+             unfetch_interval:
+               /* If an invalid interval, match the characters as literals.  */
+               assert(beg_interval);
+               p = beg_interval;
+               beg_interval = NULL;
 
-                /* We're at the end of the group, so now we know how many
-                   groups were inside this one.  */
-                if (this_group_regnum <= MAX_REGNUM)
-                  {
-                    unsigned char *inner_group_loc
-                      = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-                    
-                    *inner_group_loc = regnum - this_group_regnum;
-                    BUF_PUSH_3 (stop_memory, this_group_regnum,
-                                regnum - this_group_regnum);
-                  }
-              }
-              break;
-
-
-            case '|':                                  /* `\|'.  */
-              if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
-                goto normal_backslash;
-            handle_alt:
-              if (syntax & RE_LIMITED_OPS)
-                goto normal_char;
-
-              /* Insert before the previous alternative a jump which
-                 jumps to this alternative if the former fails.  */
-              GET_BUFFER_SPACE (3);
-              INSERT_JUMP (on_failure_jump, begalt, b + 6);
-              pending_exact = 0;
-              b += 3;
-
-              /* The alternative before this one has a jump after it
-                 which gets executed if it gets matched.  Adjust that
-                 jump so it will jump to this alternative's analogous
-                 jump (put in below, which in turn will jump to the next
-                 (if any) alternative's such jump, etc.).  The last such
-                 jump jumps to the correct final destination.  A picture:
-                          _____ _____ 
-                          |   | |   |   
-                          |   v |   v 
-                         a | b   | c   
-
-                 If we are at `b', then fixup_alt_jump right now points to a
-                 three-byte space after `a'.  We'll put in the jump, set
-                 fixup_alt_jump to right after `b', and leave behind three
-                 bytes which we'll fill in when we get to after `c'.  */
-
-              if (fixup_alt_jump)
-                STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
-              /* Mark and leave space for a jump after this alternative,
-                 to be filled in later either by next alternative or
-                 when know we're at the end of a series of alternatives.  */
-              fixup_alt_jump = b;
-              GET_BUFFER_SPACE (3);
-              b += 3;
-
-              laststart = 0;
-              begalt = b;
-              break;
-
-
-            case '{': 
-              /* If \{ is a literal.  */
-              if (!(syntax & RE_INTERVALS)
-                     /* If we're at `\{' and it's not the open-interval 
-                        operator.  */
-                  || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
-                  || (p - 2 == pattern  &&  p == pend))
-                goto normal_backslash;
-
-            handle_interval:
-              {
-                /* If got here, then the syntax allows intervals.  */
-
-                /* At least (most) this many matches must be made.  */
-                int lower_bound = -1, upper_bound = -1;
-
-                beg_interval = p - 1;
-
-                if (p == pend)
-                  {
-                    if (syntax & RE_NO_BK_BRACES)
-                      goto unfetch_interval;
-                    else
-                      return REG_EBRACE;
-                  }
-
-                GET_UNSIGNED_NUMBER (lower_bound);
-
-                if (c == ',')
-                  {
-                    GET_UNSIGNED_NUMBER (upper_bound);
-                    if (upper_bound < 0) upper_bound = RE_DUP_MAX;
-                  }
-                else
-                  /* Interval such as `{1}' => match exactly once. */
-                  upper_bound = lower_bound;
-
-                if (lower_bound < 0 || upper_bound > RE_DUP_MAX
-                    || lower_bound > upper_bound)
-                  {
-                    if (syntax & RE_NO_BK_BRACES)
-                      goto unfetch_interval;
-                    else 
-                      return REG_BADBR;
-                  }
-
-                if (!(syntax & RE_NO_BK_BRACES)) 
-                  {
-                    if (c != '\\') return REG_EBRACE;
-
-                    PATFETCH (c);
-                  }
-
-                if (c != '}')
-                  {
-                    if (syntax & RE_NO_BK_BRACES)
-                      goto unfetch_interval;
-                    else 
-                      return REG_BADBR;
-                  }
-
-                /* We just parsed a valid interval.  */
-
-                /* If it's invalid to have no preceding re.  */
-                if (!laststart)
-                  {
-                    if (syntax & RE_CONTEXT_INVALID_OPS)
-                      return REG_BADRPT;
-                    else if (syntax & RE_CONTEXT_INDEP_OPS)
-                      laststart = b;
-                    else
-                      goto unfetch_interval;
-                  }
-
-                /* If the upper bound is zero, don't want to succeed at
-                   all; jump from `laststart' to `b + 3', which will be
-                   the end of the buffer after we insert the jump.  */
-                 if (upper_bound == 0)
-                   {
-                     GET_BUFFER_SPACE (3);
-                     INSERT_JUMP (jump, laststart, b + 3);
-                     b += 3;
-                   }
-
-                 /* Otherwise, we have a nontrivial interval.  When
-                    we're all done, the pattern will look like:
-                      set_number_at <jump count> <upper bound>
-                      set_number_at <succeed_n count> <lower bound>
-                      succeed_n <after jump addr> <succed_n count>
-                      <body of loop>
-                      jump_n <succeed_n addr> <jump count>
-                    (The upper bound and `jump_n' are omitted if
-                    `upper_bound' is 1, though.)  */
-                 else 
-                   { /* If the upper bound is > 1, we need to insert
-                        more at the end of the loop.  */
-                     unsigned nbytes = 10 + (upper_bound > 1) * 10;
-
-                     GET_BUFFER_SPACE (nbytes);
-
-                     /* Initialize lower bound of the `succeed_n', even
-                        though it will be set during matching by its
-                        attendant `set_number_at' (inserted next),
-                        because `re_compile_fastmap' needs to know.
-                        Jump to the `jump_n' we might insert below.  */
-                     INSERT_JUMP2 (succeed_n, laststart,
-                                   b + 5 + (upper_bound > 1) * 5,
-                                   lower_bound);
-                     b += 5;
-
-                     /* Code to initialize the lower bound.  Insert 
-                        before the `succeed_n'.  The `5' is the last two
-                        bytes of this `set_number_at', plus 3 bytes of
-                        the following `succeed_n'.  */
-                     insert_op2 (set_number_at, laststart, 5, lower_bound, b);
-                     b += 5;
-
-                     if (upper_bound > 1)
-                       { /* More than one repetition is allowed, so
-                            append a backward jump to the `succeed_n'
-                            that starts this interval.
-                            
-                            When we've reached this during matching,
-                            we'll have matched the interval once, so
-                            jump back only `upper_bound - 1' times.  */
-                         STORE_JUMP2 (jump_n, b, laststart + 5,
-                                      upper_bound - 1);
-                         b += 5;
-
-                         /* The location we want to set is the second
-                            parameter of the `jump_n'; that is `b-2' as
-                            an absolute address.  `laststart' will be
-                            the `set_number_at' we're about to insert;
-                            `laststart+3' the number to set, the source
-                            for the relative address.  But we are
-                            inserting into the middle of the pattern --
-                            so everything is getting moved up by 5.
-                            Conclusion: (b - 2) - (laststart + 3) + 5,
-                            i.e., b - laststart.
-                            
-                            We insert this at the beginning of the loop
-                            so that if we fail during matching, we'll
-                            reinitialize the bounds.  */
-                         insert_op2 (set_number_at, laststart, b - laststart,
-                                     upper_bound - 1, b);
-                         b += 5;
-                       }
-                   }
-                pending_exact = 0;
-                beg_interval = NULL;
-              }
-              break;
-
-            unfetch_interval:
-              /* If an invalid interval, match the characters as literals.  */
-               assert (beg_interval);
-               p = beg_interval;
-               beg_interval = NULL;
-
-               /* normal_char and normal_backslash need `c'.  */
-               PATFETCH (c);   
-
-               if (!(syntax & RE_NO_BK_BRACES))
-                 {
-                   if (p > pattern  &&  p[-1] == '\\')
-                     goto normal_backslash;
-                 }
-               goto normal_char;
+               /* normal_char and normal_backslash need `c'.  */
+               PATFETCH(c);
+
+               if (!(syntax & RE_NO_BK_BRACES)) {
+                   if (p > pattern && p[-1] == '\\')
+                       goto normal_backslash;
+               }
+               goto normal_char;
 
 #ifdef emacs
-            /* There is no way to specify the before_dot and after_dot
-               operators.  rms says this is ok.  --karl  */
-            case '=':
-              BUF_PUSH (at_dot);
-              break;
-
-            case 's':  
-              laststart = b;
-              PATFETCH (c);
-              BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
-              break;
-
-            case 'S':
-              laststart = b;
-              PATFETCH (c);
-              BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
-              break;
+               /* There is no way to specify the before_dot and after_dot
+                * operators.  rms says this is ok.  --karl  */
+           case '=':
+               BUF_PUSH(at_dot);
+               break;
+
+           case 's':
+               laststart = b;
+               PATFETCH(c);
+               BUF_PUSH_2(syntaxspec, syntax_spec_code[c]);
+               break;
+
+           case 'S':
+               laststart = b;
+               PATFETCH(c);
+               BUF_PUSH_2(notsyntaxspec, syntax_spec_code[c]);
+               break;
 #endif /* emacs */
 
 
-            case 'w':
-              laststart = b;
-              BUF_PUSH (wordchar);
-              break;
+           case 'w':
+               laststart = b;
+               BUF_PUSH(wordchar);
+               break;
 
 
-            case 'W':
-              laststart = b;
-              BUF_PUSH (notwordchar);
-              break;
+           case 'W':
+               laststart = b;
+               BUF_PUSH(notwordchar);
+               break;
 
 
-            case '<':
-              BUF_PUSH (wordbeg);
-              break;
+           case '<':
+               BUF_PUSH(wordbeg);
+               break;
 
-            case '>':
-              BUF_PUSH (wordend);
-              break;
+           case '>':
+               BUF_PUSH(wordend);
+               break;
 
-            case 'b':
-              BUF_PUSH (wordbound);
-              break;
+           case 'b':
+               BUF_PUSH(wordbound);
+               break;
 
-            case 'B':
-              BUF_PUSH (notwordbound);
-              break;
+           case 'B':
+               BUF_PUSH(notwordbound);
+               break;
 
-            case '`':
-              BUF_PUSH (begbuf);
-              break;
+           case '`':
+               BUF_PUSH(begbuf);
+               break;
 
-            case '\'':
-              BUF_PUSH (endbuf);
-              break;
+           case '\'':
+               BUF_PUSH(endbuf);
+               break;
 
-            case '1': case '2': case '3': case '4': case '5':
-            case '6': case '7': case '8': case '9':
-              if (syntax & RE_NO_BK_REFS)
-                goto normal_char;
+           case '1':
+           case '2':
+           case '3':
+           case '4':
+           case '5':
+           case '6':
+           case '7':
+           case '8':
+           case '9':
+               if (syntax & RE_NO_BK_REFS)
+                   goto normal_char;
 
-              c1 = c - '0';
+               c1 = c - '0';
 
-              if (c1 > regnum)
-                return REG_ESUBREG;
+               if (c1 > regnum)
+                   return REG_ESUBREG;
 
-              /* Can't back reference to a subexpression if inside of it.  */
-              if (group_in_compile_stack (compile_stack, c1))
-                goto normal_char;
+               /* Can't back reference to a subexpression if inside of it.  */
+               if (group_in_compile_stack(compile_stack, c1))
+                   goto normal_char;
 
-              laststart = b;
-              BUF_PUSH_2 (duplicate, c1);
-              break;
+               laststart = b;
+               BUF_PUSH_2(duplicate, c1);
+               break;
 
 
-            case '+':
-            case '?':
-              if (syntax & RE_BK_PLUS_QM)
-                goto handle_plus;
-              else
-                goto normal_backslash;
+           case '+':
+           case '?':
+               if (syntax & RE_BK_PLUS_QM)
+                   goto handle_plus;
+               else
+                   goto normal_backslash;
 
-            default:
-            normal_backslash:
-              /* You might think it would be useful for \ to mean
-                 not to translate; but if we don't translate it
-                 it will never match anything.  */
-              c = TRANSLATE (c);
-              goto normal_char;
-            }
-          break;
+           default:
+             normal_backslash:
+               /* You might think it would be useful for \ to mean
+                * not to translate; but if we don't translate it
+                * it will never match anything.  */
+               c = TRANSLATE(c);
+               goto normal_char;
+           }
+           break;
 
 
        default:
-        /* Expects the character in `c'.  */
-       normal_char:
-             /* If no exactn currently being built.  */
-          if (!pending_exact 
-
-              /* If last exactn not at current position.  */
-              || pending_exact + *pending_exact + 1 != b
-              
-              /* We have only one byte following the exactn for the count.  */
-             || *pending_exact == (1 << BYTEWIDTH) - 1
-
-              /* If followed by a repetition operator.  */
-              || *p == '*' || *p == '^'
-             || ((syntax & RE_BK_PLUS_QM)
-                 ? *p == '\\' && (p[1] == '+' || p[1] == '?')
-                 : (*p == '+' || *p == '?'))
-             || ((syntax & RE_INTERVALS)
-                  && ((syntax & RE_NO_BK_BRACES)
-                     ? *p == '{'
-                      : (p[0] == '\\' && p[1] == '{'))))
-           {
-             /* Start building a new exactn.  */
-              
-              laststart = b;
-
-             BUF_PUSH_2 (exactn, 0);
-             pending_exact = b - 1;
-            }
-            
-         BUF_PUSH (c);
-          (*pending_exact)++;
-         break;
-        } /* switch (c) */
-    } /* while p != pend */
-
-  
-  /* Through the pattern now.  */
-  
-  if (fixup_alt_jump)
-    STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
-  if (!COMPILE_STACK_EMPTY) 
-    return REG_EPAREN;
-
-  free (compile_stack.stack);
-
-  /* We have succeeded; set the length of the buffer.  */
-  bufp->used = b - bufp->buffer;
+           /* Expects the character in `c'.  */
+         normal_char:
+           /* If no exactn currently being built.  */
+           if (!pending_exact
+
+           /* If last exactn not at current position.  */
+               || pending_exact + *pending_exact + 1 != b
+
+           /* We have only one byte following the exactn for the count.  */
+               || *pending_exact == (1 << BYTEWIDTH) - 1
+
+           /* If followed by a repetition operator.  */
+               || *p == '*' || *p == '^'
+               || ((syntax & RE_BK_PLUS_QM)
+                   ? *p == '\\' && (p[1] == '+' || p[1] == '?')
+                   : (*p == '+' || *p == '?'))
+               || ((syntax & RE_INTERVALS)
+                   && ((syntax & RE_NO_BK_BRACES)
+                       ? *p == '{'
+                       : (p[0] == '\\' && p[1] == '{')))) {
+               /* Start building a new exactn.  */
+
+               laststart = b;
+
+               BUF_PUSH_2(exactn, 0);
+               pending_exact = b - 1;
+           }
+           BUF_PUSH(c);
+           (*pending_exact)++;
+           break;
+       }                       /* switch (c) */
+    }                          /* while p != pend */
+
+
+    /* Through the pattern now.  */
+
+    if (fixup_alt_jump)
+       STORE_JUMP(jump_past_alt, fixup_alt_jump, b);
+
+    if (!COMPILE_STACK_EMPTY)
+       return REG_EPAREN;
+
+    free(compile_stack.stack);
+
+    /* We have succeeded; set the length of the buffer.  */
+    bufp->used = b - bufp->buffer;
 
 #ifdef DEBUG
-  if (debug)
-    {
-      DEBUG_PRINT1 ("\nCompiled pattern: ");
-      print_compiled_pattern (bufp);
+    if (debug) {
+       DEBUG_PRINT1("\nCompiled pattern: ");
+       print_compiled_pattern(bufp);
     }
 #endif /* DEBUG */
 
-  return REG_NOERROR;
-} /* regex_compile */
+    return REG_NOERROR;
+}                              /* regex_compile */
 \f
 /* Subroutines for `regex_compile'.  */
 
 /* Store OP at LOC followed by two-byte integer parameter ARG.  */
 
 static void
-store_op1 (op, loc, arg)
-    re_opcode_t op;
-    unsigned char *loc;
-    int arg;
+store_op1(op, loc, arg)
+     re_opcode_t op;
+     unsigned char *loc;
+     int arg;
 {
-  *loc = (unsigned char) op;
-  STORE_NUMBER (loc + 1, arg);
+    *loc = (unsigned char) op;
+    STORE_NUMBER(loc + 1, arg);
 }
 
 
 /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2.  */
 
 static void
-store_op2 (op, loc, arg1, arg2)
-    re_opcode_t op;
-    unsigned char *loc;
-    int arg1, arg2;
+store_op2(op, loc, arg1, arg2)
+     re_opcode_t op;
+     unsigned char *loc;
+     int arg1, arg2;
 {
-  *loc = (unsigned char) op;
-  STORE_NUMBER (loc + 1, arg1);
-  STORE_NUMBER (loc + 3, arg2);
+    *loc = (unsigned char) op;
+    STORE_NUMBER(loc + 1, arg1);
+    STORE_NUMBER(loc + 3, arg2);
 }
 
 
 /* Copy the bytes from LOC to END to open up three bytes of space at LOC
  for OP followed by two-byte integer parameter ARG.  */
* for OP followed by two-byte integer parameter ARG.  */
 
 static void
-insert_op1 (op, loc, arg, end)
-    re_opcode_t op;
-    unsigned char *loc;
-    int arg;
-    unsigned char *end;    
+insert_op1(op, loc, arg, end)
+     re_opcode_t op;
+     unsigned char *loc;
+     int arg;
+     unsigned char *end;
 {
-  register unsigned char *pfrom = end;
-  register unsigned char *pto = end + 3;
+    register unsigned char *pfrom = end;
+    register unsigned char *pto = end + 3;
+
+    while (pfrom != loc)
+       *--pto = *--pfrom;
 
-  while (pfrom != loc)
-    *--pto = *--pfrom;
-    
-  store_op1 (op, loc, arg);
+    store_op1(op, loc, arg);
 }
 
 
 /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2.  */
 
 static void
-insert_op2 (op, loc, arg1, arg2, end)
-    re_opcode_t op;
-    unsigned char *loc;
-    int arg1, arg2;
-    unsigned char *end;    
+insert_op2(op, loc, arg1, arg2, end)
+     re_opcode_t op;
+     unsigned char *loc;
+     int arg1, arg2;
+     unsigned char *end;
 {
-  register unsigned char *pfrom = end;
-  register unsigned char *pto = end + 5;
+    register unsigned char *pfrom = end;
+    register unsigned char *pto = end + 5;
 
-  while (pfrom != loc)
-    *--pto = *--pfrom;
-    
-  store_op2 (op, loc, arg1, arg2);
+    while (pfrom != loc)
+       *--pto = *--pfrom;
+
+    store_op2(op, loc, arg1, arg2);
 }
 
 
 /* P points to just after a ^ in PATTERN.  Return true if that ^ comes
  after an alternative or a begin-subexpression.  We assume there is at
  least one character before the ^.  */
* after an alternative or a begin-subexpression.  We assume there is at
* least one character before the ^.  */
 
 static boolean
-at_begline_loc_p (pattern, p, syntax)
-    const char *pattern, *p;
-    reg_syntax_t syntax;
+at_begline_loc_p(pattern, p, syntax)
+     const char *pattern, *p;
+     reg_syntax_t syntax;
 {
-  const char *prev = p - 2;
-  boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-  
-  return
-       /* After a subexpression?  */
-       (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
-       /* After an alternative?  */
-    || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+    const char *prev = p - 2;
+    boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
+
+    return
+    /* After a subexpression?  */
+       (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
+    /* After an alternative?  */
+       || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
 }
 
 
 /* The dual of at_begline_loc_p.  This one is for $.  We assume there is
  at least one character after the $, i.e., `P < PEND'.  */
* at least one character after the $, i.e., `P < PEND'.  */
 
 static boolean
-at_endline_loc_p (p, pend, syntax)
-    const char *p, *pend;
-    int syntax;
+at_endline_loc_p(p, pend, syntax)
+     const char *p, *pend;
+     int syntax;
 {
-  const char *next = p;
-  boolean next_backslash = *next == '\\';
-  const char *next_next = p + 1 < pend ? p + 1 : NULL;
-  
-  return
-       /* Before a subexpression?  */
-       (syntax & RE_NO_BK_PARENS ? *next == ')'
-        : next_backslash && next_next && *next_next == ')')
-       /* Before an alternative?  */
-    || (syntax & RE_NO_BK_VBAR ? *next == '|'
-        : next_backslash && next_next && *next_next == '|');
+    const char *next = p;
+    boolean next_backslash = *next == '\\';
+    const char *next_next = p + 1 < pend ? p + 1 : NULL;
+
+    return
+    /* Before a subexpression?  */
+       (syntax & RE_NO_BK_PARENS ? *next == ')'
+       : next_backslash && next_next && *next_next == ')')
+    /* Before an alternative?  */
+       || (syntax & RE_NO_BK_VBAR ? *next == '|'
+       : next_backslash && next_next && *next_next == '|');
 }
 
 
 /* Returns true if REGNUM is in one of COMPILE_STACK's elements and 
  false if it's not.  */
* false if it's not.  */
 
 static boolean
-group_in_compile_stack (compile_stack, regnum)
-    compile_stack_type compile_stack;
-    regnum_t regnum;
+group_in_compile_stack(compile_stack, regnum)
+     compile_stack_type compile_stack;
+     regnum_t regnum;
 {
-  int this_element;
+    int this_element;
 
-  for (this_element = compile_stack.avail - 1;  
-       this_element >= 0; 
-       this_element--)
-    if (compile_stack.stack[this_element].regnum == regnum)
-      return true;
+    for (this_element = compile_stack.avail - 1;
+       this_element >= 0;
+       this_element--)
+       if (compile_stack.stack[this_element].regnum == regnum)
+           return true;
 
-  return false;
+    return false;
 }
 
 
 /* Read the ending character of a range (in a bracket expression) from the
  uncompiled pattern *P_PTR (which ends at PEND).  We assume the
  starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
  Then we set the translation of all bits between the starting and
  ending characters (inclusive) in the compiled pattern B.
-   
  Return an error code.
-   
  We use these short variable names so we can use the same macros as
  `regex_compile' itself.  */
* uncompiled pattern *P_PTR (which ends at PEND).  We assume the
* starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
* Then we set the translation of all bits between the starting and
* ending characters (inclusive) in the compiled pattern B.
+ * 
* Return an error code.
+ * 
* We use these short variable names so we can use the same macros as
* `regex_compile' itself.  */
 
 static reg_errcode_t
-compile_range (p_ptr, pend, translate, syntax, b)
-    const char **p_ptr, *pend;
-    char *translate;
-    reg_syntax_t syntax;
-    unsigned char *b;
+compile_range(p_ptr, pend, translate, syntax, b)
+     const char **p_ptr, *pend;
+     char *translate;
+     reg_syntax_t syntax;
+     unsigned char *b;
 {
-  unsigned this_char;
-
-  const char *p = *p_ptr;
-  int range_start, range_end;
-  
-  if (p == pend)
-    return REG_ERANGE;
-
-  /* Even though the pattern is a signed `char *', we need to fetch
-     with unsigned char *'s; if the high bit of the pattern character
-     is set, the range endpoints will be negative if we fetch using a
-     signed char *.
-
-     We also want to fetch the endpoints without translating them; the 
-     appropriate translation is done in the bit-setting loop below.  */
-  range_start = ((unsigned char *) p)[-2];
-  range_end   = ((unsigned char *) p)[0];
-
-  /* Have to increment the pointer into the pattern string, so the
-     caller isn't still at the ending character.  */
-  (*p_ptr)++;
-
-  /* If the start is after the end, the range is empty.  */
-  if (range_start > range_end)
-    return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
-
-  /* Here we see why `this_char' has to be larger than an `unsigned
-     char' -- the range is inclusive, so if `range_end' == 0xff
-     (assuming 8-bit characters), we would otherwise go into an infinite
-     loop, since all characters <= 0xff.  */
-  for (this_char = range_start; this_char <= range_end; this_char++)
-    {
-      SET_LIST_BIT (TRANSLATE (this_char));
+    unsigned this_char;
+
+    const char *p = *p_ptr;
+    int range_start, range_end;
+
+    if (p == pend)
+       return REG_ERANGE;
+
+    /* Even though the pattern is a signed `char *', we need to fetch
+     * with unsigned char *'s; if the high bit of the pattern character
+     * is set, the range endpoints will be negative if we fetch using a
+     * signed char *.
+     * 
+     * We also want to fetch the endpoints without translating them; the 
+     * appropriate translation is done in the bit-setting loop below.  */
+    range_start = ((unsigned char *) p)[-2];
+    range_end = ((unsigned char *) p)[0];
+
+    /* Have to increment the pointer into the pattern string, so the
+     * caller isn't still at the ending character.  */
+    (*p_ptr)++;
+
+    /* If the start is after the end, the range is empty.  */
+    if (range_start > range_end)
+       return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+
+    /* Here we see why `this_char' has to be larger than an `unsigned
+     * char' -- the range is inclusive, so if `range_end' == 0xff
+     * (assuming 8-bit characters), we would otherwise go into an infinite
+     * loop, since all characters <= 0xff.  */
+    for (this_char = range_start; this_char <= range_end; this_char++) {
+       SET_LIST_BIT(TRANSLATE(this_char));
     }
-  
-  return REG_NOERROR;
+
+    return REG_NOERROR;
 }
 \f
 /* Failure stack declarations and macros; both re_compile_fastmap and
  re_match_2 use a failure stack.  These have to be macros because of
  REGEX_ALLOCATE.  */
-   
* re_match_2 use a failure stack.  These have to be macros because of
* REGEX_ALLOCATE.  */
+
 
 /* Number of failure points for which to initially allocate space
  when matching.  If this number is exceeded, we allocate more
  space, so it is not a hard limit.  */
* when matching.  If this number is exceeded, we allocate more
* space, so it is not a hard limit.  */
 #ifndef INIT_FAILURE_ALLOC
 #define INIT_FAILURE_ALLOC 5
 #endif
 
 /* Roughly the maximum number of failure points on the stack.  Would be
  exactly that if always used MAX_FAILURE_SPACE each time we failed.
  This is a variable only so users of regex can assign to it; we never
  change it ourselves.  */
* exactly that if always used MAX_FAILURE_SPACE each time we failed.
* This is a variable only so users of regex can assign to it; we never
* change it ourselves.  */
 int re_max_failures = 2000;
 
 typedef const unsigned char *fail_stack_elt_t;
 
-typedef struct
-{
-  fail_stack_elt_t *stack;
-  unsigned size;
-  unsigned avail;                      /* Offset of next open position.  */
+typedef struct {
+    fail_stack_elt_t *stack;
+    unsigned size;
+    unsigned avail;            /* Offset of next open position.  */
 } fail_stack_type;
 
 #define FAIL_STACK_EMPTY()     (fail_stack.avail == 0)
@@ -2289,11 +2224,11 @@ typedef struct
 
 
 /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
-
  Return 1 if succeeds, and 0 if either ran out of memory
  allocating space for it or it was already too large.  
-   
  REGEX_REALLOCATE requires `destination' be declared.   */
+ * 
* Return 1 if succeeds, and 0 if either ran out of memory
* allocating space for it or it was already too large.  
+ * 
* REGEX_REALLOCATE requires `destination' be declared.   */
 
 #define DOUBLE_FAIL_STACK(fail_stack)                                  \
   ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS             \
@@ -2310,9 +2245,9 @@ typedef struct
 
 
 /* Push PATTERN_OP on FAIL_STACK. 
-
  Return 1 if was able to do so and 0 if ran out of memory allocating
  space to do so.  */
+ * 
* Return 1 if was able to do so and 0 if ran out of memory allocating
* space to do so.  */
 #define PUSH_PATTERN_OP(pattern_op, fail_stack)                                \
   ((FAIL_STACK_FULL ()                                                 \
     && !DOUBLE_FAIL_STACK (fail_stack))                                        \
@@ -2321,8 +2256,8 @@ typedef struct
        1))
 
 /* This pushes an item onto the failure stack.  Must be a four-byte
  value.  Assumes the variable `fail_stack'.  Probably should only
  be called from within `PUSH_FAILURE_POINT'.  */
* value.  Assumes the variable `fail_stack'.  Probably should only
* be called from within `PUSH_FAILURE_POINT'.  */
 #define PUSH_FAILURE_ITEM(item)                                                \
   fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item
 
@@ -2340,13 +2275,13 @@ typedef struct
 
 
 /* Push the information about the state we will need
  if we ever fail back to it.  
-   
  Requires variables fail_stack, regstart, regend, reg_info, and
  num_regs be declared.  DOUBLE_FAIL_STACK requires `destination' be
  declared.
-   
  Does `return FAILURE_CODE' if runs out of memory.  */
* if we ever fail back to it.  
+ * 
* Requires variables fail_stack, regstart, regend, reg_info, and
* num_regs be declared.  DOUBLE_FAIL_STACK requires `destination' be
* declared.
+ * 
* Does `return FAILURE_CODE' if runs out of memory.  */
 
 #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)  \
   do {                                                                 \
@@ -2423,12 +2358,12 @@ typedef struct
   } while (0)
 
 /* This is the number of items that are pushed and popped on the stack
  for each register.  */
* for each register.  */
 #define NUM_REG_ITEMS  3
 
 /* Individual items aside from the registers.  */
 #ifdef DEBUG
-#define NUM_NONREG_ITEMS 5 /* Includes failure point id.  */
+#define NUM_NONREG_ITEMS 5     /* Includes failure point id.  */
 #else
 #define NUM_NONREG_ITEMS 4
 #endif
@@ -2446,16 +2381,16 @@ typedef struct
 
 
 /* Pops what PUSH_FAIL_STACK pushes.
-
  We restore into the parameters, all of which should be lvalues:
    STR -- the saved data position.
    PAT -- the saved pattern position.
    LOW_REG, HIGH_REG -- the highest and lowest active registers.
    REGSTART, REGEND -- arrays of string positions.
    REG_INFO -- array of information about each subexpression.
-   
  Also assumes the variables `fail_stack' and (if debugging), `bufp',
  `pend', `string1', `size1', `string2', and `size2'.  */
+ * 
* We restore into the parameters, all of which should be lvalues:
* STR -- the saved data position.
* PAT -- the saved pattern position.
* LOW_REG, HIGH_REG -- the highest and lowest active registers.
* REGSTART, REGEND -- arrays of string positions.
* REG_INFO -- array of information about each subexpression.
+ * 
* Also assumes the variables `fail_stack' and (if debugging), `bufp',
* `pend', `string1', `size1', `string2', and `size2'.  */
 
 #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
 {                                                                      \
@@ -2512,368 +2447,357 @@ typedef struct
     }                                                                  \
                                                                        \
   DEBUG_STATEMENT (nfailure_points_popped++);                          \
-} /* POP_FAILURE_POINT */
+}                              /* POP_FAILURE_POINT */
 \f
 /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
  BUFP.  A fastmap records which of the (1 << BYTEWIDTH) possible
  characters can start a string that matches the pattern.  This fastmap
  is used by re_search to skip quickly over impossible starting points.
-
  The caller must supply the address of a (1 << BYTEWIDTH)-byte data
  area as BUFP->fastmap.
-   
  We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
  the pattern buffer.
-
  Returns 0 if we succeed, -2 if an internal error.   */
* BUFP.  A fastmap records which of the (1 << BYTEWIDTH) possible
* characters can start a string that matches the pattern.  This fastmap
* is used by re_search to skip quickly over impossible starting points.
+ * 
* The caller must supply the address of a (1 << BYTEWIDTH)-byte data
* area as BUFP->fastmap.
+ * 
* We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
* the pattern buffer.
+ * 
* Returns 0 if we succeed, -2 if an internal error.   */
 
 int
-re_compile_fastmap (bufp)
+re_compile_fastmap(bufp)
      struct re_pattern_buffer *bufp;
 {
-  int j, k;
-  fail_stack_type fail_stack;
+    int j, k;
+    fail_stack_type fail_stack;
 #ifndef REGEX_MALLOC
-  char *destination;
+    char *destination;
 #endif
-  /* We don't push any register information onto the failure stack.  */
-  unsigned num_regs = 0;
-  
-  register char *fastmap = bufp->fastmap;
-  unsigned char *pattern = bufp->buffer;
-  unsigned long size = bufp->used;
-  const unsigned char *p = pattern;
-  register unsigned char *pend = pattern + size;
-
-  /* Assume that each path through the pattern can be null until
-     proven otherwise.  We set this false at the bottom of switch
-     statement, to which we get only if a particular path doesn't
-     match the empty string.  */
-  boolean path_can_be_null = true;
-
-  /* We aren't doing a `succeed_n' to begin with.  */
-  boolean succeed_n_p = false;
-
-  assert (fastmap != NULL && p != NULL);
-  
-  INIT_FAIL_STACK ();
-  bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
-  bufp->fastmap_accurate = 1;      /* It will be when we're done.  */
-  bufp->can_be_null = 0;
-      
-  while (p != pend || !FAIL_STACK_EMPTY ())
-    {
-      if (p == pend)
-        {
-          bufp->can_be_null |= path_can_be_null;
-          
-          /* Reset for next path.  */
-          path_can_be_null = true;
-          
-          p = fail_stack.stack[--fail_stack.avail];
+    /* We don't push any register information onto the failure stack.  */
+    unsigned num_regs = 0;
+
+    register char *fastmap = bufp->fastmap;
+    unsigned char *pattern = bufp->buffer;
+    unsigned long size = bufp->used;
+    const unsigned char *p = pattern;
+    register unsigned char *pend = pattern + size;
+
+    /* Assume that each path through the pattern can be null until
+     * proven otherwise.  We set this false at the bottom of switch
+     * statement, to which we get only if a particular path doesn't
+     * match the empty string.  */
+    boolean path_can_be_null = true;
+
+    /* We aren't doing a `succeed_n' to begin with.  */
+    boolean succeed_n_p = false;
+
+    assert(fastmap != NULL && p != NULL);
+
+    INIT_FAIL_STACK();
+    bzero(fastmap, 1 << BYTEWIDTH);    /* Assume nothing's valid.  */
+    bufp->fastmap_accurate = 1;        /* It will be when we're done.  */
+    bufp->can_be_null = 0;
+
+    while (p != pend || !FAIL_STACK_EMPTY()) {
+       if (p == pend) {
+           bufp->can_be_null |= path_can_be_null;
+
+           /* Reset for next path.  */
+           path_can_be_null = true;
+
+           p = fail_stack.stack[--fail_stack.avail];
        }
+       /* We should never be about to go beyond the end of the pattern.  */
+       assert(p < pend);
 
-      /* We should never be about to go beyond the end of the pattern.  */
-      assert (p < pend);
-      
 #ifdef SWITCH_ENUM_BUG
-      switch ((int) ((re_opcode_t) *p++))
+       switch ((int) ((re_opcode_t) * p++))
 #else
-      switch ((re_opcode_t) *p++)
+       switch ((re_opcode_t) * p++)
 #endif
        {
 
-        /* I guess the idea here is to simply not bother with a fastmap
-           if a backreference is used, since it's too hard to figure out
-           the fastmap for the corresponding group.  Setting
-           `can_be_null' stops `re_search_2' from using the fastmap, so
-           that is all we do.  */
+           /* I guess the idea here is to simply not bother with a fastmap
+            * if a backreference is used, since it's too hard to figure out
+            * the fastmap for the corresponding group.  Setting
+            * `can_be_null' stops `re_search_2' from using the fastmap, so
+            * that is all we do.  */
        case duplicate:
-         bufp->can_be_null = 1;
-          return 0;
+           bufp->can_be_null = 1;
+           return 0;
 
 
-      /* Following are the cases which match a character.  These end
-         with `break'.  */
+           /* Following are the cases which match a character.  These end
+            * with `break'.  */
 
        case exactn:
-          fastmap[p[1]] = 1;
-         break;
+           fastmap[p[1]] = 1;
+           break;
 
 
-        case charset:
-          for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
-           if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
-              fastmap[j] = 1;
-         break;
+       case charset:
+           for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+               if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
+                   fastmap[j] = 1;
+           break;
 
 
        case charset_not:
-         /* Chars beyond end of map must be allowed.  */
-         for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
-            fastmap[j] = 1;
+           /* Chars beyond end of map must be allowed.  */
+           for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+               fastmap[j] = 1;
 
-         for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
-           if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
-              fastmap[j] = 1;
-          break;
+           for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+               if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
+                   fastmap[j] = 1;
+           break;
 
 
        case wordchar:
-         for (j = 0; j < (1 << BYTEWIDTH); j++)
-           if (SYNTAX (j) == Sword)
-             fastmap[j] = 1;
-         break;
+           for (j = 0; j < (1 << BYTEWIDTH); j++)
+               if (SYNTAX(j) == Sword)
+                   fastmap[j] = 1;
+           break;
 
 
        case notwordchar:
-         for (j = 0; j < (1 << BYTEWIDTH); j++)
-           if (SYNTAX (j) != Sword)
-             fastmap[j] = 1;
-         break;
+           for (j = 0; j < (1 << BYTEWIDTH); j++)
+               if (SYNTAX(j) != Sword)
+                   fastmap[j] = 1;
+           break;
 
 
-        case anychar:
-          /* `.' matches anything ...  */
-         for (j = 0; j < (1 << BYTEWIDTH); j++)
-            fastmap[j] = 1;
+       case anychar:
+           /* `.' matches anything ...  */
+           for (j = 0; j < (1 << BYTEWIDTH); j++)
+               fastmap[j] = 1;
 
-          /* ... except perhaps newline.  */
-          if (!(bufp->syntax & RE_DOT_NEWLINE))
-            fastmap['\n'] = 0;
+           /* ... except perhaps newline.  */
+           if (!(bufp->syntax & RE_DOT_NEWLINE))
+               fastmap['\n'] = 0;
 
-          /* Return if we have already set `can_be_null'; if we have,
-             then the fastmap is irrelevant.  Something's wrong here.  */
-         else if (bufp->can_be_null)
-           return 0;
+           /* Return if we have already set `can_be_null'; if we have,
+            * then the fastmap is irrelevant.  Something's wrong here.  */
+           else if (bufp->can_be_null)
+               return 0;
 
-          /* Otherwise, have to check alternative paths.  */
-         break;
+           /* Otherwise, have to check alternative paths.  */
+           break;
 
 
 #ifdef emacs
-        case syntaxspec:
-         k = *p++;
-         for (j = 0; j < (1 << BYTEWIDTH); j++)
-           if (SYNTAX (j) == (enum syntaxcode) k)
-             fastmap[j] = 1;
-         break;
+       case syntaxspec:
+           k = *p++;
+           for (j = 0; j < (1 << BYTEWIDTH); j++)
+               if (SYNTAX(j) == (enum syntaxcode) k)
+                   fastmap[j] = 1;
+           break;
 
 
        case notsyntaxspec:
-         k = *p++;
-         for (j = 0; j < (1 << BYTEWIDTH); j++)
-           if (SYNTAX (j) != (enum syntaxcode) k)
-             fastmap[j] = 1;
-         break;
+           k = *p++;
+           for (j = 0; j < (1 << BYTEWIDTH); j++)
+               if (SYNTAX(j) != (enum syntaxcode) k)
+                   fastmap[j] = 1;
+           break;
 
 
-      /* All cases after this match the empty string.  These end with
-         `continue'.  */
+           /* All cases after this match the empty string.  These end with
+            * `continue'.  */
 
 
        case before_dot:
        case at_dot:
        case after_dot:
-          continue;
+           continue;
 #endif /* not emacs */
 
 
-        case no_op:
-        case begline:
-        case endline:
+       case no_op:
+       case begline:
+       case endline:
        case begbuf:
        case endbuf:
        case wordbound:
        case notwordbound:
        case wordbeg:
        case wordend:
-        case push_dummy_failure:
-          continue;
+       case push_dummy_failure:
+           continue;
 
 
        case jump_n:
-        case pop_failure_jump:
+       case pop_failure_jump:
        case maybe_pop_jump:
        case jump:
-        case jump_past_alt:
+       case jump_past_alt:
        case dummy_failure_jump:
-          EXTRACT_NUMBER_AND_INCR (j, p);
-         p += j;       
-         if (j > 0)
-           continue;
-            
-          /* Jump backward implies we just went through the body of a
-             loop and matched nothing.  Opcode jumped to should be
-             `on_failure_jump' or `succeed_n'.  Just treat it like an
-             ordinary jump.  For a * loop, it has pushed its failure
-             point already; if so, discard that as redundant.  */
-          if ((re_opcode_t) *p != on_failure_jump
-             && (re_opcode_t) *p != succeed_n)
+           EXTRACT_NUMBER_AND_INCR(j, p);
+           p += j;
+           if (j > 0)
+               continue;
+
+           /* Jump backward implies we just went through the body of a
+            * loop and matched nothing.  Opcode jumped to should be
+            * `on_failure_jump' or `succeed_n'.  Just treat it like an
+            * ordinary jump.  For a * loop, it has pushed its failure
+            * point already; if so, discard that as redundant.  */
+           if ((re_opcode_t) * p != on_failure_jump
+               && (re_opcode_t) * p != succeed_n)
+               continue;
+
+           p++;
+           EXTRACT_NUMBER_AND_INCR(j, p);
+           p += j;
+
+           /* If what's on the stack is where we are now, pop it.  */
+           if (!FAIL_STACK_EMPTY()
+               && fail_stack.stack[fail_stack.avail - 1] == p)
+               fail_stack.avail--;
+
            continue;
 
-          p++;
-          EXTRACT_NUMBER_AND_INCR (j, p);
-          p += j;              
-         
-          /* If what's on the stack is where we are now, pop it.  */
-          if (!FAIL_STACK_EMPTY () 
-             && fail_stack.stack[fail_stack.avail - 1] == p)
-            fail_stack.avail--;
-
-          continue;
-
-
-        case on_failure_jump:
-        case on_failure_keep_string_jump:
-       handle_on_failure_jump:
-          EXTRACT_NUMBER_AND_INCR (j, p);
-
-          /* For some patterns, e.g., `(a?)?', `p+j' here points to the
-             end of the pattern.  We don't want to push such a point,
-             since when we restore it above, entering the switch will
-             increment `p' past the end of the pattern.  We don't need
-             to push such a point since we obviously won't find any more
-             fastmap entries beyond `pend'.  Such a pattern can match
-             the null string, though.  */
-          if (p + j < pend)
-            {
-              if (!PUSH_PATTERN_OP (p + j, fail_stack))
-                return -2;
-            }
-          else
-            bufp->can_be_null = 1;
-
-          if (succeed_n_p)
-            {
-              EXTRACT_NUMBER_AND_INCR (k, p);  /* Skip the n.  */
-              succeed_n_p = false;
-           }
 
-          continue;
+       case on_failure_jump:
+       case on_failure_keep_string_jump:
+         handle_on_failure_jump:
+           EXTRACT_NUMBER_AND_INCR(j, p);
+
+           /* For some patterns, e.g., `(a?)?', `p+j' here points to the
+            * end of the pattern.  We don't want to push such a point,
+            * since when we restore it above, entering the switch will
+            * increment `p' past the end of the pattern.  We don't need
+            * to push such a point since we obviously won't find any more
+            * fastmap entries beyond `pend'.  Such a pattern can match
+            * the null string, though.  */
+           if (p + j < pend) {
+               if (!PUSH_PATTERN_OP(p + j, fail_stack))
+                   return -2;
+           } else
+               bufp->can_be_null = 1;
+
+           if (succeed_n_p) {
+               EXTRACT_NUMBER_AND_INCR(k, p);  /* Skip the n.  */
+               succeed_n_p = false;
+           }
+           continue;
 
 
        case succeed_n:
-          /* Get to the number of times to succeed.  */
-          p += 2;              
-
-          /* Increment p past the n for when k != 0.  */
-          EXTRACT_NUMBER_AND_INCR (k, p);
-          if (k == 0)
-           {
-              p -= 4;
-             succeed_n_p = true;  /* Spaghetti code alert.  */
-              goto handle_on_failure_jump;
-            }
-          continue;
+           /* Get to the number of times to succeed.  */
+           p += 2;
+
+           /* Increment p past the n for when k != 0.  */
+           EXTRACT_NUMBER_AND_INCR(k, p);
+           if (k == 0) {
+               p -= 4;
+               succeed_n_p = true;     /* Spaghetti code alert.  */
+               goto handle_on_failure_jump;
+           }
+           continue;
 
 
        case set_number_at:
-          p += 4;
-          continue;
+           p += 4;
+           continue;
 
 
        case start_memory:
-        case stop_memory:
-         p += 2;
-         continue;
+       case stop_memory:
+           p += 2;
+           continue;
 
 
        default:
-          abort (); /* We have listed all the cases.  */
-        } /* switch *p++ */
-
-      /* Getting here means we have found the possible starting
-         characters for one path of the pattern -- and that the empty
-         string does not match.  We need not follow this path further.
-         Instead, look at the next alternative (remembered on the
-         stack), or quit if no more.  The test at the top of the loop
-         does these things.  */
-      path_can_be_null = false;
-      p = pend;
-    } /* while p */
-
-  /* Set `can_be_null' for the last path (also the first path, if the
-     pattern is empty).  */
-  bufp->can_be_null |= path_can_be_null;
-  return 0;
-} /* re_compile_fastmap */
+           abort();            /* We have listed all the cases.  */
+       }                       /* switch *p++ */
+
+       /* Getting here means we have found the possible starting
+        * characters for one path of the pattern -- and that the empty
+        * string does not match.  We need not follow this path further.
+        * Instead, look at the next alternative (remembered on the
+        * stack), or quit if no more.  The test at the top of the loop
+        * does these things.  */
+       path_can_be_null = false;
+       p = pend;
+    }                          /* while p */
+
+    /* Set `can_be_null' for the last path (also the first path, if the
+     pattern is empty).  */
+    bufp->can_be_null |= path_can_be_null;
+    return 0;
+}                              /* re_compile_fastmap */
 \f
 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
  ENDS.  Subsequent matches using PATTERN_BUFFER and REGS will use
  this memory for recording register information.  STARTS and ENDS
  must be allocated using the malloc library routine, and must each
  be at least NUM_REGS * sizeof (regoff_t) bytes long.
-
  If NUM_REGS == 0, then subsequent matches should allocate their own
  register data.
-
  Unless this function is called, the first search or match using
  PATTERN_BUFFER will allocate its own register data, without
  freeing the old data.  */
* ENDS.  Subsequent matches using PATTERN_BUFFER and REGS will use
* this memory for recording register information.  STARTS and ENDS
* must be allocated using the malloc library routine, and must each
* be at least NUM_REGS * sizeof (regoff_t) bytes long.
+ * 
* If NUM_REGS == 0, then subsequent matches should allocate their own
* register data.
+ * 
* Unless this function is called, the first search or match using
* PATTERN_BUFFER will allocate its own register data, without
* freeing the old data.  */
 
 void
-re_set_registers (bufp, regs, num_regs, starts, ends)
-    struct re_pattern_buffer *bufp;
-    struct re_registers *regs;
-    unsigned num_regs;
-    regoff_t *starts, *ends;
+re_set_registers(bufp, regs, num_regs, starts, ends)
+     struct re_pattern_buffer *bufp;
+     struct re_registers *regs;
+     unsigned num_regs;
+     regoff_t *starts, *ends;
 {
-  if (num_regs)
-    {
-      bufp->regs_allocated = REGS_REALLOCATE;
-      regs->num_regs = num_regs;
-      regs->start = starts;
-      regs->end = ends;
-    }
-  else
-    {
-      bufp->regs_allocated = REGS_UNALLOCATED;
-      regs->num_regs = 0;
-      regs->start = regs->end = (regoff_t) 0;
+    if (num_regs) {
+       bufp->regs_allocated = REGS_REALLOCATE;
+       regs->num_regs = num_regs;
+       regs->start = starts;
+       regs->end = ends;
+    } else {
+       bufp->regs_allocated = REGS_UNALLOCATED;
+       regs->num_regs = 0;
+       regs->start = regs->end = (regoff_t) 0;
     }
 }
 \f
 /* Searching routines.  */
 
 /* Like re_search_2, below, but only one string is specified, and
  doesn't let you say where to stop matching. */
* doesn't let you say where to stop matching. */
 
 int
-re_search (bufp, string, size, startpos, range, regs)
+re_search(bufp, string, size, startpos, range, regs)
      struct re_pattern_buffer *bufp;
      const char *string;
      int size, startpos, range;
      struct re_registers *regs;
 {
-  return re_search_2 (bufp, NULL, 0, string, size, startpos, range, 
-                     regs, size);
+    return re_search_2(bufp, NULL, 0, string, size, startpos, range,
+       regs, size);
 }
 
 
 /* Using the compiled pattern in BUFP->buffer, first tries to match the
  virtual concatenation of STRING1 and STRING2, starting first at index
  STARTPOS, then at STARTPOS + 1, and so on.
-   
  STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-   
  RANGE is how far to scan while trying to match.  RANGE = 0 means try
  only at STARTPOS; in general, the last start tried is STARTPOS +
  RANGE.
-   
  In REGS, return the indices of the virtual concatenation of STRING1
  and STRING2 that matched the entire BUFP->buffer and its contained
  subexpressions.
-   
  Do not consider matching one past the index STOP in the virtual
  concatenation of STRING1 and STRING2.
-
  We return either the position in the strings at which the match was
  found, -1 if no match, or -2 if error (such as failure
  stack overflow).  */
* virtual concatenation of STRING1 and STRING2, starting first at index
* STARTPOS, then at STARTPOS + 1, and so on.
+ * 
* STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
+ * 
* RANGE is how far to scan while trying to match.  RANGE = 0 means try
* only at STARTPOS; in general, the last start tried is STARTPOS +
* RANGE.
+ * 
* In REGS, return the indices of the virtual concatenation of STRING1
* and STRING2 that matched the entire BUFP->buffer and its contained
* subexpressions.
+ * 
* Do not consider matching one past the index STOP in the virtual
* concatenation of STRING1 and STRING2.
+ * 
* We return either the position in the strings at which the match was
* found, -1 if no match, or -2 if error (such as failure
* stack overflow).  */
 
 int
-re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
+re_search_2(bufp, string1, size1, string2, size2, startpos, range, regs, stop)
      struct re_pattern_buffer *bufp;
      const char *string1, *string2;
      int size1, size2;
@@ -2882,143 +2806,129 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
      struct re_registers *regs;
      int stop;
 {
-  int val;
-  register char *fastmap = bufp->fastmap;
-  register char *translate = bufp->translate;
-  int total_size = size1 + size2;
-  int endpos = startpos + range;
-
-  /* Check for out-of-range STARTPOS.  */
-  if (startpos < 0 || startpos > total_size)
-    return -1;
-    
-  /* Fix up RANGE if it might eventually take us outside
-     the virtual concatenation of STRING1 and STRING2.  */
-  if (endpos < -1)
-    range = -1 - startpos;
-  else if (endpos > total_size)
-    range = total_size - startpos;
-
-  /* If the search isn't to be a backwards one, don't waste time in a
-     search for a pattern that must be anchored.  */
-  if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
-    {
-      if (startpos > 0)
+    int val;
+    register char *fastmap = bufp->fastmap;
+    register char *translate = bufp->translate;
+    int total_size = size1 + size2;
+    int endpos = startpos + range;
+
+    /* Check for out-of-range STARTPOS.  */
+    if (startpos < 0 || startpos > total_size)
        return -1;
-      else
-       range = 1;
-    }
 
-  /* Update the fastmap now if not correct already.  */
-  if (fastmap && !bufp->fastmap_accurate)
-    if (re_compile_fastmap (bufp) == -2)
-      return -2;
-  
-  /* Loop through the string, looking for a place to start matching.  */
-  for (;;)
-    { 
-      /* If a fastmap is supplied, skip quickly over characters that
-         cannot be the start of a match.  If the pattern can match the
-         null string, however, we don't need to skip characters; we want
-         the first null string.  */
-      if (fastmap && startpos < total_size && !bufp->can_be_null)
-       {
-         if (range > 0)        /* Searching forwards.  */
-           {
-             register const char *d;
-             register int lim = 0;
-             int irange = range;
-
-              if (startpos < size1 && startpos + range >= size1)
-                lim = range - (size1 - startpos);
-
-             d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-   
-              /* Written out as an if-else to avoid testing `translate'
-                 inside the loop.  */
-             if (translate)
-                while (range > lim
-                       && !fastmap[(unsigned char)
-                                  translate[(unsigned char) *d++]])
-                  range--;
-             else
-                while (range > lim && !fastmap[(unsigned char) *d++])
-                  range--;
-
-             startpos += irange - range;
-           }
-         else                          /* Searching backwards.  */
-           {
-             register char c = (size1 == 0 || startpos >= size1
-                                 ? string2[startpos - size1] 
-                                 : string1[startpos]);
-
-             if (!fastmap[(unsigned char) TRANSLATE (c)])
-               goto advance;
+    /* Fix up RANGE if it might eventually take us outside
+     * the virtual concatenation of STRING1 and STRING2.  */
+    if (endpos < -1)
+       range = -1 - startpos;
+    else if (endpos > total_size)
+       range = total_size - startpos;
+
+    /* If the search isn't to be a backwards one, don't waste time in a
+     * search for a pattern that must be anchored.  */
+    if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) {
+       if (startpos > 0)
+           return -1;
+       else
+           range = 1;
+    }
+    /* Update the fastmap now if not correct already.  */
+    if (fastmap && !bufp->fastmap_accurate)
+       if (re_compile_fastmap(bufp) == -2)
+           return -2;
+
+    /* Loop through the string, looking for a place to start matching.  */
+    for (;;) {
+       /* If a fastmap is supplied, skip quickly over characters that
+        * cannot be the start of a match.  If the pattern can match the
+        * null string, however, we don't need to skip characters; we want
+        * the first null string.  */
+       if (fastmap && startpos < total_size && !bufp->can_be_null) {
+           if (range > 0) {    /* Searching forwards.  */
+               register const char *d;
+               register int lim = 0;
+               int irange = range;
+
+               if (startpos < size1 && startpos + range >= size1)
+                   lim = range - (size1 - startpos);
+
+               d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
+
+               /* Written out as an if-else to avoid testing `translate'
+                * inside the loop.  */
+               if (translate)
+                   while (range > lim
+                       && !fastmap[(unsigned char)
+                           translate[(unsigned char) *d++]])
+                       range--;
+               else
+                   while (range > lim && !fastmap[(unsigned char) *d++])
+                       range--;
+
+               startpos += irange - range;
+           } else {            /* Searching backwards.  */
+               register char c = (size1 == 0 || startpos >= size1
+                   ? string2[startpos - size1]
+                   : string1[startpos]);
+
+               if (!fastmap[(unsigned char) TRANSLATE(c)])
+                   goto advance;
            }
        }
+       /* If can't match the null string, and that's all we have left, fail.  */
+       if (range >= 0 && startpos == total_size && fastmap
+           && !bufp->can_be_null)
+           return -1;
 
-      /* If can't match the null string, and that's all we have left, fail.  */
-      if (range >= 0 && startpos == total_size && fastmap
-          && !bufp->can_be_null)
-       return -1;
+       val = re_match_2(bufp, string1, size1, string2, size2,
+           startpos, regs, stop);
+       if (val >= 0)
+           return startpos;
+
+       if (val == -2)
+           return -2;
 
-      val = re_match_2 (bufp, string1, size1, string2, size2,
-                       startpos, regs, stop);
-      if (val >= 0)
-       return startpos;
-        
-      if (val == -2)
-       return -2;
-
-    advance:
-      if (!range) 
-        break;
-      else if (range > 0) 
-        {
-          range--; 
-          startpos++;
-        }
-      else
-        {
-          range++; 
-          startpos--;
-        }
+      advance:
+       if (!range)
+           break;
+       else if (range > 0) {
+           range--;
+           startpos++;
+       } else {
+           range++;
+           startpos--;
+       }
     }
-  return -1;
-} /* re_search_2 */
+    return -1;
+}                              /* re_search_2 */
 \f
 /* Declarations and macros for re_match_2.  */
 
-static int bcmp_translate ();
-static boolean alt_match_null_string_p (),
-               common_op_match_null_string_p (),
-               group_match_null_string_p ();
+static int bcmp_translate();
+static boolean alt_match_null_string_p(), common_op_match_null_string_p(),
+        group_match_null_string_p();
 
 /* Structure for per-register (a.k.a. per-group) information.
-   This must not be longer than one word, because we push this value
-   onto the failure stack.  Other register information, such as the
-   starting and ending positions (which are addresses), and the list of
-   inner groups (which is a bits list) are maintained in separate
-   variables.  
-   
-   We are making a (strictly speaking) nonportable assumption here: that
-   the compiler will pack our bit fields into something that fits into
-   the type of `word', i.e., is something that fits into one item on the
-   failure stack.  */
-typedef union
-{
-  fail_stack_elt_t word;
-  struct
-  {
-      /* This field is one if this group can match the empty string,
-         zero if not.  If not yet determined,  `MATCH_NULL_UNSET_VALUE'.  */
+ * This must not be longer than one word, because we push this value
+ * onto the failure stack.  Other register information, such as the
+ * starting and ending positions (which are addresses), and the list of
+ * inner groups (which is a bits list) are maintained in separate
+ * variables.  
+ * 
+ * We are making a (strictly speaking) nonportable assumption here: that
+ * the compiler will pack our bit fields into something that fits into
+ * the type of `word', i.e., is something that fits into one item on the
+ * failure stack.  */
+typedef union {
+    fail_stack_elt_t word;
+    struct {
+       /* This field is one if this group can match the empty string,
+        * zero if not.  If not yet determined,  `MATCH_NULL_UNSET_VALUE'.  */
 #define MATCH_NULL_UNSET_VALUE 3
-    unsigned match_null_string_p : 2;
-    unsigned is_active : 1;
-    unsigned matched_something : 1;
-    unsigned ever_matched_something : 1;
-  } bits;
+       unsigned match_null_string_p:2;
+       unsigned is_active:1;
+       unsigned matched_something:1;
+       unsigned ever_matched_something:1;
+    } bits;
 } register_info_type;
 
 #define REG_MATCH_NULL_STRING_P(R)  ((R).bits.match_null_string_p)
@@ -3028,8 +2938,8 @@ typedef union
 
 
 /* Call this when have matched a real character; it sets `matched' flags
  for the subexpressions which we are currently inside.  Also records
  that those subexprs have matched.  */
* for the subexpressions which we are currently inside.  Also records
* that those subexprs have matched.  */
 #define SET_REGS_MATCHED()                                             \
   do                                                                   \
     {                                                                  \
@@ -3045,7 +2955,7 @@ typedef union
 
 
 /* This converts PTR, a pointer into one of the search strings `string1'
  and `string2' into an offset from the beginning of that string.  */
* and `string2' into an offset from the beginning of that string.  */
 #define POINTER_TO_OFFSET(ptr)                                         \
   (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
 
@@ -3059,7 +2969,7 @@ typedef union
 #define MATCHING_IN_FIRST_STRING  (dend == end_match_1)
 
 /* Call before fetching a character with *d.  This switches over to
  string2 if necessary.  */
* string2 if necessary.  */
 #define PREFETCH()                                                     \
   while (d == dend)                                                    \
     {                                                                  \
@@ -3073,22 +2983,22 @@ typedef union
 
 
 /* Test if at very beginning or at very end of the virtual concatenation
  of `string1' and `string2'.  If only one string, it's `string2'.  */
* of `string1' and `string2'.  If only one string, it's `string2'.  */
 #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)        
+#define AT_STRINGS_END(d) ((d) == end2)
 
 
 /* Test if D points to a character which is word-constituent.  We have
  two special cases to check for: if past the end of string1, look at
  the first character in string2; and if before the beginning of
  string2, look at the last character in string1.  */
* two special cases to check for: if past the end of string1, look at
* the first character in string2; and if before the beginning of
* string2, look at the last character in string1.  */
 #define WORDCHAR_P(d)                                                  \
   (SYNTAX ((d) == end1 ? *string2                                      \
            : (d) == string2 - 1 ? *(end1 - 1) : *(d))                  \
    == Sword)
 
 /* Test if the character before D and the one at D differ with respect
  to being word-constituent.  */
* to being word-constituent.  */
 #define AT_WORD_BOUNDARY(d)                                            \
   (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)                            \
    || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
@@ -3117,47 +3027,47 @@ typedef union
 
 
 /* These values must meet several constraints.  They must not be valid
  register values; since we have a limit of 255 registers (because
  we use only one byte in the pattern for the register number), we can
  use numbers larger than 255.  They must differ by 1, because of
  NUM_FAILURE_ITEMS above.  And the value for the lowest register must
  be larger than the value for the highest register, so we do not try
  to actually save any registers when none are active.  */
* register values; since we have a limit of 255 registers (because
* we use only one byte in the pattern for the register number), we can
* use numbers larger than 255.  They must differ by 1, because of
* NUM_FAILURE_ITEMS above.  And the value for the lowest register must
* be larger than the value for the highest register, so we do not try
* to actually save any registers when none are active.  */
 #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
 #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
 \f
 /* Matching routines.  */
 
-#ifndef emacs   /* Emacs never uses this.  */
+#ifndef emacs                  /* Emacs never uses this.  */
 /* re_match is like re_match_2 except it takes only a single string.  */
 
 int
-re_match (bufp, string, size, pos, regs)
+re_match(bufp, string, size, pos, regs)
      struct re_pattern_buffer *bufp;
      const char *string;
      int size, pos;
      struct re_registers *regs;
- {
-  return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size); 
+{
+    return re_match_2(bufp, NULL, 0, string, size, pos, regs, size);
 }
 #endif /* not emacs */
 
 
 /* re_match_2 matches the compiled pattern in BUFP against the
  the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
  and SIZE2, respectively).  We start matching at POS, and stop
  matching at STOP.
-   
  If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
  store offsets for the substring each group matched in REGS.  See the
  documentation for exactly how many groups we fill.
-
  We return -1 if no match, -2 if an internal error (such as the
  failure stack overflowing).  Otherwise, we return the length of the
  matched substring.  */
* the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
* and SIZE2, respectively).  We start matching at POS, and stop
* matching at STOP.
+ * 
* If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
* store offsets for the substring each group matched in REGS.  See the
* documentation for exactly how many groups we fill.
+ * 
* We return -1 if no match, -2 if an internal error (such as the
* failure stack overflowing).  Otherwise, we return the length of the
* matched substring.  */
 
 int
-re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop)
      struct re_pattern_buffer *bufp;
      const char *string1, *string2;
      int size1, size2;
@@ -3165,1351 +3075,1270 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
      struct re_registers *regs;
      int stop;
 {
-  /* General temporaries.  */
-  int mcnt;
-  unsigned char *p1;
-
-  /* Just past the end of the corresponding string.  */
-  const char *end1, *end2;
-
-  /* Pointers into string1 and string2, just past the last characters in
-     each to consider matching.  */
-  const char *end_match_1, *end_match_2;
-
-  /* Where we are in the data, and the end of the current string.  */
-  const char *d, *dend;
-  
-  /* Where we are in the pattern, and the end of the pattern.  */
-  unsigned char *p = bufp->buffer;
-  register unsigned char *pend = p + bufp->used;
-
-  /* We use this to map every character in the string.  */
-  char *translate = bufp->translate;
-
-  /* Failure point stack.  Each place that can handle a failure further
-     down the line pushes a failure point on this stack.  It consists of
-     restart, regend, and reg_info for all registers corresponding to
-     the subexpressions we're currently inside, plus the number of such
-     registers, and, finally, two char *'s.  The first char * is where
-     to resume scanning the pattern; the second one is where to resume
-     scanning the strings.  If the latter is zero, the failure point is
-     a ``dummy''; if a failure happens and the failure point is a dummy,
-     it gets discarded and the next next one is tried.  */
-  fail_stack_type fail_stack;
+    /* General temporaries.  */
+    int mcnt;
+    unsigned char *p1;
+
+    /* Just past the end of the corresponding string.  */
+    const char *end1, *end2;
+
+    /* Pointers into string1 and string2, just past the last characters in
+     each to consider matching.  */
+    const char *end_match_1, *end_match_2;
+
+    /* Where we are in the data, and the end of the current string.  */
+    const char *d, *dend;
+
+    /* Where we are in the pattern, and the end of the pattern.  */
+    unsigned char *p = bufp->buffer;
+    register unsigned char *pend = p + bufp->used;
+
+    /* We use this to map every character in the string.  */
+    char *translate = bufp->translate;
+
+    /* Failure point stack.  Each place that can handle a failure further
+     down the line pushes a failure point on this stack.  It consists of
+     restart, regend, and reg_info for all registers corresponding to
+     the subexpressions we're currently inside, plus the number of such
+     registers, and, finally, two char *'s.  The first char * is where
+     to resume scanning the pattern; the second one is where to resume
+     scanning the strings.  If the latter is zero, the failure point is
+     a ``dummy''; if a failure happens and the failure point is a dummy,
+     it gets discarded and the next next one is tried.  */
+    fail_stack_type fail_stack;
 #ifdef DEBUG
-  static unsigned failure_id = 0;
-  unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
+    static unsigned failure_id = 0;
+    unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
 #endif
 
-  /* We fill all the registers internally, independent of what we
-     return, for use in backreferences.  The number here includes
-     an element for register zero.  */
-  unsigned num_regs = bufp->re_nsub + 1;
-  
-  /* The currently active registers.  */
-  unsigned long lowest_active_reg = NO_LOWEST_ACTIVE_REG;
-  unsigned long highest_active_reg = NO_HIGHEST_ACTIVE_REG;
-
-  /* Information on the contents of registers. These are pointers into
-     the input strings; they record just what was matched (on this
-     attempt) by a subexpression part of the pattern, that is, the
-     regnum-th regstart pointer points to where in the pattern we began
-     matching and the regnum-th regend points to right after where we
-     stopped matching the regnum-th subexpression.  (The zeroth register
-     keeps track of what the whole pattern matches.)  */
-  const char **regstart = NULL, **regend = NULL;
-
-  /* If a group that's operated upon by a repetition operator fails to
-     match anything, then the register for its start will need to be
-     restored because it will have been set to wherever in the string we
-     are when we last see its open-group operator.  Similarly for a
-     register's end.  */
-  const char **old_regstart = NULL, **old_regend = NULL;
-
-  /* The is_active field of reg_info helps us keep track of which (possibly
-     nested) subexpressions we are currently in. The matched_something
-     field of reg_info[reg_num] helps us tell whether or not we have
-     matched any of the pattern so far this time through the reg_num-th
-     subexpression.  These two fields get reset each time through any
-     loop their register is in.  */
-  register_info_type *reg_info = NULL; 
-
-  /* The following record the register info as found in the above
-     variables when we find a match better than any we've seen before. 
-     This happens as we backtrack through the failure points, which in
-     turn happens only if we have not yet matched the entire string. */
-  unsigned best_regs_set = false;
-  const char **best_regstart = NULL, **best_regend = NULL;
-  
-  /* Logically, this is `best_regend[0]'.  But we don't want to have to
-     allocate space for that if we're not allocating space for anything
-     else (see below).  Also, we never need info about register 0 for
-     any of the other register vectors, and it seems rather a kludge to
-     treat `best_regend' differently than the rest.  So we keep track of
-     the end of the best match so far in a separate variable.  We
-     initialize this to NULL so that when we backtrack the first time
-     and need to test it, it's not garbage.  */
-  const char *match_end = NULL;
-
-  /* Used when we pop values we don't care about.  */
-  const char **reg_dummy = NULL;
-  register_info_type *reg_info_dummy = NULL;
+    /* We fill all the registers internally, independent of what we
+     return, for use in backreferences.  The number here includes
+     an element for register zero.  */
+    unsigned num_regs = bufp->re_nsub + 1;
+
+    /* The currently active registers.  */
+    unsigned long lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+    unsigned long highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+    /* Information on the contents of registers. These are pointers into
+     the input strings; they record just what was matched (on this
+     attempt) by a subexpression part of the pattern, that is, the
+     regnum-th regstart pointer points to where in the pattern we began
+     matching and the regnum-th regend points to right after where we
+     stopped matching the regnum-th subexpression.  (The zeroth register
+     keeps track of what the whole pattern matches.)  */
+    const char **regstart = NULL, **regend = NULL;
+
+    /* If a group that's operated upon by a repetition operator fails to
+     match anything, then the register for its start will need to be
+     restored because it will have been set to wherever in the string we
+     are when we last see its open-group operator.  Similarly for a
+     register's end.  */
+    const char **old_regstart = NULL, **old_regend = NULL;
+
+    /* The is_active field of reg_info helps us keep track of which (possibly
+     nested) subexpressions we are currently in. The matched_something
+     field of reg_info[reg_num] helps us tell whether or not we have
+     matched any of the pattern so far this time through the reg_num-th
+     subexpression.  These two fields get reset each time through any
+     loop their register is in.  */
+    register_info_type *reg_info = NULL;
+
+    /* The following record the register info as found in the above
+     variables when we find a match better than any we've seen before. 
+     This happens as we backtrack through the failure points, which in
+     turn happens only if we have not yet matched the entire string. */
+    unsigned best_regs_set = false;
+    const char **best_regstart = NULL, **best_regend = NULL;
+
+    /* Logically, this is `best_regend[0]'.  But we don't want to have to
+     allocate space for that if we're not allocating space for anything
+     else (see below).  Also, we never need info about register 0 for
+     any of the other register vectors, and it seems rather a kludge to
+     treat `best_regend' differently than the rest.  So we keep track of
+     the end of the best match so far in a separate variable.  We
+     initialize this to NULL so that when we backtrack the first time
+     and need to test it, it's not garbage.  */
+    const char *match_end = NULL;
+
+    /* Used when we pop values we don't care about.  */
+    const char **reg_dummy = NULL;
+    register_info_type *reg_info_dummy = NULL;
 
 #ifdef DEBUG
-  /* Counts the total number of registers pushed.  */
-  unsigned num_regs_pushed = 0;        
+    /* Counts the total number of registers pushed.  */
+    unsigned num_regs_pushed = 0;
 #endif
 
-  DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-  
-  INIT_FAIL_STACK ();
-  
-  /* Do not bother to initialize all the register variables if there are
-     no groups in the pattern, as it takes a fair amount of time.  If
-     there are groups, we include space for register 0 (the whole
-     pattern), even though we never use it, since it simplifies the
-     array indexing.  We should fix this.  */
-  if (bufp->re_nsub)
-    {
-      regstart = REGEX_TALLOC (num_regs, const char *);
-      regend = REGEX_TALLOC (num_regs, const char *);
-      old_regstart = REGEX_TALLOC (num_regs, const char *);
-      old_regend = REGEX_TALLOC (num_regs, const char *);
-      best_regstart = REGEX_TALLOC (num_regs, const char *);
-      best_regend = REGEX_TALLOC (num_regs, const char *);
-      reg_info = REGEX_TALLOC (num_regs, register_info_type);
-      reg_dummy = REGEX_TALLOC (num_regs, const char *);
-      reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
-
-      if (!(regstart && regend && old_regstart && old_regend && reg_info 
-            && best_regstart && best_regend && reg_dummy && reg_info_dummy)) 
-        {
-          FREE_VARIABLES ();
-          return -2;
-        }
+    DEBUG_PRINT1("\n\nEntering re_match_2.\n");
+
+    INIT_FAIL_STACK();
+
+    /* Do not bother to initialize all the register variables if there are
+     * no groups in the pattern, as it takes a fair amount of time.  If
+     * there are groups, we include space for register 0 (the whole
+     * pattern), even though we never use it, since it simplifies the
+     * array indexing.  We should fix this.  */
+    if (bufp->re_nsub) {
+       regstart = REGEX_TALLOC(num_regs, const char *);
+       regend = REGEX_TALLOC(num_regs, const char *);
+       old_regstart = REGEX_TALLOC(num_regs, const char *);
+       old_regend = REGEX_TALLOC(num_regs, const char *);
+       best_regstart = REGEX_TALLOC(num_regs, const char *);
+       best_regend = REGEX_TALLOC(num_regs, const char *);
+       reg_info = REGEX_TALLOC(num_regs, register_info_type);
+       reg_dummy = REGEX_TALLOC(num_regs, const char *);
+       reg_info_dummy = REGEX_TALLOC(num_regs, register_info_type);
+
+       if (!(regstart && regend && old_regstart && old_regend && reg_info
+               && best_regstart && best_regend && reg_dummy && reg_info_dummy)) {
+           FREE_VARIABLES();
+           return -2;
+       }
     }
 #ifdef REGEX_MALLOC
-  else
-    {
-      /* We must initialize all our variables to NULL, so that
-         `FREE_VARIABLES' doesn't try to free them.  */
-      regstart = regend = old_regstart = old_regend = best_regstart
-        = best_regend = reg_dummy = NULL;
-      reg_info = reg_info_dummy = (register_info_type *) NULL;
+    else {
+       /* We must initialize all our variables to NULL, so that
+        * `FREE_VARIABLES' doesn't try to free them.  */
+       regstart = regend = old_regstart = old_regend = best_regstart
+           = best_regend = reg_dummy = NULL;
+       reg_info = reg_info_dummy = (register_info_type *) NULL;
     }
 #endif /* REGEX_MALLOC */
 
-  /* The starting position is bogus.  */
-  if (pos < 0 || pos > size1 + size2)
-    {
-      FREE_VARIABLES ();
-      return -1;
-    }
-    
-  /* Initialize subexpression text positions to -1 to mark ones that no
-     start_memory/stop_memory has been seen for. Also initialize the
-     register information struct.  */
-  for (mcnt = 1; mcnt < num_regs; mcnt++)
-    {
-      regstart[mcnt] = regend[mcnt] 
-        = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-        
-      REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
-      IS_ACTIVE (reg_info[mcnt]) = 0;
-      MATCHED_SOMETHING (reg_info[mcnt]) = 0;
-      EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+    /* The starting position is bogus.  */
+    if (pos < 0 || pos > size1 + size2) {
+       FREE_VARIABLES();
+       return -1;
     }
-  
-  /* We move `string1' into `string2' if the latter's empty -- but not if
-     `string1' is null.  */
-  if (size2 == 0 && string1 != NULL)
-    {
-      string2 = string1;
-      size2 = size1;
-      string1 = 0;
-      size1 = 0;
+    /* Initialize subexpression text positions to -1 to mark ones that no
+     * start_memory/stop_memory has been seen for. Also initialize the
+     * register information struct.  */
+    for (mcnt = 1; mcnt < num_regs; mcnt++) {
+       regstart[mcnt] = regend[mcnt]
+           = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
+
+       REG_MATCH_NULL_STRING_P(reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
+       IS_ACTIVE(reg_info[mcnt]) = 0;
+       MATCHED_SOMETHING(reg_info[mcnt]) = 0;
+       EVER_MATCHED_SOMETHING(reg_info[mcnt]) = 0;
     }
-  end1 = string1 + size1;
-  end2 = string2 + size2;
-
-  /* Compute where to stop matching, within the two strings.  */
-  if (stop <= size1)
-    {
-      end_match_1 = string1 + stop;
-      end_match_2 = string2;
+
+    /* We move `string1' into `string2' if the latter's empty -- but not if
+     * `string1' is null.  */
+    if (size2 == 0 && string1 != NULL) {
+       string2 = string1;
+       size2 = size1;
+       string1 = 0;
+       size1 = 0;
     }
-  else
-    {
-      end_match_1 = end1;
-      end_match_2 = string2 + stop - size1;
+    end1 = string1 + size1;
+    end2 = string2 + size2;
+
+    /* Compute where to stop matching, within the two strings.  */
+    if (stop <= size1) {
+       end_match_1 = string1 + stop;
+       end_match_2 = string2;
+    } else {
+       end_match_1 = end1;
+       end_match_2 = string2 + stop - size1;
     }
 
-  /* `p' scans through the pattern as `d' scans through the data. 
-     `dend' is the end of the input string that `d' points within.  `d'
-     is advanced into the following input string whenever necessary, but
-     this happens before fetching; therefore, at the beginning of the
-     loop, `d' can be pointing at the end of a string, but it cannot
-     equal `string2'.  */
-  if (size1 > 0 && pos <= size1)
-    {
-      d = string1 + pos;
-      dend = end_match_1;
-    }
-  else
-    {
-      d = string2 + pos - size1;
-      dend = end_match_2;
+    /* `p' scans through the pattern as `d' scans through the data. 
+     * `dend' is the end of the input string that `d' points within.  `d'
+     * is advanced into the following input string whenever necessary, but
+     * this happens before fetching; therefore, at the beginning of the
+     * loop, `d' can be pointing at the end of a string, but it cannot
+     * equal `string2'.  */
+    if (size1 > 0 && pos <= size1) {
+       d = string1 + pos;
+       dend = end_match_1;
+    } else {
+       d = string2 + pos - size1;
+       dend = end_match_2;
     }
 
-  DEBUG_PRINT1 ("The compiled pattern is: ");
-  DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
-  DEBUG_PRINT1 ("The string to match is: `");
-  DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
-  DEBUG_PRINT1 ("'\n");
-  
-  /* This loops over pattern commands.  It exits by returning from the
-     function if the match is complete, or it drops through if the match
-     fails at this starting point in the input data.  */
-  for (;;)
-    {
-      DEBUG_PRINT2 ("\n0x%x: ", p);
-
-      if (p == pend)
-       { /* End of pattern means we might have succeeded.  */
-          DEBUG_PRINT1 ("end of pattern ... ");
-          
-         /* If we haven't matched the entire string, and we want the
-             longest match, try backtracking.  */
-          if (d != end_match_2)
-           {
-              DEBUG_PRINT1 ("backtracking.\n");
-              
-              if (!FAIL_STACK_EMPTY ())
-                { /* More failure points to try.  */
-                  boolean same_str_p = (FIRST_STRING_P (match_end) 
-                                       == MATCHING_IN_FIRST_STRING);
-
-                  /* If exceeds best match so far, save it.  */
-                  if (!best_regs_set
-                      || (same_str_p && d > match_end)
-                      || (!same_str_p && !MATCHING_IN_FIRST_STRING))
-                    {
-                      best_regs_set = true;
-                      match_end = d;
-                      
-                      DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-                      
-                      for (mcnt = 1; mcnt < num_regs; mcnt++)
-                        {
-                          best_regstart[mcnt] = regstart[mcnt];
-                          best_regend[mcnt] = regend[mcnt];
-                        }
-                    }
-                  goto fail;          
-                }
-
-              /* If no failure points, don't restore garbage.  */
-              else if (best_regs_set)   
-                {
-               restore_best_regs:
-                  /* Restore best match.  It may happen that `dend ==
-                     end_match_1' while the restored d is in string2.
-                     For example, the pattern `x.*y.*z' against the
-                     strings `x-' and `y-z-', if the two strings are
-                     not consecutive in memory.  */
-                  DEBUG_PRINT1 ("Restoring best registers.\n");
-                  
-                  d = match_end;
-                  dend = ((d >= string1 && d <= end1)
-                          ? end_match_1 : end_match_2);
-
-                 for (mcnt = 1; mcnt < num_regs; mcnt++)
-                   {
-                     regstart[mcnt] = best_regstart[mcnt];
-                     regend[mcnt] = best_regend[mcnt];
+    DEBUG_PRINT1("The compiled pattern is: ");
+    DEBUG_PRINT_COMPILED_PATTERN(bufp, p, pend);
+    DEBUG_PRINT1("The string to match is: `");
+    DEBUG_PRINT_DOUBLE_STRING(d, string1, size1, string2, size2);
+    DEBUG_PRINT1("'\n");
+
+    /* This loops over pattern commands.  It exits by returning from the
+     * function if the match is complete, or it drops through if the match
+     * fails at this starting point in the input data.  */
+    for (;;) {
+       DEBUG_PRINT2("\n0x%x: ", p);
+
+       if (p == pend) {        /* End of pattern means we might have succeeded.  */
+           DEBUG_PRINT1("end of pattern ... ");
+
+           /* If we haven't matched the entire string, and we want the
+            * longest match, try backtracking.  */
+           if (d != end_match_2) {
+               DEBUG_PRINT1("backtracking.\n");
+
+               if (!FAIL_STACK_EMPTY()) {      /* More failure points to try.  */
+                   boolean same_str_p = (FIRST_STRING_P(match_end)
+                       == MATCHING_IN_FIRST_STRING);
+
+                   /* If exceeds best match so far, save it.  */
+                   if (!best_regs_set
+                       || (same_str_p && d > match_end)
+                       || (!same_str_p && !MATCHING_IN_FIRST_STRING)) {
+                       best_regs_set = true;
+                       match_end = d;
+
+                       DEBUG_PRINT1("\nSAVING match as best so far.\n");
+
+                       for (mcnt = 1; mcnt < num_regs; mcnt++) {
+                           best_regstart[mcnt] = regstart[mcnt];
+                           best_regend[mcnt] = regend[mcnt];
+                       }
+                   }
+                   goto fail;
+               }
+               /* If no failure points, don't restore garbage.  */
+               else if (best_regs_set) {
+                 restore_best_regs:
+                   /* Restore best match.  It may happen that `dend ==
+                    * end_match_1' while the restored d is in string2.
+                    * For example, the pattern `x.*y.*z' against the
+                    * strings `x-' and `y-z-', if the two strings are
+                    * not consecutive in memory.  */
+                   DEBUG_PRINT1("Restoring best registers.\n");
+
+                   d = match_end;
+                   dend = ((d >= string1 && d <= end1)
+                       ? end_match_1 : end_match_2);
+
+                   for (mcnt = 1; mcnt < num_regs; mcnt++) {
+                       regstart[mcnt] = best_regstart[mcnt];
+                       regend[mcnt] = best_regend[mcnt];
                    }
-                }
-            } /* d != end_match_2 */
-
-          DEBUG_PRINT1 ("Accepting match.\n");
-
-          /* If caller wants register contents data back, do it.  */
-          if (regs && !bufp->no_sub)
-           {
-              /* Have the register data arrays been allocated?  */
-              if (bufp->regs_allocated == REGS_UNALLOCATED)
-                { /* No.  So allocate them with malloc.  We need one
-                     extra element beyond `num_regs' for the `-1' marker
-                     GNU code uses.  */
-                  regs->num_regs = MAX (RE_NREGS, num_regs + 1);
-                  regs->start = TALLOC (regs->num_regs, regoff_t);
-                  regs->end = TALLOC (regs->num_regs, regoff_t);
-                  if (regs->start == NULL || regs->end == NULL)
-                    return -2;
-                  bufp->regs_allocated = REGS_REALLOCATE;
-                }
-              else if (bufp->regs_allocated == REGS_REALLOCATE)
-                { /* Yes.  If we need more elements than were already
-                     allocated, reallocate them.  If we need fewer, just
-                     leave it alone.  */
-                  if (regs->num_regs < num_regs + 1)
-                    {
-                      regs->num_regs = num_regs + 1;
-                      RETALLOC (regs->start, regs->num_regs, regoff_t);
-                      RETALLOC (regs->end, regs->num_regs, regoff_t);
-                      if (regs->start == NULL || regs->end == NULL)
-                        return -2;
-                    }
-                }
-              else
-                assert (bufp->regs_allocated == REGS_FIXED);
-
-              /* Convert the pointer data in `regstart' and `regend' to
-                 indices.  Register zero has to be set differently,
-                 since we haven't kept track of any info for it.  */
-              if (regs->num_regs > 0)
-                {
-                  regs->start[0] = pos;
-                  regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
-                                 : d - string2 + size1);
-                }
-              
-              /* Go through the first `min (num_regs, regs->num_regs)'
-                 registers, since that is all we initialized.  */
-             for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
-               {
-                  if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
-                    regs->start[mcnt] = regs->end[mcnt] = -1;
-                  else
-                    {
-                     regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]);
-                      regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
-                    }
                }
-              
-              /* If the regs structure we return has more elements than
-                 were in the pattern, set the extra elements to -1.  If
-                 we (re)allocated the registers, this is the case,
-                 because we always allocate enough to have at least one
-                 -1 at the end.  */
-              for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
-                regs->start[mcnt] = regs->end[mcnt] = -1;
-           } /* regs && !bufp->no_sub */
-
-          FREE_VARIABLES ();
-          DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
-                        nfailure_points_pushed, nfailure_points_popped,
-                        nfailure_points_pushed - nfailure_points_popped);
-          DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
-
-          mcnt = d - pos - (MATCHING_IN_FIRST_STRING 
-                           ? string1 
-                           : string2 - size1);
-
-          DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
-
-          return mcnt;
-        }
-
-      /* Otherwise match next pattern command.  */
+           }                   /* d != end_match_2 */
+           DEBUG_PRINT1("Accepting match.\n");
+
+           /* If caller wants register contents data back, do it.  */
+           if (regs && !bufp->no_sub) {
+               /* Have the register data arrays been allocated?  */
+               if (bufp->regs_allocated == REGS_UNALLOCATED) {         /* No.  So allocate them with malloc.  We need one
+                                                                        * extra element beyond `num_regs' for the `-1' marker
+                                                                        * GNU code uses.  */
+                   regs->num_regs = MAX(RE_NREGS, num_regs + 1);
+                   regs->start = TALLOC(regs->num_regs, regoff_t);
+                   regs->end = TALLOC(regs->num_regs, regoff_t);
+                   if (regs->start == NULL || regs->end == NULL)
+                       return -2;
+                   bufp->regs_allocated = REGS_REALLOCATE;
+               } else if (bufp->regs_allocated == REGS_REALLOCATE) {   /* Yes.  If we need more elements than were already
+                                                                        * allocated, reallocate them.  If we need fewer, just
+                                                                        * leave it alone.  */
+                   if (regs->num_regs < num_regs + 1) {
+                       regs->num_regs = num_regs + 1;
+                       RETALLOC(regs->start, regs->num_regs, regoff_t);
+                       RETALLOC(regs->end, regs->num_regs, regoff_t);
+                       if (regs->start == NULL || regs->end == NULL)
+                           return -2;
+                   }
+               } else
+                   assert(bufp->regs_allocated == REGS_FIXED);
+
+               /* Convert the pointer data in `regstart' and `regend' to
+                * indices.  Register zero has to be set differently,
+                * since we haven't kept track of any info for it.  */
+               if (regs->num_regs > 0) {
+                   regs->start[0] = pos;
+                   regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
+                       : d - string2 + size1);
+               }
+               /* Go through the first `min (num_regs, regs->num_regs)'
+                * registers, since that is all we initialized.  */
+               for (mcnt = 1; mcnt < MIN(num_regs, regs->num_regs); mcnt++) {
+                   if (REG_UNSET(regstart[mcnt]) || REG_UNSET(regend[mcnt]))
+                       regs->start[mcnt] = regs->end[mcnt] = -1;
+                   else {
+                       regs->start[mcnt] = POINTER_TO_OFFSET(regstart[mcnt]);
+                       regs->end[mcnt] = POINTER_TO_OFFSET(regend[mcnt]);
+                   }
+               }
+
+               /* If the regs structure we return has more elements than
+                * were in the pattern, set the extra elements to -1.  If
+                * we (re)allocated the registers, this is the case,
+                * because we always allocate enough to have at least one
+                * -1 at the end.  */
+               for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
+                   regs->start[mcnt] = regs->end[mcnt] = -1;
+           }                   /* regs && !bufp->no_sub */
+           FREE_VARIABLES();
+           DEBUG_PRINT4("%u failure points pushed, %u popped (%u remain).\n",
+               nfailure_points_pushed, nfailure_points_popped,
+               nfailure_points_pushed - nfailure_points_popped);
+           DEBUG_PRINT2("%u registers pushed.\n", num_regs_pushed);
+
+           mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+               ? string1
+               : string2 - size1);
+
+           DEBUG_PRINT2("Returning %d from re_match_2.\n", mcnt);
+
+           return mcnt;
+       }
+       /* Otherwise match next pattern command.  */
 #ifdef SWITCH_ENUM_BUG
-      switch ((int) ((re_opcode_t) *p++))
+       switch ((int) ((re_opcode_t) * p++))
 #else
-      switch ((re_opcode_t) *p++)
+       switch ((re_opcode_t) * p++)
 #endif
        {
-        /* Ignore these.  Used to ignore the n of succeed_n's which
-           currently have n == 0.  */
-        case no_op:
-          DEBUG_PRINT1 ("EXECUTING no_op.\n");
-          break;
+           /* Ignore these.  Used to ignore the n of succeed_n's which
+            * currently have n == 0.  */
+       case no_op:
+           DEBUG_PRINT1("EXECUTING no_op.\n");
+           break;
 
 
-        /* Match the next n pattern characters exactly.  The following
-           byte in the pattern defines n, and the n bytes after that
-           are the characters to match.  */
+           /* Match the next n pattern characters exactly.  The following
+            * byte in the pattern defines n, and the n bytes after that
+            * are the characters to match.  */
        case exactn:
-         mcnt = *p++;
-          DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
-
-          /* This is written out as an if-else so we don't waste time
-             testing `translate' inside the loop.  */
-          if (translate)
-           {
-             do
-               {
-                 PREFETCH ();
-                 if (translate[(unsigned char) *d++] != (char) *p++)
-                    goto fail;
+           mcnt = *p++;
+           DEBUG_PRINT2("EXECUTING exactn %d.\n", mcnt);
+
+           /* This is written out as an if-else so we don't waste time
+            * testing `translate' inside the loop.  */
+           if (translate) {
+               do {
+                   PREFETCH();
+                   if (translate[(unsigned char) *d++] != (char) *p++)
+                       goto fail;
                }
-             while (--mcnt);
-           }
-         else
-           {
-             do
-               {
-                 PREFETCH ();
-                 if (*d++ != (char) *p++) goto fail;
+               while (--mcnt);
+           } else {
+               do {
+                   PREFETCH();
+                   if (*d++ != (char) *p++)
+                       goto fail;
                }
-             while (--mcnt);
+               while (--mcnt);
            }
-         SET_REGS_MATCHED ();
-          break;
+           SET_REGS_MATCHED();
+           break;
 
 
-        /* Match any character except possibly a newline or a null.  */
+           /* Match any character except possibly a newline or a null.  */
        case anychar:
-          DEBUG_PRINT1 ("EXECUTING anychar.\n");
+           DEBUG_PRINT1("EXECUTING anychar.\n");
 
-          PREFETCH ();
+           PREFETCH();
 
-          if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
-              || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
-           goto fail;
+           if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE(*d) == '\n')
+               || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE(*d) == '\000'))
+               goto fail;
 
-          SET_REGS_MATCHED ();
-          DEBUG_PRINT2 ("  Matched `%d'.\n", *d);
-          d++;
-         break;
+           SET_REGS_MATCHED();
+           DEBUG_PRINT2("  Matched `%d'.\n", *d);
+           d++;
+           break;
 
 
        case charset:
        case charset_not:
-         {
-           register unsigned char c;
-           boolean not = (re_opcode_t) *(p - 1) == charset_not;
+           {
+               register unsigned char c;
+               boolean not = (re_opcode_t) * (p - 1) == charset_not;
+
+               DEBUG_PRINT2("EXECUTING charset%s.\n", not ? "_not" : "");
 
-            DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
+               PREFETCH();
+               c = TRANSLATE(*d);      /* The character to match.  */
 
-           PREFETCH ();
-           c = TRANSLATE (*d); /* The character to match.  */
+               /* Cast to `unsigned' instead of `unsigned char' in case the
+                * bit list is a full 32 bytes long.  */
+               if (c < (unsigned) (*p * BYTEWIDTH)
+                   && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+                   not = !not;
 
-            /* Cast to `unsigned' instead of `unsigned char' in case the
-               bit list is a full 32 bytes long.  */
-           if (c < (unsigned) (*p * BYTEWIDTH)
-               && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
-             not = !not;
+               p += 1 + *p;
 
-           p += 1 + *p;
+               if (!not)
+                   goto fail;
+
+               SET_REGS_MATCHED();
+               d++;
+               break;
+           }
 
-           if (!not) goto fail;
-            
-           SET_REGS_MATCHED ();
-            d++;
+
+           /* The beginning of a group is represented by start_memory.
+            * The arguments are the register number in the next byte, and the
+            * number of groups inner to this one in the next.  The text
+            * matched within the group is recorded (in the internal
+            * registers data structure) under the register number.  */
+       case start_memory:
+           DEBUG_PRINT3("EXECUTING start_memory %d (%d):\n", *p, p[1]);
+
+           /* Find out if this group can match the empty string.  */
+           p1 = p;             /* To send to group_match_null_string_p.  */
+
+           if (REG_MATCH_NULL_STRING_P(reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
+               REG_MATCH_NULL_STRING_P(reg_info[*p])
+                   = group_match_null_string_p(&p1, pend, reg_info);
+
+           /* Save the position in the string where we were the last time
+            * we were at this open-group operator in case the group is
+            * operated upon by a repetition operator, e.g., with `(a*)*b'
+            * against `ab'; then we want to ignore where we are now in
+            * the string in case this attempt to match fails.  */
+           old_regstart[*p] = REG_MATCH_NULL_STRING_P(reg_info[*p])
+               ? REG_UNSET(regstart[*p]) ? d : regstart[*p]
+               : regstart[*p];
+           DEBUG_PRINT2("  old_regstart: %d\n",
+               POINTER_TO_OFFSET(old_regstart[*p]));
+
+           regstart[*p] = d;
+           DEBUG_PRINT2("  regstart: %d\n", POINTER_TO_OFFSET(regstart[*p]));
+
+           IS_ACTIVE(reg_info[*p]) = 1;
+           MATCHED_SOMETHING(reg_info[*p]) = 0;
+
+           /* This is the new highest active register.  */
+           highest_active_reg = *p;
+
+           /* If nothing was active before, this is the new lowest active
+            * register.  */
+           if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+               lowest_active_reg = *p;
+
+           /* Move past the register number and inner group count.  */
+           p += 2;
            break;
-         }
-
-
-        /* The beginning of a group is represented by start_memory.
-           The arguments are the register number in the next byte, and the
-           number of groups inner to this one in the next.  The text
-           matched within the group is recorded (in the internal
-           registers data structure) under the register number.  */
-        case start_memory:
-         DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
-
-          /* Find out if this group can match the empty string.  */
-         p1 = p;               /* To send to group_match_null_string_p.  */
-          
-          if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
-            REG_MATCH_NULL_STRING_P (reg_info[*p]) 
-              = group_match_null_string_p (&p1, pend, reg_info);
-
-          /* Save the position in the string where we were the last time
-             we were at this open-group operator in case the group is
-             operated upon by a repetition operator, e.g., with `(a*)*b'
-             against `ab'; then we want to ignore where we are now in
-             the string in case this attempt to match fails.  */
-          old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
-                             ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
-                             : regstart[*p];
-         DEBUG_PRINT2 ("  old_regstart: %d\n", 
-                        POINTER_TO_OFFSET (old_regstart[*p]));
-
-          regstart[*p] = d;
-         DEBUG_PRINT2 ("  regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
-
-          IS_ACTIVE (reg_info[*p]) = 1;
-          MATCHED_SOMETHING (reg_info[*p]) = 0;
-          
-          /* This is the new highest active register.  */
-          highest_active_reg = *p;
-          
-          /* If nothing was active before, this is the new lowest active
-             register.  */
-          if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
-            lowest_active_reg = *p;
-
-          /* Move past the register number and inner group count.  */
-          p += 2;
-          break;
-
-
-        /* The stop_memory opcode represents the end of a group.  Its
-           arguments are the same as start_memory's: the register
-           number, and the number of inner groups.  */
+
+
+           /* The stop_memory opcode represents the end of a group.  Its
+            * arguments are the same as start_memory's: the register
+            * number, and the number of inner groups.  */
        case stop_memory:
-         DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-             
-          /* We need to save the string position the last time we were at
-             this close-group operator in case the group is operated
-             upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
-             against `aba'; then we want to ignore where we are now in
-             the string in case this attempt to match fails.  */
-          old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
-                           ? REG_UNSET (regend[*p]) ? d : regend[*p]
-                          : regend[*p];
-         DEBUG_PRINT2 ("      old_regend: %d\n", 
-                        POINTER_TO_OFFSET (old_regend[*p]));
-
-          regend[*p] = d;
-         DEBUG_PRINT2 ("      regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
-
-          /* This register isn't active anymore.  */
-          IS_ACTIVE (reg_info[*p]) = 0;
-          
-          /* If this was the only register active, nothing is active
-             anymore.  */
-          if (lowest_active_reg == highest_active_reg)
-            {
-              lowest_active_reg = NO_LOWEST_ACTIVE_REG;
-              highest_active_reg = NO_HIGHEST_ACTIVE_REG;
-            }
-          else
-            { /* We must scan for the new highest active register, since
-                 it isn't necessarily one less than now: consider
-                 (a(b)c(d(e)f)g).  When group 3 ends, after the f), the
-                 new highest active register is 1.  */
-              unsigned char r = *p - 1;
-              while (r > 0 && !IS_ACTIVE (reg_info[r]))
-                r--;
-              
-              /* If we end up at register zero, that means that we saved
-                 the registers as the result of an `on_failure_jump', not
-                 a `start_memory', and we jumped to past the innermost
-                 `stop_memory'.  For example, in ((.)*) we save
-                 registers 1 and 2 as a result of the *, but when we pop
-                 back to the second ), we are at the stop_memory 1.
-                 Thus, nothing is active.  */
-             if (r == 0)
-                {
-                  lowest_active_reg = NO_LOWEST_ACTIVE_REG;
-                  highest_active_reg = NO_HIGHEST_ACTIVE_REG;
-                }
-              else
-                highest_active_reg = r;
-            }
-          
-          /* If just failed to match something this time around with a
-             group that's operated on by a repetition operator, try to
-             force exit from the ``loop'', and restore the register
-             information for this group that we had before trying this
-             last match.  */
-          if ((!MATCHED_SOMETHING (reg_info[*p])
-               || (re_opcode_t) p[-3] == start_memory)
-             && (p + 2) < pend)              
-            {
-              boolean is_a_jump_n = false;
-              
-              p1 = p + 2;
-              mcnt = 0;
-              switch ((re_opcode_t) *p1++)
-                {
-                  case jump_n:
+           DEBUG_PRINT3("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
+
+           /* We need to save the string position the last time we were at
+            * this close-group operator in case the group is operated
+            * upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
+            * against `aba'; then we want to ignore where we are now in
+            * the string in case this attempt to match fails.  */
+           old_regend[*p] = REG_MATCH_NULL_STRING_P(reg_info[*p])
+               ? REG_UNSET(regend[*p]) ? d : regend[*p]
+               : regend[*p];
+           DEBUG_PRINT2("      old_regend: %d\n",
+               POINTER_TO_OFFSET(old_regend[*p]));
+
+           regend[*p] = d;
+           DEBUG_PRINT2("      regend: %d\n", POINTER_TO_OFFSET(regend[*p]));
+
+           /* This register isn't active anymore.  */
+           IS_ACTIVE(reg_info[*p]) = 0;
+
+           /* If this was the only register active, nothing is active
+            * anymore.  */
+           if (lowest_active_reg == highest_active_reg) {
+               lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+               highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+           } else {            /* We must scan for the new highest active register, since
+                                * it isn't necessarily one less than now: consider
+                                * (a(b)c(d(e)f)g).  When group 3 ends, after the f), the
+                                * new highest active register is 1.  */
+               unsigned char r = *p - 1;
+               while (r > 0 && !IS_ACTIVE(reg_info[r]))
+                   r--;
+
+               /* If we end up at register zero, that means that we saved
+                * the registers as the result of an `on_failure_jump', not
+                * a `start_memory', and we jumped to past the innermost
+                * `stop_memory'.  For example, in ((.)*) we save
+                * registers 1 and 2 as a result of the *, but when we pop
+                * back to the second ), we are at the stop_memory 1.
+                * Thus, nothing is active.  */
+               if (r == 0) {
+                   lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+                   highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+               } else
+                   highest_active_reg = r;
+           }
+
+           /* If just failed to match something this time around with a
+            * group that's operated on by a repetition operator, try to
+            * force exit from the ``loop'', and restore the register
+            * information for this group that we had before trying this
+            * last match.  */
+           if ((!MATCHED_SOMETHING(reg_info[*p])
+                   || (re_opcode_t) p[-3] == start_memory)
+               && (p + 2) < pend) {
+               boolean is_a_jump_n = false;
+
+               p1 = p + 2;
+               mcnt = 0;
+               switch ((re_opcode_t) * p1++) {
+               case jump_n:
                    is_a_jump_n = true;
-                  case pop_failure_jump:
-                 case maybe_pop_jump:
-                 case jump:
-                 case dummy_failure_jump:
-                    EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+               case pop_failure_jump:
+               case maybe_pop_jump:
+               case jump:
+               case dummy_failure_jump:
+                   EXTRACT_NUMBER_AND_INCR(mcnt, p1);
                    if (is_a_jump_n)
-                     p1 += 2;
-                    break;
-                  
-                  default:
-                    /* do nothing */ ;
-                }
-             p1 += mcnt;
-        
-              /* If the next operation is a jump backwards in the pattern
-                to an on_failure_jump right before the start_memory
-                 corresponding to this stop_memory, exit from the loop
-                 by forcing a failure after pushing on the stack the
-                 on_failure_jump's jump in the pattern, and d.  */
-              if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
-                  && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
-               {
-                  /* If this group ever matched anything, then restore
-                     what its registers were before trying this last
-                     failed match, e.g., with `(a*)*b' against `ab' for
-                     regstart[1], and, e.g., with `((a*)*(b*)*)*'
-                     against `aba' for regend[3].
-                     
-                     Also restore the registers for inner groups for,
-                     e.g., `((a*)(b*))*' against `aba' (register 3 would
-                     otherwise get trashed).  */
-                     
-                  if (EVER_MATCHED_SOMETHING (reg_info[*p]))
-                   {
-                     unsigned r; 
-        
-                      EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-                      
-                     /* Restore this and inner groups' (if any) registers.  */
-                      for (r = *p; r < *p + *(p + 1); r++)
-                        {
-                          regstart[r] = old_regstart[r];
-
-                          /* xx why this test?  */
-                          if ((long) old_regend[r] >= (long) regstart[r])
-                            regend[r] = old_regend[r];
-                        }     
-                    }
-                 p1++;
-                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-                  PUSH_FAILURE_POINT ( p1 + mcnt, d, -2);
-
-                  goto fail;
-                }
-            }
-          
-          /* Move past the register number and the inner group count.  */
-          p += 2;
-          break;
-
-
-       /* \<digit> has been turned into a `duplicate' command which is
-           followed by the numeric value of <digit> as the register number.  */
-        case duplicate:
-         {
-           register const char *d2, *dend2;
-           int regno = *p++;   /* Get which register to match against.  */
-           DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
-
-           /* Can't back reference a group which we've never matched.  */
-            if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
-              goto fail;
-              
-            /* Where in input to try to start matching.  */
-            d2 = regstart[regno];
-            
-            /* Where to stop matching; if both the place to start and
-               the place to stop matching are in the same string, then
-               set to the place to stop, otherwise, for now have to use
-               the end of the first string.  */
-
-            dend2 = ((FIRST_STRING_P (regstart[regno]) 
-                     == FIRST_STRING_P (regend[regno]))
-                    ? regend[regno] : end_match_1);
-           for (;;)
-             {
-               /* If necessary, advance to next segment in register
-                   contents.  */
-               while (d2 == dend2)
-                 {
-                   if (dend2 == end_match_2) break;
-                   if (dend2 == regend[regno]) break;
-
-                    /* End of string1 => advance to string2. */
-                    d2 = string2;
-                    dend2 = regend[regno];
-                 }
-               /* At end of register contents => success */
-               if (d2 == dend2) break;
-
-               /* If necessary, advance to next segment in data.  */
-               PREFETCH ();
-
-               /* How many characters left in this segment to match.  */
-               mcnt = dend - d;
-                
-               /* Want how many consecutive characters we can match in
-                   one shot, so, if necessary, adjust the count.  */
-                if (mcnt > dend2 - d2)
-                 mcnt = dend2 - d2;
-                  
-               /* Compare that many; failure if mismatch, else move
-                   past them.  */
-               if (translate 
-                    ? bcmp_translate (d, d2, mcnt, translate) 
-                    : bcmp (d, d2, mcnt))
-                 goto fail;
-               d += mcnt, d2 += mcnt;
-             }
-         }
-         break;
-
-
-        /* begline matches the empty string at the beginning of the string
-           (unless `not_bol' is set in `bufp'), and, if
-           `newline_anchor' is set, after newlines.  */
+                       p1 += 2;
+                   break;
+
+               default:
+                   /* do nothing */ ;
+               }
+               p1 += mcnt;
+
+               /* If the next operation is a jump backwards in the pattern
+                * to an on_failure_jump right before the start_memory
+                * corresponding to this stop_memory, exit from the loop
+                * by forcing a failure after pushing on the stack the
+                * on_failure_jump's jump in the pattern, and d.  */
+               if (mcnt < 0 && (re_opcode_t) * p1 == on_failure_jump
+                   && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) {
+                   /* If this group ever matched anything, then restore
+                    * what its registers were before trying this last
+                    * failed match, e.g., with `(a*)*b' against `ab' for
+                    * regstart[1], and, e.g., with `((a*)*(b*)*)*'
+                    * against `aba' for regend[3].
+                    * 
+                    * Also restore the registers for inner groups for,
+                    * e.g., `((a*)(b*))*' against `aba' (register 3 would
+                    * otherwise get trashed).  */
+
+                   if (EVER_MATCHED_SOMETHING(reg_info[*p])) {
+                       unsigned r;
+
+                       EVER_MATCHED_SOMETHING(reg_info[*p]) = 0;
+
+                       /* Restore this and inner groups' (if any) registers.  */
+                       for (r = *p; r < *p + *(p + 1); r++) {
+                           regstart[r] = old_regstart[r];
+
+                           /* xx why this test?  */
+                           if ((long) old_regend[r] >= (long) regstart[r])
+                               regend[r] = old_regend[r];
+                       }
+                   }
+                   p1++;
+                   EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+                   PUSH_FAILURE_POINT(p1 + mcnt, d, -2);
+
+                   goto fail;
+               }
+           }
+           /* Move past the register number and the inner group count.  */
+           p += 2;
+           break;
+
+
+           /* \<digit> has been turned into a `duplicate' command which is
+            * followed by the numeric value of <digit> as the register number.  */
+       case duplicate:
+           {
+               register const char *d2, *dend2;
+               int regno = *p++;       /* Get which register to match against.  */
+               DEBUG_PRINT2("EXECUTING duplicate %d.\n", regno);
+
+               /* Can't back reference a group which we've never matched.  */
+               if (REG_UNSET(regstart[regno]) || REG_UNSET(regend[regno]))
+                   goto fail;
+
+               /* Where in input to try to start matching.  */
+               d2 = regstart[regno];
+
+               /* Where to stop matching; if both the place to start and
+                * the place to stop matching are in the same string, then
+                * set to the place to stop, otherwise, for now have to use
+                * the end of the first string.  */
+
+               dend2 = ((FIRST_STRING_P(regstart[regno])
+                       == FIRST_STRING_P(regend[regno]))
+                   ? regend[regno] : end_match_1);
+               for (;;) {
+                   /* If necessary, advance to next segment in register
+                    * contents.  */
+                   while (d2 == dend2) {
+                       if (dend2 == end_match_2)
+                           break;
+                       if (dend2 == regend[regno])
+                           break;
+
+                       /* End of string1 => advance to string2. */
+                       d2 = string2;
+                       dend2 = regend[regno];
+                   }
+                   /* At end of register contents => success */
+                   if (d2 == dend2)
+                       break;
+
+                   /* If necessary, advance to next segment in data.  */
+                   PREFETCH();
+
+                   /* How many characters left in this segment to match.  */
+                   mcnt = dend - d;
+
+                   /* Want how many consecutive characters we can match in
+                    * one shot, so, if necessary, adjust the count.  */
+                   if (mcnt > dend2 - d2)
+                       mcnt = dend2 - d2;
+
+                   /* Compare that many; failure if mismatch, else move
+                    * past them.  */
+                   if (translate
+                       ? bcmp_translate(d, d2, mcnt, translate)
+                       : bcmp(d, d2, mcnt))
+                       goto fail;
+                   d += mcnt, d2 += mcnt;
+               }
+           }
+           break;
+
+
+           /* begline matches the empty string at the beginning of the string
+            * (unless `not_bol' is set in `bufp'), and, if
+            * `newline_anchor' is set, after newlines.  */
        case begline:
-          DEBUG_PRINT1 ("EXECUTING begline.\n");
-          
-          if (AT_STRINGS_BEG (d))
-            {
-              if (!bufp->not_bol) break;
-            }
-          else if (d[-1] == '\n' && bufp->newline_anchor)
-            {
-              break;
-            }
-          /* In all other cases, we fail.  */
-          goto fail;
-
-
-        /* endline is the dual of begline.  */
+           DEBUG_PRINT1("EXECUTING begline.\n");
+
+           if (AT_STRINGS_BEG(d)) {
+               if (!bufp->not_bol)
+                   break;
+           } else if (d[-1] == '\n' && bufp->newline_anchor) {
+               break;
+           }
+           /* In all other cases, we fail.  */
+           goto fail;
+
+
+           /* endline is the dual of begline.  */
        case endline:
-          DEBUG_PRINT1 ("EXECUTING endline.\n");
-
-          if (AT_STRINGS_END (d))
-            {
-              if (!bufp->not_eol) break;
-            }
-          
-          /* We have to ``prefetch'' the next character.  */
-          else if ((d == end1 ? *string2 : *d) == '\n'
-                   && bufp->newline_anchor)
-            {
-              break;
-            }
-          goto fail;
-
-
-       /* Match at the very beginning of the data.  */
-        case begbuf:
-          DEBUG_PRINT1 ("EXECUTING begbuf.\n");
-          if (AT_STRINGS_BEG (d))
-            break;
-          goto fail;
-
-
-       /* Match at the very end of the data.  */
-        case endbuf:
-          DEBUG_PRINT1 ("EXECUTING endbuf.\n");
-         if (AT_STRINGS_END (d))
+           DEBUG_PRINT1("EXECUTING endline.\n");
+
+           if (AT_STRINGS_END(d)) {
+               if (!bufp->not_eol)
+                   break;
+           }
+           /* We have to ``prefetch'' the next character.  */
+           else if ((d == end1 ? *string2 : *d) == '\n'
+               && bufp->newline_anchor) {
+               break;
+           }
+           goto fail;
+
+
+           /* Match at the very beginning of the data.  */
+       case begbuf:
+           DEBUG_PRINT1("EXECUTING begbuf.\n");
+           if (AT_STRINGS_BEG(d))
+               break;
+           goto fail;
+
+
+           /* Match at the very end of the data.  */
+       case endbuf:
+           DEBUG_PRINT1("EXECUTING endbuf.\n");
+           if (AT_STRINGS_END(d))
+               break;
+           goto fail;
+
+
+           /* on_failure_keep_string_jump is used to optimize `.*\n'.  It
+            * pushes NULL as the value for the string on the stack.  Then
+            * `pop_failure_point' will keep the current value for the
+            * string, instead of restoring it.  To see why, consider
+            * matching `foo\nbar' against `.*\n'.  The .* matches the foo;
+            * then the . fails against the \n.  But the next thing we want
+            * to do is match the \n against the \n; if we restored the
+            * string value, we would be back at the foo.
+            * 
+            * Because this is used only in specific cases, we don't need to
+            * check all the things that `on_failure_jump' does, to make
+            * sure the right things get saved on the stack.  Hence we don't
+            * share its code.  The only reason to push anything on the
+            * stack at all is that otherwise we would have to change
+            * `anychar's code to do something besides goto fail in this
+            * case; that seems worse than this.  */
+       case on_failure_keep_string_jump:
+           DEBUG_PRINT1("EXECUTING on_failure_keep_string_jump");
+
+           EXTRACT_NUMBER_AND_INCR(mcnt, p);
+           DEBUG_PRINT3(" %d (to 0x%x):\n", mcnt, p + mcnt);
+
+           PUSH_FAILURE_POINT(p + mcnt, NULL, -2);
            break;
-          goto fail;
-
-
-        /* on_failure_keep_string_jump is used to optimize `.*\n'.  It
-           pushes NULL as the value for the string on the stack.  Then
-           `pop_failure_point' will keep the current value for the
-           string, instead of restoring it.  To see why, consider
-           matching `foo\nbar' against `.*\n'.  The .* matches the foo;
-           then the . fails against the \n.  But the next thing we want
-           to do is match the \n against the \n; if we restored the
-           string value, we would be back at the foo.
-           
-           Because this is used only in specific cases, we don't need to
-           check all the things that `on_failure_jump' does, to make
-           sure the right things get saved on the stack.  Hence we don't
-           share its code.  The only reason to push anything on the
-           stack at all is that otherwise we would have to change
-           `anychar's code to do something besides goto fail in this
-           case; that seems worse than this.  */
-        case on_failure_keep_string_jump:
-          DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-          
-          EXTRACT_NUMBER_AND_INCR (mcnt, p);
-          DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
-
-          PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
-          break;
-
-
-       /* Uses of on_failure_jump:
-        
-           Each alternative starts with an on_failure_jump that points
-           to the beginning of the next alternative.  Each alternative
-           except the last ends with a jump that in effect jumps past
-           the rest of the alternatives.  (They really jump to the
-           ending jump of the following alternative, because tensioning
-           these jumps is a hassle.)
-
-           Repeats start with an on_failure_jump that points past both
-           the repetition text and either the following jump or
-           pop_failure_jump back to this on_failure_jump.  */
+
+
+           /* Uses of on_failure_jump:
+            * 
+            * Each alternative starts with an on_failure_jump that points
+            * to the beginning of the next alternative.  Each alternative
+            * except the last ends with a jump that in effect jumps past
+            * the rest of the alternatives.  (They really jump to the
+            * ending jump of the following alternative, because tensioning
+            * these jumps is a hassle.)
+            * 
+            * Repeats start with an on_failure_jump that points past both
+            * the repetition text and either the following jump or
+            * pop_failure_jump back to this on_failure_jump.  */
        case on_failure_jump:
-        on_failure:
-          DEBUG_PRINT1 ("EXECUTING on_failure_jump");
-
-          EXTRACT_NUMBER_AND_INCR (mcnt, p);
-          DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
-
-          /* If this on_failure_jump comes right before a group (i.e.,
-             the original * applied to a group), save the information
-             for that group and all inner ones, so that if we fail back
-             to this point, the group's information will be correct.
-             For example, in \(a*\)*\1, we need the preceding group,
-             and in \(\(a*\)b*\)\2, we need the inner group.  */
-
-          /* We can't use `p' to check ahead because we push
-             a failure point to `p + mcnt' after we do this.  */
-          p1 = p;
-
-          /* We need to skip no_op's before we look for the
-             start_memory in case this on_failure_jump is happening as
-             the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
-             against aba.  */
-          while (p1 < pend && (re_opcode_t) *p1 == no_op)
-            p1++;
-
-          if (p1 < pend && (re_opcode_t) *p1 == start_memory)
-            {
-              /* We have a new highest active register now.  This will
-                 get reset at the start_memory we are about to get to,
-                 but we will have saved all the registers relevant to
-                 this repetition op, as described above.  */
-              highest_active_reg = *(p1 + 1) + *(p1 + 2);
-              if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
-                lowest_active_reg = *(p1 + 1);
-            }
-
-          DEBUG_PRINT1 (":\n");
-          PUSH_FAILURE_POINT (p + mcnt, d, -2);
-          break;
-
-
-        /* A smart repeat ends with `maybe_pop_jump'.
-          We change it to either `pop_failure_jump' or `jump'.  */
-        case maybe_pop_jump:
-          EXTRACT_NUMBER_AND_INCR (mcnt, p);
-          DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
-          {
-           register unsigned char *p2 = p;
-
-            /* Compare the beginning of the repeat with what in the
-               pattern follows its end. If we can establish that there
-               is nothing that they would both match, i.e., that we
-               would have to backtrack because of (as in, e.g., `a*a')
-               then we can change to pop_failure_jump, because we'll
-               never have to backtrack.
-               
-               This is not true in the case of alternatives: in
-               `(a|ab)*' we do need to backtrack to the `ab' alternative
-               (e.g., if the string was `ab').  But instead of trying to
-               detect that here, the alternative has put on a dummy
-               failure point which is what we will end up popping.  */
-
-           /* Skip over open/close-group commands.  */
-           while (p2 + 2 < pend
-                  && ((re_opcode_t) *p2 == stop_memory
-                      || (re_opcode_t) *p2 == start_memory))
-             p2 += 3;                  /* Skip over args, too.  */
-
-            /* If we're at the end of the pattern, we can change.  */
-            if (p2 == pend)
-             {
-               /* Consider what happens when matching ":\(.*\)"
-                  against ":/".  I don't really understand this code
-                  yet.  */
-               p[-3] = (unsigned char) pop_failure_jump;
-                DEBUG_PRINT1
-                  ("  End of pattern: change to `pop_failure_jump'.\n");
-              }
-
-            else if ((re_opcode_t) *p2 == exactn
-                    || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
-             {
-               register unsigned char c
-                  = *p2 == (unsigned char) endline ? '\n' : p2[2];
-               p1 = p + mcnt;
+         on_failure:
+           DEBUG_PRINT1("EXECUTING on_failure_jump");
+
+           EXTRACT_NUMBER_AND_INCR(mcnt, p);
+           DEBUG_PRINT3(" %d (to 0x%x)", mcnt, p + mcnt);
+
+           /* If this on_failure_jump comes right before a group (i.e.,
+            * the original * applied to a group), save the information
+            * for that group and all inner ones, so that if we fail back
+            * to this point, the group's information will be correct.
+            * For example, in \(a*\)*\1, we need the preceding group,
+            * and in \(\(a*\)b*\)\2, we need the inner group.  */
+
+           /* We can't use `p' to check ahead because we push
+            * a failure point to `p + mcnt' after we do this.  */
+           p1 = p;
+
+           /* We need to skip no_op's before we look for the
+            * start_memory in case this on_failure_jump is happening as
+            * the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
+            * against aba.  */
+           while (p1 < pend && (re_opcode_t) * p1 == no_op)
+               p1++;
+
+           if (p1 < pend && (re_opcode_t) * p1 == start_memory) {
+               /* We have a new highest active register now.  This will
+                * get reset at the start_memory we are about to get to,
+                * but we will have saved all the registers relevant to
+                * this repetition op, as described above.  */
+               highest_active_reg = *(p1 + 1) + *(p1 + 2);
+               if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+                   lowest_active_reg = *(p1 + 1);
+           }
+           DEBUG_PRINT1(":\n");
+           PUSH_FAILURE_POINT(p + mcnt, d, -2);
+           break;
+
 
-                /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
-                   to the `maybe_finalize_jump' of this case.  Examine what 
-                   follows.  */
-                if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
-                  {
-                   p[-3] = (unsigned char) pop_failure_jump;
-                    DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
-                                  c, p1[5]);
-                  }
-                  
-               else if ((re_opcode_t) p1[3] == charset
-                        || (re_opcode_t) p1[3] == charset_not)
-                 {
-                   int not = (re_opcode_t) p1[3] == charset_not;
-                    
-                   if (c < (unsigned char) (p1[4] * BYTEWIDTH)
-                       && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
-                     not = !not;
-
-                    /* `not' is equal to 1 if c would match, which means
-                        that we can't change to pop_failure_jump.  */
-                   if (!not)
-                      {
-                       p[-3] = (unsigned char) pop_failure_jump;
-                        DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
-                      }
-                 }
-             }
-         }
-         p -= 2;               /* Point at relative address again.  */
-         if ((re_opcode_t) p[-1] != pop_failure_jump)
+           /* A smart repeat ends with `maybe_pop_jump'.
+            * We change it to either `pop_failure_jump' or `jump'.  */
+       case maybe_pop_jump:
+           EXTRACT_NUMBER_AND_INCR(mcnt, p);
+           DEBUG_PRINT2("EXECUTING maybe_pop_jump %d.\n", mcnt);
            {
-             p[-1] = (unsigned char) jump;
-              DEBUG_PRINT1 ("  Match => jump.\n");
-             goto unconditional_jump;
+               register unsigned char *p2 = p;
+
+               /* Compare the beginning of the repeat with what in the
+                * pattern follows its end. If we can establish that there
+                * is nothing that they would both match, i.e., that we
+                * would have to backtrack because of (as in, e.g., `a*a')
+                * then we can change to pop_failure_jump, because we'll
+                * never have to backtrack.
+                * 
+                * This is not true in the case of alternatives: in
+                * `(a|ab)*' we do need to backtrack to the `ab' alternative
+                * (e.g., if the string was `ab').  But instead of trying to
+                * detect that here, the alternative has put on a dummy
+                * failure point which is what we will end up popping.  */
+
+               /* Skip over open/close-group commands.  */
+               while (p2 + 2 < pend
+                   && ((re_opcode_t) * p2 == stop_memory
+                       || (re_opcode_t) * p2 == start_memory))
+                   p2 += 3;    /* Skip over args, too.  */
+
+               /* If we're at the end of the pattern, we can change.  */
+               if (p2 == pend) {
+                   /* Consider what happens when matching ":\(.*\)"
+                    * against ":/".  I don't really understand this code
+                    * yet.  */
+                   p[-3] = (unsigned char) pop_failure_jump;
+                   DEBUG_PRINT1
+                       ("  End of pattern: change to `pop_failure_jump'.\n");
+               } else if ((re_opcode_t) * p2 == exactn
+                   || (bufp->newline_anchor && (re_opcode_t) * p2 == endline)) {
+                   register unsigned char c
+                   = *p2 == (unsigned char) endline ? '\n' : p2[2];
+                   p1 = p + mcnt;
+
+                   /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
+                    * to the `maybe_finalize_jump' of this case.  Examine what 
+                    * follows.  */
+                   if ((re_opcode_t) p1[3] == exactn && p1[5] != c) {
+                       p[-3] = (unsigned char) pop_failure_jump;
+                       DEBUG_PRINT3("  %c != %c => pop_failure_jump.\n",
+                           c, p1[5]);
+                   } else if ((re_opcode_t) p1[3] == charset
+                       || (re_opcode_t) p1[3] == charset_not) {
+                       int not = (re_opcode_t) p1[3] == charset_not;
+
+                       if (c < (unsigned char) (p1[4] * BYTEWIDTH)
+                           && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+                           not = !not;
+
+                       /* `not' is equal to 1 if c would match, which means
+                        * that we can't change to pop_failure_jump.  */
+                       if (!not) {
+                           p[-3] = (unsigned char) pop_failure_jump;
+                           DEBUG_PRINT1("  No match => pop_failure_jump.\n");
+                       }
+                   }
+               }
            }
-        /* Note fall through.  */
-
-
-       /* The end of a simple repeat has a pop_failure_jump back to
-           its matching on_failure_jump, where the latter will push a
-           failure point.  The pop_failure_jump takes off failure
-           points put on by this pop_failure_jump's matching
-           on_failure_jump; we got through the pattern to here from the
-           matching on_failure_jump, so didn't fail.  */
-        case pop_failure_jump:
-          {
-            /* We need to pass separate storage for the lowest and
-               highest registers, even though we don't care about the
-               actual values.  Otherwise, we will restore only one
-               register from the stack, since lowest will == highest in
-               `pop_failure_point'.  */
-            unsigned long dummy_low_reg, dummy_high_reg;
-            unsigned char *pdummy;
-            const char *sdummy;
-
-            DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
-            POP_FAILURE_POINT (sdummy, pdummy,
-                               dummy_low_reg, dummy_high_reg,
-                               reg_dummy, reg_dummy, reg_info_dummy);
-          }
-          /* Note fall through.  */
-
-          
-        /* Unconditionally jump (without popping any failure points).  */
-        case jump:
-       unconditional_jump:
-         EXTRACT_NUMBER_AND_INCR (mcnt, p);    /* Get the amount to jump.  */
-          DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
-         p += mcnt;                            /* Do the jump.  */
-          DEBUG_PRINT2 ("(to 0x%x).\n", p);
-         break;
-
-       
-        /* We need this opcode so we can detect where alternatives end
-           in `group_match_null_string_p' et al.  */
-        case jump_past_alt:
-          DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
-          goto unconditional_jump;
-
-
-        /* Normally, the on_failure_jump pushes a failure point, which
-           then gets popped at pop_failure_jump.  We will end up at
-           pop_failure_jump, also, and with a pattern of, say, `a+', we
-           are skipping over the on_failure_jump, so we have to push
-           something meaningless for pop_failure_jump to pop.  */
-        case dummy_failure_jump:
-          DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
-          /* It doesn't matter what we push for the string here.  What
-             the code at `fail' tests is the value for the pattern.  */
-          PUSH_FAILURE_POINT (0, 0, -2);
-          goto unconditional_jump;
-
-
-        /* At the end of an alternative, we need to push a dummy failure
-           point in case we are followed by a `pop_failure_jump', because
-           we don't want the failure point for the alternative to be
-           popped.  For example, matching `(a|ab)*' against `aab'
-           requires that we match the `ab' alternative.  */
-        case push_dummy_failure:
-          DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
-          /* See comments just above at `dummy_failure_jump' about the
-             two zeroes.  */
-          PUSH_FAILURE_POINT (0, 0, -2);
-          break;
-
-        /* Have to succeed matching what follows at least n times.
-           After that, handle like `on_failure_jump'.  */
-        case succeed_n: 
-          EXTRACT_NUMBER (mcnt, p + 2);
-          DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
-
-          assert (mcnt >= 0);
-          /* Originally, this is how many times we HAVE to succeed.  */
-          if (mcnt > 0)
-            {
-               mcnt--;
-              p += 2;
-               STORE_NUMBER_AND_INCR (p, mcnt);
-               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p, mcnt);
-            }
-         else if (mcnt == 0)
-            {
-              DEBUG_PRINT2 ("  Setting two bytes from 0x%x to no_op.\n", p+2);
-             p[2] = (unsigned char) no_op;
-              p[3] = (unsigned char) no_op;
-              goto on_failure;
-            }
-          break;
-        
-        case jump_n: 
-          EXTRACT_NUMBER (mcnt, p + 2);
-          DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
-
-          /* Originally, this is how many times we CAN jump.  */
-          if (mcnt)
-            {
-               mcnt--;
-               STORE_NUMBER (p + 2, mcnt);
-              goto unconditional_jump;      
-            }
-          /* If don't have to jump any more, skip over the rest of command.  */
-         else      
-           p += 4;                  
-          break;
-        
-       case set_number_at:
-         {
-            DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
-
-            EXTRACT_NUMBER_AND_INCR (mcnt, p);
-            p1 = p + mcnt;
-            EXTRACT_NUMBER_AND_INCR (mcnt, p);
-            DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p1, mcnt);
-           STORE_NUMBER (p1, mcnt);
-            break;
-          }
-
-        case wordbound:
-          DEBUG_PRINT1 ("EXECUTING wordbound.\n");
-          if (AT_WORD_BOUNDARY (d))
+           p -= 2;             /* Point at relative address again.  */
+           if ((re_opcode_t) p[-1] != pop_failure_jump) {
+               p[-1] = (unsigned char) jump;
+               DEBUG_PRINT1("  Match => jump.\n");
+               goto unconditional_jump;
+           }
+           /* Note fall through.  */
+
+
+           /* The end of a simple repeat has a pop_failure_jump back to
+            * its matching on_failure_jump, where the latter will push a
+            * failure point.  The pop_failure_jump takes off failure
+            * points put on by this pop_failure_jump's matching
+            * on_failure_jump; we got through the pattern to here from the
+            * matching on_failure_jump, so didn't fail.  */
+       case pop_failure_jump:
+           {
+               /* We need to pass separate storage for the lowest and
+                * highest registers, even though we don't care about the
+                * actual values.  Otherwise, we will restore only one
+                * register from the stack, since lowest will == highest in
+                * `pop_failure_point'.  */
+               unsigned long dummy_low_reg, dummy_high_reg;
+               unsigned char *pdummy;
+               const char *sdummy;
+
+               DEBUG_PRINT1("EXECUTING pop_failure_jump.\n");
+               POP_FAILURE_POINT(sdummy, pdummy,
+                   dummy_low_reg, dummy_high_reg,
+                   reg_dummy, reg_dummy, reg_info_dummy);
+           }
+           /* Note fall through.  */
+
+
+           /* Unconditionally jump (without popping any failure points).  */
+       case jump:
+         unconditional_jump:
+           EXTRACT_NUMBER_AND_INCR(mcnt, p);   /* Get the amount to jump.  */
+           DEBUG_PRINT2("EXECUTING jump %d ", mcnt);
+           p += mcnt;          /* Do the jump.  */
+           DEBUG_PRINT2("(to 0x%x).\n", p);
            break;
-          goto fail;
 
-       case notwordbound:
-          DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
-         if (AT_WORD_BOUNDARY (d))
+
+           /* We need this opcode so we can detect where alternatives end
+            * in `group_match_null_string_p' et al.  */
+       case jump_past_alt:
+           DEBUG_PRINT1("EXECUTING jump_past_alt.\n");
+           goto unconditional_jump;
+
+
+           /* Normally, the on_failure_jump pushes a failure point, which
+            * then gets popped at pop_failure_jump.  We will end up at
+            * pop_failure_jump, also, and with a pattern of, say, `a+', we
+            * are skipping over the on_failure_jump, so we have to push
+            * something meaningless for pop_failure_jump to pop.  */
+       case dummy_failure_jump:
+           DEBUG_PRINT1("EXECUTING dummy_failure_jump.\n");
+           /* It doesn't matter what we push for the string here.  What
+            * the code at `fail' tests is the value for the pattern.  */
+           PUSH_FAILURE_POINT(0, 0, -2);
+           goto unconditional_jump;
+
+
+           /* At the end of an alternative, we need to push a dummy failure
+            * point in case we are followed by a `pop_failure_jump', because
+            * we don't want the failure point for the alternative to be
+            * popped.  For example, matching `(a|ab)*' against `aab'
+            * requires that we match the `ab' alternative.  */
+       case push_dummy_failure:
+           DEBUG_PRINT1("EXECUTING push_dummy_failure.\n");
+           /* See comments just above at `dummy_failure_jump' about the
+            * two zeroes.  */
+           PUSH_FAILURE_POINT(0, 0, -2);
+           break;
+
+           /* Have to succeed matching what follows at least n times.
+            * After that, handle like `on_failure_jump'.  */
+       case succeed_n:
+           EXTRACT_NUMBER(mcnt, p + 2);
+           DEBUG_PRINT2("EXECUTING succeed_n %d.\n", mcnt);
+
+           assert(mcnt >= 0);
+           /* Originally, this is how many times we HAVE to succeed.  */
+           if (mcnt > 0) {
+               mcnt--;
+               p += 2;
+               STORE_NUMBER_AND_INCR(p, mcnt);
+               DEBUG_PRINT3("  Setting 0x%x to %d.\n", p, mcnt);
+           } else if (mcnt == 0) {
+               DEBUG_PRINT2("  Setting two bytes from 0x%x to no_op.\n", p + 2);
+               p[2] = (unsigned char) no_op;
+               p[3] = (unsigned char) no_op;
+               goto on_failure;
+           }
+           break;
+
+       case jump_n:
+           EXTRACT_NUMBER(mcnt, p + 2);
+           DEBUG_PRINT2("EXECUTING jump_n %d.\n", mcnt);
+
+           /* Originally, this is how many times we CAN jump.  */
+           if (mcnt) {
+               mcnt--;
+               STORE_NUMBER(p + 2, mcnt);
+               goto unconditional_jump;
+           }
+           /* If don't have to jump any more, skip over the rest of command.  */
+           else
+               p += 4;
+           break;
+
+       case set_number_at:
+           {
+               DEBUG_PRINT1("EXECUTING set_number_at.\n");
+
+               EXTRACT_NUMBER_AND_INCR(mcnt, p);
+               p1 = p + mcnt;
+               EXTRACT_NUMBER_AND_INCR(mcnt, p);
+               DEBUG_PRINT3("  Setting 0x%x to %d.\n", p1, mcnt);
+               STORE_NUMBER(p1, mcnt);
+               break;
+           }
+
+       case wordbound:
+           DEBUG_PRINT1("EXECUTING wordbound.\n");
+           if (AT_WORD_BOUNDARY(d))
+               break;
            goto fail;
-          break;
 
-       case wordbeg:
-          DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
-         if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+       case notwordbound:
+           DEBUG_PRINT1("EXECUTING notwordbound.\n");
+           if (AT_WORD_BOUNDARY(d))
+               goto fail;
            break;
-          goto fail;
+
+       case wordbeg:
+           DEBUG_PRINT1("EXECUTING wordbeg.\n");
+           if (WORDCHAR_P(d) && (AT_STRINGS_BEG(d) || !WORDCHAR_P(d - 1)))
+               break;
+           goto fail;
 
        case wordend:
-          DEBUG_PRINT1 ("EXECUTING wordend.\n");
-         if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
-              && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
-           break;
-          goto fail;
+           DEBUG_PRINT1("EXECUTING wordend.\n");
+           if (!AT_STRINGS_BEG(d) && WORDCHAR_P(d - 1)
+               && (!WORDCHAR_P(d) || AT_STRINGS_END(d)))
+               break;
+           goto fail;
 
 #ifdef emacs
 #ifdef emacs19
-       case before_dot:
-          DEBUG_PRINT1 ("EXECUTING before_dot.\n");
-         if (PTR_CHAR_POS ((unsigned char *) d) >= point)
-           goto fail;
-         break;
-  
-       case at_dot:
-          DEBUG_PRINT1 ("EXECUTING at_dot.\n");
-         if (PTR_CHAR_POS ((unsigned char *) d) != point)
-           goto fail;
-         break;
-  
-       case after_dot:
-          DEBUG_PRINT1 ("EXECUTING after_dot.\n");
-          if (PTR_CHAR_POS ((unsigned char *) d) <= point)
-           goto fail;
-         break;
+       case before_dot:
+           DEBUG_PRINT1("EXECUTING before_dot.\n");
+           if (PTR_CHAR_POS((unsigned char *) d) >= point)
+               goto fail;
+           break;
+
+       case at_dot:
+           DEBUG_PRINT1("EXECUTING at_dot.\n");
+           if (PTR_CHAR_POS((unsigned char *) d) != point)
+               goto fail;
+           break;
+
+       case after_dot:
+           DEBUG_PRINT1("EXECUTING after_dot.\n");
+           if (PTR_CHAR_POS((unsigned char *) d) <= point)
+               goto fail;
+           break;
 #else /* not emacs19 */
        case at_dot:
-          DEBUG_PRINT1 ("EXECUTING at_dot.\n");
-         if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
-           goto fail;
-         break;
+           DEBUG_PRINT1("EXECUTING at_dot.\n");
+           if (PTR_CHAR_POS((unsigned char *) d) + 1 != point)
+               goto fail;
+           break;
 #endif /* not emacs19 */
 
        case syntaxspec:
-          DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
-         mcnt = *p++;
-         goto matchsyntax;
-
-        case wordchar:
-          DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
-         mcnt = (int) Sword;
-        matchsyntax:
-         PREFETCH ();
-         if (SYNTAX (*d++) != (enum syntaxcode) mcnt)
-            goto fail;
-          SET_REGS_MATCHED ();
-         break;
+           DEBUG_PRINT2("EXECUTING syntaxspec %d.\n", mcnt);
+           mcnt = *p++;
+           goto matchsyntax;
+
+       case wordchar:
+           DEBUG_PRINT1("EXECUTING Emacs wordchar.\n");
+           mcnt = (int) Sword;
+         matchsyntax:
+           PREFETCH();
+           if (SYNTAX(*d++) != (enum syntaxcode) mcnt)
+               goto fail;
+           SET_REGS_MATCHED();
+           break;
 
        case notsyntaxspec:
-          DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
-         mcnt = *p++;
-         goto matchnotsyntax;
-
-        case notwordchar:
-          DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
-         mcnt = (int) Sword;
-        matchnotsyntax:
-         PREFETCH ();
-         if (SYNTAX (*d++) == (enum syntaxcode) mcnt)
-            goto fail;
-         SET_REGS_MATCHED ();
-          break;
+           DEBUG_PRINT2("EXECUTING notsyntaxspec %d.\n", mcnt);
+           mcnt = *p++;
+           goto matchnotsyntax;
+
+       case notwordchar:
+           DEBUG_PRINT1("EXECUTING Emacs notwordchar.\n");
+           mcnt = (int) Sword;
+         matchnotsyntax:
+           PREFETCH();
+           if (SYNTAX(*d++) == (enum syntaxcode) mcnt)
+               goto fail;
+           SET_REGS_MATCHED();
+           break;
 
 #else /* not emacs */
        case wordchar:
-          DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
-         PREFETCH ();
-          if (!WORDCHAR_P (d))
-            goto fail;
-         SET_REGS_MATCHED ();
-          d++;
-         break;
-         
+           DEBUG_PRINT1("EXECUTING non-Emacs wordchar.\n");
+           PREFETCH();
+           if (!WORDCHAR_P(d))
+               goto fail;
+           SET_REGS_MATCHED();
+           d++;
+           break;
+
        case notwordchar:
-          DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
-         PREFETCH ();
-         if (WORDCHAR_P (d))
-            goto fail;
-          SET_REGS_MATCHED ();
-          d++;
-         break;
+           DEBUG_PRINT1("EXECUTING non-Emacs notwordchar.\n");
+           PREFETCH();
+           if (WORDCHAR_P(d))
+               goto fail;
+           SET_REGS_MATCHED();
+           d++;
+           break;
 #endif /* not emacs */
-          
-        default:
-          abort ();
-       }
-      continue;  /* Successfully executed one pattern command; keep going.  */
 
+       default:
+           abort();
+       }
+       continue;               /* Successfully executed one pattern command; keep going.  */
+
+
+       /* We goto here if a matching operation fails. */
+      fail:
+       if (!FAIL_STACK_EMPTY()) {      /* A restart point is known.  Restore to that state.  */
+           DEBUG_PRINT1("\nFAIL:\n");
+           POP_FAILURE_POINT(d, p,
+               lowest_active_reg, highest_active_reg,
+               regstart, regend, reg_info);
+
+           /* If this failure point is a dummy, try the next one.  */
+           if (!p)
+               goto fail;
+
+           /* If we failed to the end of the pattern, don't examine *p.  */
+           assert(p <= pend);
+           if (p < pend) {
+               boolean is_a_jump_n = false;
+
+               /* If failed to a backwards jump that's part of a repetition
+                * loop, need to pop this failure point and use the next one.  */
+               switch ((re_opcode_t) * p) {
+               case jump_n:
+                   is_a_jump_n = true;
+               case maybe_pop_jump:
+               case pop_failure_jump:
+               case jump:
+                   p1 = p + 1;
+                   EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+                   p1 += mcnt;
+
+                   if ((is_a_jump_n && (re_opcode_t) * p1 == succeed_n)
+                       || (!is_a_jump_n
+                           && (re_opcode_t) * p1 == on_failure_jump))
+                       goto fail;
+                   break;
+               default:
+                   /* do nothing */ ;
+               }
+           }
+           if (d >= string1 && d <= end1)
+               dend = end_match_1;
+       } else
+           break;              /* Matching at this starting point really fails.  */
+    }                          /* for (;;) */
 
-    /* We goto here if a matching operation fails. */
-    fail:
-      if (!FAIL_STACK_EMPTY ())
-       { /* A restart point is known.  Restore to that state.  */
-          DEBUG_PRINT1 ("\nFAIL:\n");
-          POP_FAILURE_POINT (d, p,
-                             lowest_active_reg, highest_active_reg,
-                             regstart, regend, reg_info);
+    if (best_regs_set)
+       goto restore_best_regs;
 
-          /* If this failure point is a dummy, try the next one.  */
-          if (!p)
-           goto fail;
+    FREE_VARIABLES();
 
-          /* If we failed to the end of the pattern, don't examine *p.  */
-         assert (p <= pend);
-          if (p < pend)
-            {
-              boolean is_a_jump_n = false;
-              
-              /* If failed to a backwards jump that's part of a repetition
-                 loop, need to pop this failure point and use the next one.  */
-              switch ((re_opcode_t) *p)
-                {
-                case jump_n:
-                  is_a_jump_n = true;
-                case maybe_pop_jump:
-                case pop_failure_jump:
-                case jump:
-                  p1 = p + 1;
-                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-                  p1 += mcnt;  
-
-                  if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
-                      || (!is_a_jump_n
-                          && (re_opcode_t) *p1 == on_failure_jump))
-                    goto fail;
-                  break;
-                default:
-                  /* do nothing */ ;
-                }
-            }
-
-          if (d >= string1 && d <= end1)
-           dend = end_match_1;
-        }
-      else
-        break;   /* Matching at this starting point really fails.  */
-    } /* for (;;) */
-
-  if (best_regs_set)
-    goto restore_best_regs;
-
-  FREE_VARIABLES ();
-
-  return -1;                           /* Failure to match.  */
-} /* re_match_2 */
+    return -1;                 /* Failure to match.  */
+}                              /* re_match_2 */
 \f
 /* Subroutine definitions for re_match_2.  */
 
 
 /* We are passed P pointing to a register number after a start_memory.
-   
  Return true if the pattern up to the corresponding stop_memory can
  match the empty string, and false otherwise.
-   
  If we find the matching stop_memory, sets P to point to one past its number.
  Otherwise, sets P to an undefined byte less than or equal to END.
-
  We don't handle duplicates properly (yet).  */
+ * 
* Return true if the pattern up to the corresponding stop_memory can
* match the empty string, and false otherwise.
+ * 
* If we find the matching stop_memory, sets P to point to one past its number.
* Otherwise, sets P to an undefined byte less than or equal to END.
+ * 
* We don't handle duplicates properly (yet).  */
 
 static boolean
-group_match_null_string_p (p, end, reg_info)
-    unsigned char **p, *end;
-    register_info_type *reg_info;
+group_match_null_string_p(p, end, reg_info)
+     unsigned char **p, *end;
+     register_info_type *reg_info;
 {
-  int mcnt;
-  /* Point to after the args to the start_memory.  */
-  unsigned char *p1 = *p + 2;
-  
-  while (p1 < end)
-    {
-      /* Skip over opcodes that can match nothing, and return true or
-        false, as appropriate, when we get to one that can't, or to the
-         matching stop_memory.  */
-      
-      switch ((re_opcode_t) *p1)
-        {
-        /* Could be either a loop or a series of alternatives.  */
-        case on_failure_jump:
-          p1++;
-          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-          
-          /* If the next operation is not a jump backwards in the
-            pattern.  */
-
-         if (mcnt >= 0)
-           {
-              /* Go through the on_failure_jumps of the alternatives,
-                 seeing if any of the alternatives cannot match nothing.
-                 The last alternative starts with only a jump,
-                 whereas the rest start with on_failure_jump and end
-                 with a jump, e.g., here is the pattern for `a|b|c':
-
-                 /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
-                 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
-                 /exactn/1/c                                           
-
-                 So, we have to first go through the first (n-1)
-                 alternatives and then deal with the last one separately.  */
-
-
-              /* Deal with the first (n-1) alternatives, which start
-                 with an on_failure_jump (see above) that jumps to right
-                 past a jump_past_alt.  */
-
-              while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
-                {
-                  /* `mcnt' holds how many bytes long the alternative
-                     is, including the ending `jump_past_alt' and
-                     its number.  */
-
-                  if (!alt_match_null_string_p (p1, p1 + mcnt - 3, 
-                                                     reg_info))
-                    return false;
-
-                  /* Move to right after this alternative, including the
-                    jump_past_alt.  */
-                  p1 += mcnt;  
-
-                  /* Break if it's the beginning of an n-th alternative
-                     that doesn't begin with an on_failure_jump.  */
-                  if ((re_opcode_t) *p1 != on_failure_jump)
-                    break;
-               
-                 /* Still have to check that it's not an n-th
-                    alternative that starts with an on_failure_jump.  */
-                 p1++;
-                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-                  if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
-                    {
-                     /* Get to the beginning of the n-th alternative.  */
-                      p1 -= 3;
-                      break;
-                    }
-                }
-
-              /* Deal with the last alternative: go back and get number
-                 of the `jump_past_alt' just before it.  `mcnt' contains
-                 the length of the alternative.  */
-              EXTRACT_NUMBER (mcnt, p1 - 2);
-
-              if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
-                return false;
-
-              p1 += mcnt;      /* Get past the n-th alternative.  */
-            } /* if mcnt > 0 */
-          break;
-
-          
-        case stop_memory:
-         assert (p1[1] == **p);
-          *p = p1 + 2;
-          return true;
-
-        
-        default: 
-          if (!common_op_match_null_string_p (&p1, end, reg_info))
-            return false;
-        }
-    } /* while p1 < end */
-
-  return false;
-} /* group_match_null_string_p */
+    int mcnt;
+    /* Point to after the args to the start_memory.  */
+    unsigned char *p1 = *p + 2;
+
+    while (p1 < end) {
+       /* Skip over opcodes that can match nothing, and return true or
+        * false, as appropriate, when we get to one that can't, or to the
+        * matching stop_memory.  */
+
+       switch ((re_opcode_t) * p1) {
+           /* Could be either a loop or a series of alternatives.  */
+       case on_failure_jump:
+           p1++;
+           EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+
+           /* If the next operation is not a jump backwards in the
+            * pattern.  */
+
+           if (mcnt >= 0) {
+               /* Go through the on_failure_jumps of the alternatives,
+                * seeing if any of the alternatives cannot match nothing.
+                * The last alternative starts with only a jump,
+                * whereas the rest start with on_failure_jump and end
+                * with a jump, e.g., here is the pattern for `a|b|c':
+                * 
+                * /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
+                * /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
+                * /exactn/1/c                                            
+                * 
+                * So, we have to first go through the first (n-1)
+                * alternatives and then deal with the last one separately.  */
+
+
+               /* Deal with the first (n-1) alternatives, which start
+                * with an on_failure_jump (see above) that jumps to right
+                * past a jump_past_alt.  */
+
+               while ((re_opcode_t) p1[mcnt - 3] == jump_past_alt) {
+                   /* `mcnt' holds how many bytes long the alternative
+                    * is, including the ending `jump_past_alt' and
+                    * its number.  */
+
+                   if (!alt_match_null_string_p(p1, p1 + mcnt - 3,
+                           reg_info))
+                       return false;
+
+                   /* Move to right after this alternative, including the
+                    * jump_past_alt.  */
+                   p1 += mcnt;
+
+                   /* Break if it's the beginning of an n-th alternative
+                    * that doesn't begin with an on_failure_jump.  */
+                   if ((re_opcode_t) * p1 != on_failure_jump)
+                       break;
+
+                   /* Still have to check that it's not an n-th
+                    * alternative that starts with an on_failure_jump.  */
+                   p1++;
+                   EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+                   if ((re_opcode_t) p1[mcnt - 3] != jump_past_alt) {
+                       /* Get to the beginning of the n-th alternative.  */
+                       p1 -= 3;
+                       break;
+                   }
+               }
+
+               /* Deal with the last alternative: go back and get number
+                * of the `jump_past_alt' just before it.  `mcnt' contains
+                * the length of the alternative.  */
+               EXTRACT_NUMBER(mcnt, p1 - 2);
+
+               if (!alt_match_null_string_p(p1, p1 + mcnt, reg_info))
+                   return false;
+
+               p1 += mcnt;     /* Get past the n-th alternative.  */
+           }                   /* if mcnt > 0 */
+           break;
+
+
+       case stop_memory:
+           assert(p1[1] == **p);
+           *p = p1 + 2;
+           return true;
+
+
+       default:
+           if (!common_op_match_null_string_p(&p1, end, reg_info))
+               return false;
+       }
+    }                          /* while p1 < end */
+
+    return false;
+}                              /* group_match_null_string_p */
 
 
 /* Similar to group_match_null_string_p, but doesn't deal with alternatives:
  It expects P to be the first byte of a single alternative and END one
  byte past the last. The alternative can contain groups.  */
-   
* It expects P to be the first byte of a single alternative and END one
* byte past the last. The alternative can contain groups.  */
+
 static boolean
-alt_match_null_string_p (p, end, reg_info)
-    unsigned char *p, *end;
-    register_info_type *reg_info;
+alt_match_null_string_p(p, end, reg_info)
+     unsigned char *p, *end;
+     register_info_type *reg_info;
 {
-  int mcnt;
-  unsigned char *p1 = p;
-  
-  while (p1 < end)
-    {
-      /* Skip over opcodes that can match nothing, and break when we get 
-         to one that can't.  */
-      
-      switch ((re_opcode_t) *p1)
-        {
-       /* It's a loop.  */
-        case on_failure_jump:
-          p1++;
-          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-          p1 += mcnt;
-          break;
-          
-       default: 
-          if (!common_op_match_null_string_p (&p1, end, reg_info))
-            return false;
-        }
-    }  /* while p1 < end */
-
-  return true;
-} /* alt_match_null_string_p */
+    int mcnt;
+    unsigned char *p1 = p;
+
+    while (p1 < end) {
+       /* Skip over opcodes that can match nothing, and break when we get 
+        * to one that can't.  */
+
+       switch ((re_opcode_t) * p1) {
+           /* It's a loop.  */
+       case on_failure_jump:
+           p1++;
+           EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+           p1 += mcnt;
+           break;
+
+       default:
+           if (!common_op_match_null_string_p(&p1, end, reg_info))
+               return false;
+       }
+    }                          /* while p1 < end */
+
+    return true;
+}                              /* alt_match_null_string_p */
 
 
 /* Deals with the ops common to group_match_null_string_p and
  alt_match_null_string_p.  
-   
  Sets P to one after the op and its arguments, if any.  */
* alt_match_null_string_p.  
+ * 
* Sets P to one after the op and its arguments, if any.  */
 
 static boolean
-common_op_match_null_string_p (p, end, reg_info)
-    unsigned char **p, *end;
-    register_info_type *reg_info;
+common_op_match_null_string_p(p, end, reg_info)
+     unsigned char **p, *end;
+     register_info_type *reg_info;
 {
-  int mcnt;
-  boolean ret;
-  int reg_no;
-  unsigned char *p1 = *p;
+    int mcnt;
+    boolean ret;
+    int reg_no;
+    unsigned char *p1 = *p;
 
-  switch ((re_opcode_t) *p1++)
-    {
+    switch ((re_opcode_t) * p1++) {
     case no_op:
     case begline:
     case endline:
@@ -4524,121 +4353,119 @@ common_op_match_null_string_p (p, end, reg_info)
     case at_dot:
     case after_dot:
 #endif
-      break;
+       break;
 
     case start_memory:
-      reg_no = *p1;
-      assert (reg_no > 0 && reg_no <= MAX_REGNUM);
-      ret = group_match_null_string_p (&p1, end, reg_info);
-      
-      /* Have to set this here in case we're checking a group which
-         contains a group and a back reference to it.  */
-
-      if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
-        REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
-
-      if (!ret)
-        return false;
-      break;
-          
-    /* If this is an optimized succeed_n for zero times, make the jump.  */
+       reg_no = *p1;
+       assert(reg_no > 0 && reg_no <= MAX_REGNUM);
+       ret = group_match_null_string_p(&p1, end, reg_info);
+
+       /* Have to set this here in case we're checking a group which
+        * contains a group and a back reference to it.  */
+
+       if (REG_MATCH_NULL_STRING_P(reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
+           REG_MATCH_NULL_STRING_P(reg_info[reg_no]) = ret;
+
+       if (!ret)
+           return false;
+       break;
+
+       /* If this is an optimized succeed_n for zero times, make the jump.  */
     case jump:
-      EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-      if (mcnt >= 0)
-        p1 += mcnt;
-      else
-        return false;
-      break;
+       EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+       if (mcnt >= 0)
+           p1 += mcnt;
+       else
+           return false;
+       break;
 
     case succeed_n:
-      /* Get to the number of times to succeed.  */
-      p1 += 2;         
-      EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
-      if (mcnt == 0)
-        {
-          p1 -= 4;
-          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-          p1 += mcnt;
-        }
-      else
-        return false;
-      break;
-
-    case duplicate: 
-      if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
-        return false;
-      break;
+       /* Get to the number of times to succeed.  */
+       p1 += 2;
+       EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+
+       if (mcnt == 0) {
+           p1 -= 4;
+           EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+           p1 += mcnt;
+       } else
+           return false;
+       break;
+
+    case duplicate:
+       if (!REG_MATCH_NULL_STRING_P(reg_info[*p1]))
+           return false;
+       break;
 
     case set_number_at:
-      p1 += 4;
+       p1 += 4;
 
     default:
-      /* All other opcodes mean we cannot match the empty string.  */
-      return false;
-  }
+       /* All other opcodes mean we cannot match the empty string.  */
+       return false;
+    }
 
-  *p = p1;
-  return true;
-} /* common_op_match_null_string_p */
+    *p = p1;
+    return true;
+}                              /* common_op_match_null_string_p */
 
 
 /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
  bytes; nonzero otherwise.  */
-   
* bytes; nonzero otherwise.  */
+
 static int
-bcmp_translate (s1, s2, len, translate)
+bcmp_translate(s1, s2, len, translate)
      unsigned char *s1, *s2;
      register int len;
      char *translate;
 {
-  register unsigned char *p1 = s1, *p2 = s2;
-  while (len)
-    {
-      if (translate[*p1++] != translate[*p2++]) return 1;
-      len--;
+    register unsigned char *p1 = s1, *p2 = s2;
+    while (len) {
+       if (translate[*p1++] != translate[*p2++])
+           return 1;
+       len--;
     }
-  return 0;
+    return 0;
 }
 \f
 /* Entry points for GNU code.  */
 
 /* re_compile_pattern is the GNU regular expression compiler: it
  compiles PATTERN (of length SIZE) and puts the result in BUFP.
  Returns 0 if the pattern was valid, otherwise an error string.
-   
  Assumes the `allocated' (and perhaps `buffer') and `translate' fields
  are set in BUFP on entry.
-   
  We call regex_compile to do the actual compilation.  */
* compiles PATTERN (of length SIZE) and puts the result in BUFP.
* Returns 0 if the pattern was valid, otherwise an error string.
+ * 
* Assumes the `allocated' (and perhaps `buffer') and `translate' fields
* are set in BUFP on entry.
+ * 
* We call regex_compile to do the actual compilation.  */
 
 const char *
-re_compile_pattern (pattern, length, bufp)
+re_compile_pattern(pattern, length, bufp)
      const char *pattern;
      int length;
      struct re_pattern_buffer *bufp;
 {
-  reg_errcode_t ret;
-  
-  /* GNU code is written to assume at least RE_NREGS registers will be set
-     (and at least one extra will be -1).  */
-  bufp->regs_allocated = REGS_UNALLOCATED;
-  
-  /* And GNU code determines whether or not to get register information
-     by passing null for the REGS argument to re_match, etc., not by
-     setting no_sub.  */
-  bufp->no_sub = 0;
-  
-  /* Match anchors at newline.  */
-  bufp->newline_anchor = 1;
-  
-  ret = regex_compile (pattern, length, re_syntax_options, bufp);
-
-  return re_error_msg[(int) ret];
-}     
+    reg_errcode_t ret;
+
+    /* GNU code is written to assume at least RE_NREGS registers will be set
+     (and at least one extra will be -1).  */
+    bufp->regs_allocated = REGS_UNALLOCATED;
+
+    /* And GNU code determines whether or not to get register information
+     by passing null for the REGS argument to re_match, etc., not by
+     setting no_sub.  */
+    bufp->no_sub = 0;
+
+    /* Match anchors at newline.  */
+    bufp->newline_anchor = 1;
+
+    ret = regex_compile(pattern, length, re_syntax_options, bufp);
+
+    return re_error_msg[(int) ret];
+}
 \f
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
  them if this is an Emacs or POSIX compilation.  */
* them if this is an Emacs or POSIX compilation.  */
 
 #if !defined (emacs) && !defined (_POSIX_SOURCE)
 
@@ -4646,51 +4473,48 @@ re_compile_pattern (pattern, length, bufp)
 static struct re_pattern_buffer re_comp_buf;
 
 char *
-re_comp (s)
-    const char *s;
+re_comp(s)
+     const char *s;
 {
-  reg_errcode_t ret;
-  
-  if (!s)
-    {
-      if (!re_comp_buf.buffer)
-       return "No previous regular expression";
-      return 0;
-    }
-
-  if (!re_comp_buf.buffer)
-    {
-      re_comp_buf.buffer = (unsigned char *) malloc (200);
-      if (re_comp_buf.buffer == NULL)
-        return "Memory exhausted";
-      re_comp_buf.allocated = 200;
+    reg_errcode_t ret;
 
-      re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
-      if (re_comp_buf.fastmap == NULL)
-       return "Memory exhausted";
+    if (!s) {
+       if (!re_comp_buf.buffer)
+           return "No previous regular expression";
+       return 0;
     }
+    if (!re_comp_buf.buffer) {
+       re_comp_buf.buffer = (unsigned char *) malloc(200);
+       if (re_comp_buf.buffer == NULL)
+           return "Memory exhausted";
+       re_comp_buf.allocated = 200;
+
+       re_comp_buf.fastmap = (char *) malloc(1 << BYTEWIDTH);
+       if (re_comp_buf.fastmap == NULL)
+           return "Memory exhausted";
+    }
+    /* Since `re_exec' always passes NULL for the `regs' argument, we
+     * don't need to initialize the pattern buffer fields which affect it.  */
 
-  /* Since `re_exec' always passes NULL for the `regs' argument, we
-     don't need to initialize the pattern buffer fields which affect it.  */
+    /* Match anchors at newlines.  */
+    re_comp_buf.newline_anchor = 1;
 
-  /* Match anchors at newlines.  */
-  re_comp_buf.newline_anchor = 1;
+    ret = regex_compile(s, strlen(s), re_syntax_options, &re_comp_buf);
 
-  ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-  
-  /* Yes, we're discarding `const' here.  */
-  return (char *) re_error_msg[(int) ret];
+    /* Yes, we're discarding `const' here.  */
+    return (char *) re_error_msg[(int) ret];
 }
 
 
 int
-re_exec (s)
-    const char *s;
+re_exec(s)
+     const char *s;
 {
-  const int len = strlen (s);
-  return
-    0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+    const int len = strlen(s);
+    return
+       0 <= re_search(&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
 }
+
 #endif /* not emacs and not _POSIX_SOURCE */
 \f
 /* POSIX.2 functions.  Don't define these for Emacs.  */
@@ -4698,250 +4522,236 @@ re_exec (s)
 #ifndef emacs
 
 /* regcomp takes a regular expression as a string and compiles it.
-
  PREG is a regex_t *.  We do not expect any fields to be initialized,
  since POSIX says we shouldn't.  Thus, we set
-
    `buffer' to the compiled pattern;
    `used' to the length of the compiled pattern;
    `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
      REG_EXTENDED bit in CFLAGS is set; otherwise, to
      RE_SYNTAX_POSIX_BASIC;
    `newline_anchor' to REG_NEWLINE being set in CFLAGS;
    `fastmap' and `fastmap_accurate' to zero;
    `re_nsub' to the number of subexpressions in PATTERN.
-
  PATTERN is the address of the pattern string.
-
  CFLAGS is a series of bits which affect compilation.
-
    If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
    use POSIX basic syntax.
-
    If REG_NEWLINE is set, then . and [^...] don't match newline.
    Also, regexec will try a match beginning after every newline.
-
    If REG_ICASE is set, then we considers upper- and lowercase
    versions of letters to be equivalent when matching.
-
    If REG_NOSUB is set, then when PREG is passed to regexec, that
    routine will report only success or failure, and nothing about the
    registers.
-
  It returns 0 if it succeeds, nonzero if it doesn't.  (See regex.h for
  the return codes and their meanings.)  */
+ * 
* PREG is a regex_t *.  We do not expect any fields to be initialized,
* since POSIX says we shouldn't.  Thus, we set
+ * 
* `buffer' to the compiled pattern;
* `used' to the length of the compiled pattern;
* `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
* REG_EXTENDED bit in CFLAGS is set; otherwise, to
* RE_SYNTAX_POSIX_BASIC;
* `newline_anchor' to REG_NEWLINE being set in CFLAGS;
* `fastmap' and `fastmap_accurate' to zero;
* `re_nsub' to the number of subexpressions in PATTERN.
+ * 
* PATTERN is the address of the pattern string.
+ * 
* CFLAGS is a series of bits which affect compilation.
+ * 
* If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
* use POSIX basic syntax.
+ * 
* If REG_NEWLINE is set, then . and [^...] don't match newline.
* Also, regexec will try a match beginning after every newline.
+ * 
* If REG_ICASE is set, then we considers upper- and lowercase
* versions of letters to be equivalent when matching.
+ * 
* If REG_NOSUB is set, then when PREG is passed to regexec, that
* routine will report only success or failure, and nothing about the
* registers.
+ * 
* It returns 0 if it succeeds, nonzero if it doesn't.  (See regex.h for
* the return codes and their meanings.)  */
 
 int
-regcomp (preg, pattern, cflags)
-    regex_t *preg;
-    const char *pattern; 
-    int cflags;
+regcomp(preg, pattern, cflags)
+     regex_t *preg;
+     const char *pattern;
+     int cflags;
 {
-  reg_errcode_t ret;
-  unsigned syntax
+    reg_errcode_t ret;
+    unsigned syntax
     = (cflags & REG_EXTENDED) ?
-      RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
-
-  /* regex_compile will allocate the space for the compiled pattern.  */
-  preg->buffer = 0;
-  preg->allocated = 0;
-  
-  /* Don't bother to use a fastmap when searching.  This simplifies the
-     REG_NEWLINE case: if we used a fastmap, we'd have to put all the
-     characters after newlines into the fastmap.  This way, we just try
-     every character.  */
-  preg->fastmap = 0;
-  
-  if (cflags & REG_ICASE)
-    {
-      unsigned i;
-      
-      preg->translate = (char *) malloc (CHAR_SET_SIZE);
-      if (preg->translate == NULL)
-        return (int) REG_ESPACE;
-
-      /* Map uppercase characters to corresponding lowercase ones.  */
-      for (i = 0; i < CHAR_SET_SIZE; i++)
-        preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
-    }
-  else
-    preg->translate = NULL;
-
-  /* If REG_NEWLINE is set, newlines are treated differently.  */
-  if (cflags & REG_NEWLINE)
-    { /* REG_NEWLINE implies neither . nor [^...] match newline.  */
-      syntax &= ~RE_DOT_NEWLINE;
-      syntax |= RE_HAT_LISTS_NOT_NEWLINE;
-      /* It also changes the matching behavior.  */
-      preg->newline_anchor = 1;
-    }
-  else
-    preg->newline_anchor = 0;
-
-  preg->no_sub = !!(cflags & REG_NOSUB);
-
-  /* POSIX says a null character in the pattern terminates it, so we 
-     can use strlen here in compiling the pattern.  */
-  ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-  
-  /* POSIX doesn't distinguish between an unmatched open-group and an
-     unmatched close-group: both are REG_EPAREN.  */
-  if (ret == REG_ERPAREN) ret = REG_EPAREN;
-  
-  return (int) ret;
+    RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
+
+    /* regex_compile will allocate the space for the compiled pattern.  */
+    preg->buffer = 0;
+    preg->allocated = 0;
+
+    /* Don't bother to use a fastmap when searching.  This simplifies the
+     * REG_NEWLINE case: if we used a fastmap, we'd have to put all the
+     * characters after newlines into the fastmap.  This way, we just try
+     * every character.  */
+    preg->fastmap = 0;
+
+    if (cflags & REG_ICASE) {
+       unsigned i;
+
+       preg->translate = (char *) malloc(CHAR_SET_SIZE);
+       if (preg->translate == NULL)
+           return (int) REG_ESPACE;
+
+       /* Map uppercase characters to corresponding lowercase ones.  */
+       for (i = 0; i < CHAR_SET_SIZE; i++)
+           preg->translate[i] = ISUPPER(i) ? tolower(i) : i;
+    } else
+       preg->translate = NULL;
+
+    /* If REG_NEWLINE is set, newlines are treated differently.  */
+    if (cflags & REG_NEWLINE) {        /* REG_NEWLINE implies neither . nor [^...] match newline.  */
+       syntax &= ~RE_DOT_NEWLINE;
+       syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+       /* It also changes the matching behavior.  */
+       preg->newline_anchor = 1;
+    } else
+       preg->newline_anchor = 0;
+
+    preg->no_sub = !!(cflags & REG_NOSUB);
+
+    /* POSIX says a null character in the pattern terminates it, so we 
+     * can use strlen here in compiling the pattern.  */
+    ret = regex_compile(pattern, strlen(pattern), syntax, preg);
+
+    /* POSIX doesn't distinguish between an unmatched open-group and an
+     * unmatched close-group: both are REG_EPAREN.  */
+    if (ret == REG_ERPAREN)
+       ret = REG_EPAREN;
+
+    return (int) ret;
 }
 
 
 /* regexec searches for a given pattern, specified by PREG, in the
  string STRING.
-   
  If NMATCH is zero or REG_NOSUB was set in the cflags argument to
  `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
  least NMATCH elements, and we set them to the offsets of the
  corresponding matched substrings.
-   
  EFLAGS specifies `execution flags' which affect matching: if
  REG_NOTBOL is set, then ^ does not match at the beginning of the
  string; if REG_NOTEOL is set, then $ does not match at the end.
-   
  We return 0 if we find a match and REG_NOMATCH if not.  */
* string STRING.
+ * 
* If NMATCH is zero or REG_NOSUB was set in the cflags argument to
* `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
* least NMATCH elements, and we set them to the offsets of the
* corresponding matched substrings.
+ * 
* EFLAGS specifies `execution flags' which affect matching: if
* REG_NOTBOL is set, then ^ does not match at the beginning of the
* string; if REG_NOTEOL is set, then $ does not match at the end.
+ * 
* We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
-regexec (preg, string, nmatch, pmatch, eflags)
-    const regex_t *preg;
-    const char *string; 
-    size_t nmatch; 
-    regmatch_t pmatch[]; 
-    int eflags;
+regexec(preg, string, nmatch, pmatch, eflags)
+     const regex_t *preg;
+     const char *string;
+     size_t nmatch;
+     regmatch_t pmatch[];
+     int eflags;
 {
-  int ret;
-  struct re_registers regs;
-  regex_t private_preg;
-  int len = strlen (string);
-  boolean want_reg_info = !preg->no_sub && nmatch > 0;
-
-  private_preg = *preg;
-  
-  private_preg.not_bol = !!(eflags & REG_NOTBOL);
-  private_preg.not_eol = !!(eflags & REG_NOTEOL);
-  
-  /* The user has told us exactly how many registers to return
-     information about, via `nmatch'.  We have to pass that on to the
-     matching routines.  */
-  private_preg.regs_allocated = REGS_FIXED;
-  
-  if (want_reg_info)
-    {
-      regs.num_regs = nmatch;
-      regs.start = TALLOC (nmatch, regoff_t);
-      regs.end = TALLOC (nmatch, regoff_t);
-      if (regs.start == NULL || regs.end == NULL)
-        return (int) REG_NOMATCH;
+    int ret;
+    struct re_registers regs;
+    regex_t private_preg;
+    int len = strlen(string);
+    boolean want_reg_info = !preg->no_sub && nmatch > 0;
+
+    private_preg = *preg;
+
+    private_preg.not_bol = !!(eflags & REG_NOTBOL);
+    private_preg.not_eol = !!(eflags & REG_NOTEOL);
+
+    /* The user has told us exactly how many registers to return
+     * information about, via `nmatch'.  We have to pass that on to the
+     * matching routines.  */
+    private_preg.regs_allocated = REGS_FIXED;
+
+    if (want_reg_info) {
+       regs.num_regs = nmatch;
+       regs.start = TALLOC(nmatch, regoff_t);
+       regs.end = TALLOC(nmatch, regoff_t);
+       if (regs.start == NULL || regs.end == NULL)
+           return (int) REG_NOMATCH;
     }
-
-  /* Perform the searching operation.  */
-  ret = re_search (&private_preg, string, len,
-                   /* start: */ 0, /* range: */ len,
-                   want_reg_info ? &regs : (struct re_registers *) 0);
-  
-  /* Copy the register information to the POSIX structure.  */
-  if (want_reg_info)
-    {
-      if (ret >= 0)
-        {
-          unsigned r;
-
-          for (r = 0; r < nmatch; r++)
-            {
-              pmatch[r].rm_so = regs.start[r];
-              pmatch[r].rm_eo = regs.end[r];
-            }
-        }
-
-      /* If we needed the temporary register info, free the space now.  */
-      free (regs.start);
-      free (regs.end);
+    /* Perform the searching operation.  */
+    ret = re_search(&private_preg, string, len,
+       /* start: */ 0, /* range: */ len,
+       want_reg_info ? &regs : (struct re_registers *) 0);
+
+    /* Copy the register information to the POSIX structure.  */
+    if (want_reg_info) {
+       if (ret >= 0) {
+           unsigned r;
+
+           for (r = 0; r < nmatch; r++) {
+               pmatch[r].rm_so = regs.start[r];
+               pmatch[r].rm_eo = regs.end[r];
+           }
+       }
+       /* If we needed the temporary register info, free the space now.  */
+       free(regs.start);
+       free(regs.end);
     }
-
-  /* We want zero return to mean success, unlike `re_search'.  */
-  return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
+    /* We want zero return to mean success, unlike `re_search'.  */
+    return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
 }
 
 
 /* Returns a message corresponding to an error code, ERRCODE, returned
  from either regcomp or regexec.   We don't use PREG here.  */
* from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-regerror (errcode, preg, errbuf, errbuf_size)
-    int errcode;
-    const regex_t *preg;
-    char *errbuf;
-    size_t errbuf_size;
+regerror(errcode, preg, errbuf, errbuf_size)
+     int errcode;
+     const regex_t *preg;
+     char *errbuf;
+     size_t errbuf_size;
 {
-  const char *msg;
-  size_t msg_size;
-
-  if (errcode < 0
-      || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
-    /* Only error codes returned by the rest of the code should be passed 
-       to this routine.  If we are given anything else, or if other regex
-       code generates an invalid error code, then the program has a bug.
-       Dump core so we can fix it.  */
-    abort ();
-
-  msg = re_error_msg[errcode];
-
-  /* POSIX doesn't require that we do anything in this case, but why
-     not be nice.  */
-  if (! msg)
-    msg = "Success";
-
-  msg_size = strlen (msg) + 1; /* Includes the null.  */
-  
-  if (errbuf_size != 0)
-    {
-      if (msg_size > errbuf_size)
-        {
-          strncpy (errbuf, msg, errbuf_size - 1);
-          errbuf[errbuf_size - 1] = 0;
-        }
-      else
-        strcpy (errbuf, msg);
+    const char *msg;
+    size_t msg_size;
+
+    if (errcode < 0
+       || errcode >= (sizeof(re_error_msg) / sizeof(re_error_msg[0])))
+       /* Only error codes returned by the rest of the code should be passed 
+        * to this routine.  If we are given anything else, or if other regex
+        * code generates an invalid error code, then the program has a bug.
+        * Dump core so we can fix it.  */
+       abort();
+
+    msg = re_error_msg[errcode];
+
+    /* POSIX doesn't require that we do anything in this case, but why
+     * not be nice.  */
+    if (!msg)
+       msg = "Success";
+
+    msg_size = strlen(msg) + 1;        /* Includes the null.  */
+
+    if (errbuf_size != 0) {
+       if (msg_size > errbuf_size) {
+           strncpy(errbuf, msg, errbuf_size - 1);
+           errbuf[errbuf_size - 1] = 0;
+       } else
+           strcpy(errbuf, msg);
     }
-
-  return msg_size;
+    return msg_size;
 }
 
 
 /* Free dynamically allocated space used by PREG.  */
 
 void
-regfree (preg)
-    regex_t *preg;
+regfree(preg)
+     regex_t *preg;
 {
-  if (preg->buffer != NULL)
-    free (preg->buffer);
-  preg->buffer = NULL;
-  
-  preg->allocated = 0;
-  preg->used = 0;
-
-  if (preg->fastmap != NULL)
-    free (preg->fastmap);
-  preg->fastmap = NULL;
-  preg->fastmap_accurate = 0;
-
-  if (preg->translate != NULL)
-    free (preg->translate);
-  preg->translate = NULL;
+    if (preg->buffer != NULL)
+       free(preg->buffer);
+    preg->buffer = NULL;
+
+    preg->allocated = 0;
+    preg->used = 0;
+
+    if (preg->fastmap != NULL)
+       free(preg->fastmap);
+    preg->fastmap = NULL;
+    preg->fastmap_accurate = 0;
+
+    if (preg->translate != NULL)
+       free(preg->translate);
+    preg->translate = NULL;
 }
 
 #endif /* not emacs  */
 \f
 /*
-Local variables:
-make-backup-files: t
-version-control: t
-trim-versions-without-asking: nil
-End:
-*/
+ * Local variables:
+ * make-backup-files: t
+ * version-control: t
+ * trim-versions-without-asking: nil
+ * End:
+ */
index 6eb46f96853195bf365523fddf696aa16e189bc5..8a8f14661e979c452e35d153e8860b8c544ab7ea 100644 (file)
@@ -11,7 +11,8 @@ static int base64_initialized = 0;
 int base64_value[256];
 char base64_code[] = "ABCDEFGHIJKLMNOPQRSTUVWZYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
-static void base64_init()
+static void
+base64_init()
 {
     int i;
 
@@ -25,8 +26,8 @@ static void base64_init()
     base64_initialized = 1;
 }
 
-char *base64_decode(p)
-     char *p;
+char *
+base64_decode(char *p)
 {
     static char result[8192];
     int c;
index 8b168e429eb422a100ad0a22b67c7f044fe88188..9cf0ba6969e0a132ff9bd950016ec9a6aba3e795 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: getfullhostname.c,v 1.5 1996/07/09 03:41:11 wessels Exp $
+ * $Id: getfullhostname.c,v 1.6 1996/09/14 08:50:47 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -27,7 +28,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *  
  */
+
 
 /*
  * Copyright (c) 1994, 1995.  All rights reserved.
  *  host, or NULL on error.  Pointer is only valid until the next call
  *  to the gethost*() functions.
  */
-char *getfullhostname()
+char *
+getfullhostname()
 {
     struct hostent *hp = NULL;
     static char buf[SQUIDHOSTNAMELEN + 1];
index d90037d9ddaabb442eac2a596633d1679fc1ea35..e334bd49555a4e63061580af8b7f7ed1f0de0354 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rfc1738.c,v 1.3 1996/07/09 03:41:13 wessels Exp $
+ * $Id: rfc1738.c,v 1.4 1996/09/14 08:50:50 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -27,7 +27,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *  
  */
+
 /*
  * Copyright (c) 1994, 1995.  All rights reserved.
  *  
@@ -143,8 +143,8 @@ static char rfc1738_unsafe_chars[] =
  *  rfc1738_escape - Returns a static buffer contains the RFC 1738 
  *  compliant, escaped version of the given url.
  */
-char *rfc1738_escape(url)
-     char *url;
+char *
+rfc1738_escape(char *url)
 {
     static char buf[BIG_BUFSIZ];
     char *p, *q;
@@ -188,8 +188,8 @@ char *rfc1738_escape(url)
  *  rfc1738_unescape() - Converts escaped characters (%xy numbers) in 
  *  given the string.  %% is a %. %ab is the 8-bit hexadecimal number "ab"
  */
-void rfc1738_unescape(s)
-     char *s;
+void
+rfc1738_unescape(char *s)
 {
     char hexnum[3];
     int i, j;                  /* i is write, j is read */
index ce015017d04ea6208db516a1380fb9945fd6e5a4..e442be80d997aebc637cd3bd06ed920e13890a2c 100644 (file)
@@ -70,7 +70,9 @@ static const char letters[] =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 
 /* Return nonzero if DIR is an existent directory.  */
-static int diraccess (const char *dir) {
+static int
+diraccess(const char *dir)
+{
     struct stat buf;
     uid_t euid;
 
@@ -95,7 +97,9 @@ static int diraccess (const char *dir) {
 }
 
 /* Return nonzero if FILE exists.  */
-static int exists(const char *file) {
+static int
+exists(const char *file)
+{
     /* We can stat the file even if we can't read its data.  */
     struct stat st;
     int save = errno;
@@ -119,28 +123,30 @@ static int exists(const char *file) {
 
 
 /* Generate a temporary filename and return it (in a static buffer).  If
-  STREAMPTR is not NULL, open a stream "w+b" on the file and set
-  *STREAMPTR to it.  If DIR_SEARCH is nonzero, DIR and PFX are used as
-  described for tempnam.  If not, a temporary filename in P_tmpdir with
-  no special prefix is generated.  If LENPTR is not NULL, *LENPTR is
-  set the to length (including the terminating '\0') of the resultant
-  filename, which is returned.  This goes through a cyclic pattern of
-  all possible filenames consisting of five decimal digits of the
-  current pid and three of the characters in `letters'.  Data for
-  tempnam and tmpnam is kept separate, but when tempnam is using
-  P_tmpdir and no prefix (i.e, it is identical to tmpnam), the same
-  data is used.  Each potential filename is tested for an
-  already-existing file of the same name, and no name of an existing
-  file will be returned.  When the cycle reaches its end (12345ZZZ),
-  NULL is returned. */
-
-static char *gen_tempname (
+ * STREAMPTR is not NULL, open a stream "w+b" on the file and set
+ * *STREAMPTR to it.  If DIR_SEARCH is nonzero, DIR and PFX are used as
+ * described for tempnam.  If not, a temporary filename in P_tmpdir with
+ * no special prefix is generated.  If LENPTR is not NULL, *LENPTR is
+ * set the to length (including the terminating '\0') of the resultant
+ * filename, which is returned.  This goes through a cyclic pattern of
+ * all possible filenames consisting of five decimal digits of the
+ * current pid and three of the characters in `letters'.  Data for
+ * tempnam and tmpnam is kept separate, but when tempnam is using
+ * P_tmpdir and no prefix (i.e, it is identical to tmpnam), the same
+ * data is used.  Each potential filename is tested for an
+ * already-existing file of the same name, and no name of an existing
+ * file will be returned.  When the cycle reaches its end (12345ZZZ),
+ * NULL is returned. */
+
+static char *
+gen_tempname(
     const char *dir,
     const char *pfx,
     int dir_search,
     size_t * lenptr,
     FILE ** streamptr
-) {
+)
+{
     int saverrno = errno;
     static const char tmpdir[] = P_tmpdir;
     static struct {
@@ -240,7 +246,9 @@ static char *gen_tempname (
     return buf;
 }
 
-char *tempnam(const char *dir, const char *pfx) {
+char *
+tempnam(const char *dir, const char *pfx)
+{
     size_t len;
     register char *s;
     register char *t = gen_tempname(dir, pfx, 1, &len, (FILE **)
index 6849ebdc04b547567d56db421c9c40c55f68ab4f..20201b17b948ce77da0d27217fc0472acd4e0bc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.c,v 1.11 1996/07/22 16:40:58 wessels Exp $
+ * $Id: util.c,v 1.12 1996/09/14 08:50:52 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -145,7 +145,8 @@ extern char *sys_errlist[];
 static int malloc_sizes[DBG_MAXINDEX + 1];
 static int dbg_stat_init = 0;
 
-static void stat_init()
+static void
+stat_init()
 {
     int i;
     for (i = 0; i <= DBG_MAXINDEX; i++)
@@ -153,17 +154,16 @@ static void stat_init()
     dbg_stat_init = 1;
 }
 
-static int malloc_stat(sz)
-     int sz;
+static int
+malloc_stat(int sz)
 {
     if (!dbg_stat_init)
        stat_init();
     return malloc_sizes[DBG_INDEX(sz)] += 1;
 }
 
-void malloc_statistics(func, data)
-     void (*func) _PARAMS((int, int, void *));
-     void *data;
+void
+malloc_statistics(void (*func) _PARAMS((int, int, void *)), void *data)
 {
     int i;
     for (i = 0; i <= DBG_MAXSIZE; i += DBG_GRAIN)
@@ -184,7 +184,8 @@ static int I = 0;
 static void *P;
 static void *Q;
 
-static void check_init()
+static void
+check_init()
 {
     for (B = 0; B < DBG_ARRY_BKTS; B++) {
        for (I = 0; I < DBG_ARRY_SZ; I++) {
@@ -195,8 +196,8 @@ static void check_init()
     dbg_initd = 1;
 }
 
-static void check_free(s)
-     void *s;
+static void
+check_free(void *s)
 {
     B = (((int) s) >> 4) & 0xFF;
     for (I = 0; I < DBG_ARRY_SZ; I++) {
@@ -212,9 +213,8 @@ static void check_free(s)
     }
 }
 
-static void check_malloc(p, sz)
-     void *p;
-     size_t sz;
+static void
+check_malloc(void *p, size_t sz)
 {
     if (!dbg_initd)
        check_init();
@@ -242,8 +242,8 @@ static void check_malloc(p, sz)
 #endif
 
 #if XMALLOC_COUNT && !HAVE_MALLOCBLKSIZE
-int mallocblksize(p)
-     void *p;
+int
+mallocblksize(void *p)
 {
     B = (((int) p) >> 4) & 0xFF;
     for (I = 0; I < DBG_ARRY_SZ; I++) {
@@ -255,9 +255,8 @@ int mallocblksize(p)
 #endif
 
 #ifdef XMALLOC_COUNT
-static void xmalloc_count(p, sign)
-     void *p;
-     int sign;
+static void
+xmalloc_count(void *p, int sign)
 {
     size_t sz;
     static size_t total = 0;
@@ -270,14 +269,15 @@ static void xmalloc_count(p, sign)
        memoryAccounted(),
        mallinfoTotal());
 }
+
 #endif /* XMALLOC_COUNT */
 
 /*
  *  xmalloc() - same as malloc(3).  Used for portability.
  *  Never returns NULL; fatal on error.
  */
-void *xmalloc(sz)
-     size_t sz;
+void *
+xmalloc(size_t sz)
 {
     static void *p;
 
@@ -308,8 +308,8 @@ void *xmalloc(sz)
 /*
  *  xfree() - same as free(3).  Will not call free(3) if s == NULL.
  */
-void xfree(s)
-     void *s;
+void
+xfree(void *s)
 {
 #if XMALLOC_COUNT
     xmalloc_count(s, -1);
@@ -322,8 +322,8 @@ void xfree(s)
 }
 
 /* xxfree() - like xfree(), but we already know s != NULL */
-void xxfree(s)
-     void *s;
+void
+xxfree(void *s)
 {
 #if XMALLOC_COUNT
     xmalloc_count(s, -1);
@@ -338,9 +338,8 @@ void xxfree(s)
  *  xrealloc() - same as realloc(3). Used for portability.
  *  Never returns NULL; fatal on error.
  */
-void *xrealloc(s, sz)
-     void *s;
-     size_t sz;
+void *
+xrealloc(void *s, size_t sz)
 {
     static void *p;
 
@@ -376,9 +375,8 @@ void *xrealloc(s, sz)
  *  xcalloc() - same as calloc(3).  Used for portability.
  *  Never returns NULL; fatal on error.
  */
-void *xcalloc(n, sz)
-     int n;
-     size_t sz;
+void *
+xcalloc(int n, size_t sz)
 {
     static void *p;
 
@@ -412,8 +410,8 @@ void *xcalloc(n, sz)
  *  xstrdup() - same as strdup(3).  Used for portability.
  *  Never returns NULL; fatal on error.
  */
-char *xstrdup(s)
-     char *s;
+char *
+xstrdup(char *s)
 {
     static char *p = NULL;
     size_t sz;
@@ -436,7 +434,8 @@ char *xstrdup(s)
 /*
  * xstrerror() - return sys_errlist[errno];
  */
-char *xstrerror()
+char *
+xstrerror()
 {
     static char xstrerror_buf[BUFSIZ];
 
@@ -449,17 +448,15 @@ char *xstrerror()
 
 #if !HAVE_STRDUP
 /* define for systems that don't have strdup */
-char *strdup(s)
-     char *s;
+char *
+strdup(char *s)
 {
     return (xstrdup(s));
 }
 #endif
 
-void xmemcpy(from, to, len)
-     void *from;
-     void *to;
-     int len;
+void
+xmemcpy(void *from, void *to, int len)
 {
 #if HAVE_MEMMOVE
     (void) memmove(from, to, len);
@@ -470,12 +467,12 @@ void xmemcpy(from, to, len)
 #endif
 }
 
-void Tolower(q)
-     char *q;
+void
+Tolower(char *q)
 {
     char *s = q;
     while (*s) {
-        *s = tolower((unsigned char) *s);
-        s++;
+       *s = tolower((unsigned char) *s);
+       s++;
     }
 }
index c615f0083624152ab9e7c3e8622979ac541cee9e..1a79e7aef6fc16748291548a6bb15672c866018d 100644 (file)
@@ -1,64 +1,69 @@
+
 #include "util.h"
 
-extern char** environ;
+extern char **environ;
 
 /* aaaack but it's fast and const should make it shared text page. */
-const int pr2six[256]={
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62,64,64,64,63,
-    52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,64,0,1,2,3,4,5,6,7,8,9,
-    10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,64,64,26,27,
-    28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
-    64,64,64,64,64,64,64,64,64,64,64,64,64
+const int pr2six[256] =
+{
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
+    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+    10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, 26, 27,
+    28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
 };
 
-char *uudecode(char *bufcoded) {
+char *
+uudecode(char *bufcoded)
+{
     int nbytesdecoded;
     register unsigned char *bufin;
     register char *bufplain;
     register unsigned char *bufout;
     register int nprbytes;
-    
+
     /* Strip leading whitespace. */
-    
-    while(*bufcoded==' ' || *bufcoded == '\t') bufcoded++;
-    
+
+    while (*bufcoded == ' ' || *bufcoded == '\t')
+       bufcoded++;
+
     /* Figure out how many characters are in the input buffer.
      * Allocate this many from the per-transaction pool for the result.
      */
-    bufin = (unsigned char *)bufcoded;
-    while(pr2six[*(bufin++)] <= 63);
-    nprbytes = (char *)bufin - bufcoded - 1;
-    nbytesdecoded = ((nprbytes+3)/4) * 3;
+    bufin = (unsigned char *) bufcoded;
+    while (pr2six[*(bufin++)] <= 63);
+    nprbytes = (char *) bufin - bufcoded - 1;
+    nbytesdecoded = ((nprbytes + 3) / 4) * 3;
 
     bufplain = xmalloc(nbytesdecoded + 1);
     if (bufplain == NULL)
-      return(NULL);
-    bufout = (unsigned char *)bufplain;
-    
-    bufin = (unsigned char *)bufcoded;
-    
+       return (NULL);
+    bufout = (unsigned char *) bufplain;
+
+    bufin = (unsigned char *) bufcoded;
+
     while (nprbytes > 0) {
-        *(bufout++) = 
-            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
-        *(bufout++) = 
-            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
-        *(bufout++) = 
-            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
-        bufin += 4;
-        nprbytes -= 4;
+       *(bufout++) =
+           (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
+       *(bufout++) =
+           (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
+       *(bufout++) =
+           (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
+       bufin += 4;
+       nprbytes -= 4;
     }
-    
-    if(nprbytes & 03) {
-        if(pr2six[bufin[-2]] > 63)
-            nbytesdecoded -= 2;
-        else
-            nbytesdecoded -= 1;
+
+    if (nprbytes & 03) {
+       if (pr2six[bufin[-2]] > 63)
+           nbytesdecoded -= 2;
+       else
+           nbytesdecoded -= 1;
     }
     bufplain[nbytesdecoded] = '\0';
     return bufplain;
index 115b10311a0d215ced5f72497cade0b81eab15b7..7461bd0e26d0b7edc6b52e4b57454e6eaa2e6cb3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client.cc,v 1.8 1996/09/04 22:03:19 wessels Exp $
+ * $Id: client.cc,v 1.9 1996/09/14 08:45:41 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
 #endif
 
 /* Local functions */
-static int client_comm_connect();
-static void usage();
+static int client_comm_connect(int sock, char *dest_host, u_short dest_port);
+static void usage(char *progname);
 
-static void usage(progname)
-     char *progname;
+static void
+usage(char *progname)
 {
     fprintf(stderr, "\
 Usage: %s [-rs] [-i IMS_time] [-h host] [-p port] [-m method] url\n\
@@ -130,9 +130,8 @@ Options:\n\
     exit(1);
 }
 
-int main(argc, argv)
-     int argc;
-     char *argv[];
+int
+main(int argc, char *argv[])
 {
     int conn, c, len, bytesWritten;
     int port, to_stdout, reload;
@@ -235,10 +234,8 @@ int main(argc, argv)
     return 0;
 }
 
-static int client_comm_connect(sock, dest_host, dest_port)
-     int sock;                 /* Type of communication to use. */
-     char *dest_host;          /* Server's host name. */
-     u_short dest_port;                /* Server's port. */
+static int
+client_comm_connect(int sock, char *dest_host, u_short dest_port)
 {
     struct hostent *hp;
     static struct sockaddr_in to_addr;
index 8aa5c381529e98b8a2d8ef4aee2ae80933e59cdd..38618eb60d596b381f305f42d0dfdc8d4ae00cf7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.22 1996/09/12 03:24:01 wessels Exp $
+ * $Id: client_side.cc,v 1.23 1996/09/14 08:45:41 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
 
 #include "squid.h"
 
-static void clientRedirectDone _PARAMS((void *data, char *result));
-static int icpHandleIMSReply _PARAMS((int fd, StoreEntry * entry, void *data));
+static void clientRedirectDone(void *data, char *result);
+static int icpHandleIMSReply(int fd, StoreEntry * entry, void *data);
 
 
-static int clientLookupDstIPDone(fd, hp, data)
-     int fd;
-     struct hostent *hp;
-     void *data;
+static int
+clientLookupDstIPDone(int fd, struct hostent *hp, void *data)
 {
     icpStateData *icpState = data;
     debug(33, 5, "clientLookupDstIPDone: FD %d, '%s'\n",
@@ -57,10 +55,8 @@ static int clientLookupDstIPDone(fd, hp, data)
     return 1;
 }
 
-static void clientLookupSrcFQDNDone(fd, fqdn, data)
-     int fd;
-     char *fqdn;
-     void *data;
+static void
+clientLookupSrcFQDNDone(int fd, char *fqdn, void *data)
 {
     icpStateData *icpState = data;
     debug(33, 5, "clientLookupSrcFQDNDone: FD %d, '%s', FQDN %s\n",
@@ -72,8 +68,8 @@ static void clientLookupSrcFQDNDone(fd, fqdn, data)
 }
 
 #ifdef UNUSED_CODE
-static void clientLookupIdentDone(data)
-     void *data;
+static void
+clientLookupIdentDone(void *data)
 {
 }
 
@@ -81,8 +77,8 @@ static void clientLookupIdentDone(data)
 
 #if USE_PROXY_AUTH
 /* return 1 if allowed, 0 if denied */
-static int clientProxyAuthCheck(icpState)
-     icpStateData *icpState;
+static int
+clientProxyAuthCheck(icpStateData * icpState)
 {
     char *proxy_user;
 
@@ -106,9 +102,8 @@ static int clientProxyAuthCheck(icpState)
 }
 #endif /* USE_PROXY_AUTH */
 
-void clientAccessCheck(icpState, handler)
-     icpStateData *icpState;
-     void (*handler) _PARAMS((icpStateData *, int));
+void
+clientAccessCheck(icpStateData * icpState, void (*handler) _PARAMS((icpStateData *, int)))
 {
     int answer = 1;
     request_t *r = icpState->request;
@@ -166,9 +161,8 @@ void clientAccessCheck(icpState, handler)
     handler(icpState, answer);
 }
 
-void clientAccessCheckDone(icpState, answer)
-     icpStateData *icpState;
-     int answer;
+void
+clientAccessCheckDone(icpStateData * icpState, int answer)
 {
     int fd = icpState->fd;
     char *buf = NULL;
@@ -198,9 +192,8 @@ void clientAccessCheckDone(icpState, answer)
     }
 }
 
-static void clientRedirectDone(data, result)
-     void *data;
-     char *result;
+static void
+clientRedirectDone(void *data, char *result)
 {
     icpStateData *icpState = data;
     int fd = icpState->fd;
@@ -231,7 +224,8 @@ static void clientRedirectDone(data, result)
  */
 #define CHECK_PROXY_FILE_TIME 300
 
-char *proxyAuthenticate(char *headers)
+char *
+proxyAuthenticate()
 {
     /* Keep the time measurements and the hash
      * table of users and passwords handy */
@@ -363,9 +357,8 @@ char *proxyAuthenticate(char *headers)
 #endif /* USE_PROXY_AUTH */
 }
 
-int icpProcessExpired(fd, icpState)
-     int fd;
-     icpStateData *icpState;
+int
+icpProcessExpired(int fd, icpStateData * icpState)
 {
     char *url = icpState->url;
     char *request_hdr = icpState->request_hdr;
@@ -394,10 +387,8 @@ int icpProcessExpired(fd, icpState)
 }
 
 
-static int icpHandleIMSReply(fd, entry, data)
-     int fd;
-     StoreEntry *entry;
-     void *data;
+static int
+icpHandleIMSReply(int fd, StoreEntry * entry, void *data)
 {
     icpStateData *icpState = data;
     MemObject *mem = entry->mem_obj;
index 7df989f77a9780ab27c260cd38b337551c44a09a..0a5d01291482eb765e67c16db778834a08c50bda 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.66 1996/09/12 22:17:58 wessels Exp $
+ * $Id: comm.cc,v 1.67 1996/09/14 08:45:43 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -137,26 +137,25 @@ struct _RWStateData {
 FD_ENTRY *fd_table = NULL;     /* also used in disk.c */
 
 /* STATIC */
-static void checkTimeouts _PARAMS((void));
-static void checkLifetimes _PARAMS((void));
-static void Reserve_More_FDs _PARAMS((void));
-static void commSetReuseAddr _PARAMS((int));
-static int examine_select _PARAMS((fd_set *, fd_set *, fd_set *));
-static void commSetNoLinger _PARAMS((int));
-static void comm_select_incoming _PARAMS((void));
-static int commBind _PARAMS((int s, struct in_addr, u_short port));
-static void RWStateCallbackAndFree _PARAMS((int fd, int code));
+static void checkTimeouts(void);
+static void checkLifetimes(void);
+static void Reserve_More_FDs(void);
+static void commSetReuseAddr(int);
+static int examine_select(fd_set *, fd_set *, fd_set *);
+static void commSetNoLinger(int);
+static void comm_select_incoming(void);
+static int commBind(int s, struct in_addr, u_short port);
+static void RWStateCallbackAndFree(int fd, int code);
 #ifdef TCP_NODELAY
-static void commSetTcpNoDelay _PARAMS((int));
+static void commSetTcpNoDelay(int);
 #endif
-static void commSetTcpRcvbuf _PARAMS((int, int));
+static void commSetTcpRcvbuf(int, int);
 
 static int *fd_lifetime = NULL;
 static struct timeval zero_tv;
 
-static void RWStateCallbackAndFree(fd, code)
-     int fd;
-     int code;
+static void
+RWStateCallbackAndFree(int fd, int code)
 {
     RWStateData *RWState = fd_table[fd].rwstate;
     rw_complete_handler *callback = NULL;
@@ -180,8 +179,8 @@ static void RWStateCallbackAndFree(fd, code)
 }
 
 /* Return the local port associated with fd. */
-u_short comm_local_port(fd)
-     int fd;
+u_short
+comm_local_port(int fd)
 {
     struct sockaddr_in addr;
     int addr_len = 0;
@@ -204,14 +203,8 @@ u_short comm_local_port(fd)
     return fde->local_port;
 }
 
-#ifdef __STDC__
-static int commBind(int s, struct in_addr in_addr, u_short port)
-#else /* K&R C */
-static int commBind(s, in_addr, port)
-     int s;
-     struct in_addr in_addr;
-     u_short port;
-#endif
+static int
+commBind(int s, struct in_addr in_addr, u_short port)
 {
     struct sockaddr_in S;
 
@@ -230,15 +223,8 @@ static int commBind(s, in_addr, port)
 
 /* Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
  * is OR of flags specified in comm.h. */
-#ifdef __STDC__
-int comm_open(unsigned int io_type, struct in_addr addr, u_short port, char *note)
-#else /* K&R C */
-int comm_open(io_type, addr, port, note)
-     unsigned int io_type;
-     struct in_addr addr;
-     u_short port;
-     char *note;
-#endif
+int
+comm_open(unsigned int io_type, struct in_addr addr, u_short port, char *note)
 {
     int new_socket;
     FD_ENTRY *conn = NULL;
@@ -302,8 +288,8 @@ int comm_open(io_type, addr, port, note)
     * to 5.  HP-UX currently has a limit of 20.  SunOS is 5 and
     * OSF 3.0 is 8.
     */
-int comm_listen(sock)
-     int sock;
+int
+comm_listen(int sock)
 {
     int x;
     if ((x = listen(sock, FD_SETSIZE >> 2)) < 0) {
@@ -316,10 +302,8 @@ int comm_listen(sock)
 }
 
 /* Connect SOCK to specified DEST_PORT at DEST_HOST. */
-int comm_connect(sock, dest_host, dest_port)
-     int sock;                 /* Type of communication to use. */
-     char *dest_host;          /* Server's host name. */
-     u_short dest_port;                /* Server's port. */
+int 
+comm_connect(int sock, char *dest_host, u_short dest_port)
 {
     struct hostent *hp = NULL;
     static struct sockaddr_in to_addr;
@@ -338,9 +322,8 @@ int comm_connect(sock, dest_host, dest_port)
     return comm_connect_addr(sock, &to_addr);
 }
 
-int comm_set_fd_lifetime(fd, lifetime)
-     int fd;
-     int lifetime;
+int
+comm_set_fd_lifetime(int fd, int lifetime)
 {
     debug(5, 3, "comm_set_fd_lifetime: FD %d lft %d\n", fd, lifetime);
     if (fd < 0 || fd > FD_SETSIZE)
@@ -355,25 +338,24 @@ int comm_set_fd_lifetime(fd, lifetime)
     return fd_lifetime[fd] = (int) squid_curtime + lifetime;
 }
 
-int comm_get_fd_lifetime(fd)
-     int fd;
+int
+comm_get_fd_lifetime(int fd)
 {
     if (fd < 0)
        return 0;
     return fd_lifetime[fd];
 }
 
-int comm_get_fd_timeout(fd)
-     int fd;
+int
+comm_get_fd_timeout(int fd)
 {
     if (fd < 0)
        return 0;
     return fd_table[fd].timeout_time;
 }
 
-int comm_connect_addr(sock, address)
-     int sock;
-     struct sockaddr_in *address;
+int
+comm_connect_addr(int sock, struct sockaddr_in *address)
 {
     int status = COMM_OK;
     FD_ENTRY *conn = &fd_table[sock];
@@ -434,10 +416,8 @@ int comm_connect_addr(sock, address)
 
 /* Wait for an incoming connection on FD.  FD should be a socket returned
  * from comm_listen. */
-int comm_accept(fd, peer, me)
-     int fd;
-     struct sockaddr_in *peer;
-     struct sockaddr_in *me;
+int
+comm_accept(int fd, struct sockaddr_in *peer, struct sockaddr_in *me)
 {
     int sock;
     struct sockaddr_in P;
@@ -490,8 +470,8 @@ int comm_accept(fd, peer, me)
     return sock;
 }
 
-void comm_close(fd)
-     int fd;
+void
+comm_close(int fd)
 {
     FD_ENTRY *conn = NULL;
     struct close_handler *ch = NULL;
@@ -520,8 +500,8 @@ void comm_close(fd)
 
 /* use to clean up fdtable when socket is closed without
  * using comm_close */
-int comm_cleanup_fd_entry(fd)
-     int fd;
+int
+comm_cleanup_fd_entry(int fd)
 {
     FD_ENTRY *conn = &fd_table[fd];
     RWStateCallbackAndFree(fd, COMM_ERROR);
@@ -531,16 +511,8 @@ int comm_cleanup_fd_entry(fd)
 
 
 /* Send a udp datagram to specified PORT at HOST. */
-#ifdef __STDC__
-int comm_udp_send(int fd, char *host, u_short port, char *buf, int len)
-#else /* K&R C */
-int comm_udp_send(fd, host, port, buf, len)
-     int fd;
-     char *host;
-     u_short port;
-     char *buf;
-     int len;
-#endif
+int
+comm_udp_send(int fd, char *host, u_short port, char *buf, int len)
 {
     struct hostent *hp = NULL;
     static struct sockaddr_in to_addr;
@@ -566,12 +538,8 @@ int comm_udp_send(fd, host, port, buf, len)
 }
 
 /* Send a udp datagram to specified TO_ADDR. */
-int comm_udp_sendto(fd, to_addr, addr_len, buf, len)
-     int fd;
-     struct sockaddr_in *to_addr;
-     int addr_len;
-     char *buf;
-     int len;
+int
+comm_udp_sendto(int fd, struct sockaddr_in *to_addr, int addr_len, char *buf, int len)
 {
     int bytes_sent;
 
@@ -586,12 +554,8 @@ int comm_udp_sendto(fd, to_addr, addr_len, buf, len)
     return bytes_sent;
 }
 
-int comm_udp_recv(fd, buf, size, from_addr, from_size)
-     int fd;
-     char *buf;
-     int size;
-     struct sockaddr_in *from_addr;
-     int *from_size;           /* in: size of from_addr; out: size filled in. */
+int
+comm_udp_recv(int fd, char *buf, int size, struct sockaddr_in *from_addr, int *from_size)
 {
     int len = recvfrom(fd, buf, size, 0, (struct sockaddr *) from_addr,
        from_size);
@@ -603,16 +567,16 @@ int comm_udp_recv(fd, buf, size, from_addr, from_size)
     return len;
 }
 
-void comm_set_stall(fd, delta)
-     int fd;
-     int delta;
+void
+comm_set_stall(int fd, int delta)
 {
     if (fd < 0)
        return;
     fd_table[fd].stall_until = squid_curtime + delta;
 }
 
-static void comm_select_incoming()
+static void
+comm_select_incoming()
 {
     fd_set read_mask;
     fd_set write_mask;
@@ -667,8 +631,8 @@ static void comm_select_incoming()
 
 
 /* Select on all sockets; call handlers for those that are ready. */
-int comm_select(sec)
-     time_t sec;
+int
+comm_select(time_t sec)
 {
     fd_set exceptfds;
     fd_set readfds;
@@ -832,21 +796,14 @@ int comm_select(sec)
     return COMM_TIMEOUT;
 }
 
-void comm_set_select_handler(fd, type, handler, client_data)
-     int fd;
-     unsigned int type;
-     PF handler;
-     void *client_data;
+void
+comm_set_select_handler(int fd, unsigned int type, PF handler, void *client_data)
 {
     comm_set_select_handler_plus_timeout(fd, type, handler, client_data, 0);
 }
 
-void comm_set_select_handler_plus_timeout(fd, type, handler, client_data, timeout)
-     int fd;
-     unsigned int type;
-     PF handler;
-     void *client_data;
-     time_t timeout;
+void
+comm_set_select_handler_plus_timeout(int fd, unsigned int type, PF handler, void *client_data, time_t timeout)
 {
     if (type & COMM_SELECT_TIMEOUT) {
        fd_table[fd].timeout_time = (getCurrentTime() + timeout);
@@ -875,11 +832,8 @@ void comm_set_select_handler_plus_timeout(fd, type, handler, client_data, timeou
     }
 }
 
-int comm_get_select_handler(fd, type, handler_ptr, client_data_ptr)
-     int fd;
-     unsigned int type;
-     int (**handler_ptr) ();
-     void **client_data_ptr;
+int
+comm_get_select_handler(int fd, unsigned int type, int (**handler_ptr) (), void **client_data_ptr)
 {
     if (type & COMM_SELECT_TIMEOUT) {
        *handler_ptr = fd_table[fd].timeout_handler;
@@ -904,10 +858,8 @@ int comm_get_select_handler(fd, type, handler_ptr, client_data_ptr)
     return 0;                  /* XXX What is meaningful? */
 }
 
-void comm_add_close_handler(fd, handler, data)
-     int fd;
-     PF handler;
-     void *data;
+void
+comm_add_close_handler(int fd, PF handler, void *data)
 {
     struct close_handler *new = xmalloc(sizeof(*new));
 
@@ -919,10 +871,8 @@ void comm_add_close_handler(fd, handler, data)
     fd_table[fd].close_handler = new;
 }
 
-void comm_remove_close_handler(fd, handler, data)
-     int fd;
-     PF handler;
-     void *data;
+void
+comm_remove_close_handler(int fd, PF handler, void *data)
 {
     struct close_handler *p, *last = NULL;
 
@@ -941,8 +891,8 @@ void comm_remove_close_handler(fd, handler, data)
     safe_free(p);
 }
 
-static void commSetNoLinger(fd)
-     int fd;
+static void
+commSetNoLinger(int fd)
 {
     struct linger L;
     L.l_onoff = 0;             /* off */
@@ -952,8 +902,8 @@ static void commSetNoLinger(fd)
        debug(5, 0, "commSetNoLinger: FD %d: %s\n", fd, xstrerror());
 }
 
-static void commSetReuseAddr(fd)
-     int fd;
+static void
+commSetReuseAddr(int fd)
 {
     int on = 1;
     debug(5, 10, "commSetReuseAddr: turning on SO_REUSEADDR on FD %d\n", fd);
@@ -962,8 +912,8 @@ static void commSetReuseAddr(fd)
 }
 
 #ifdef TCP_NODELAY
-static void commSetTcpNoDelay(fd)
-     int fd;
+static void
+commSetTcpNoDelay(int fd)
 {
     int on = 1;
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0)
@@ -971,17 +921,16 @@ static void commSetTcpNoDelay(fd)
 }
 #endif
 
-static void commSetTcpRcvbuf(fd, size)
-     int fd;
-     int size;
+static void
+commSetTcpRcvbuf(int fd, int size)
 {
     if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size)) < 0)
        debug(5, 1, "commSetTcpRcvbuf: FD %d, SIZE %d: %s\n",
            fd, size, xstrerror());
 }
 
-int commSetNonBlocking(fd)
-     int fd;
+int
+commSetNonBlocking(int fd)
 {
 #if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
     if (fcntl(fd, F_SETFL, O_NONBLOCK)) {
@@ -999,8 +948,8 @@ int commSetNonBlocking(fd)
     return 0;
 }
 
-void commSetCloseOnExec(fd)
-     int fd;
+void
+commSetCloseOnExec(int fd)
 {
 #ifdef FD_CLOEXEC
     if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
@@ -1010,8 +959,8 @@ void commSetCloseOnExec(fd)
 #endif
 }
 
-char **getAddressList(name)
-     char *name;
+char **
+getAddressList(char *name)
 {
     struct hostent *hp = NULL;
     if (name == NULL)
@@ -1023,8 +972,8 @@ char **getAddressList(name)
     return NULL;
 }
 
-struct in_addr *getAddress(name)
-     char *name;
+struct in_addr *
+getAddress(char *name)
 {
     static struct in_addr first;
     char **list = NULL;
@@ -1046,7 +995,8 @@ struct in_addr *getAddress(name)
  *  we can find a better solution, we give all asciiPort or
  *  squid initiated clients a maximum lifetime.
  */
-int comm_init()
+int
+comm_init()
 {
     int i;
 
@@ -1079,8 +1029,8 @@ int comm_init()
  * 
  * Call this from where the select loop fails.
  */
-static int examine_select(readfds, writefds, exceptfds)
-     fd_set *readfds, *writefds, *exceptfds;
+static int
+examine_select(fd_set * readfds, fd_set * writefds, fd_set * exceptfds)
 {
     int fd = 0;
     fd_set read_x;
@@ -1149,9 +1099,8 @@ static int examine_select(readfds, writefds, exceptfds)
     return 0;
 }
 
-char *fd_note(fd, s)
-     int fd;
-     char *s;
+char *
+fd_note(int fd, char *s)
 {
     if (s == NULL)
        return (fd_table[fd].ascii_note);
@@ -1159,7 +1108,8 @@ char *fd_note(fd, s)
     return (NULL);
 }
 
-static void checkTimeouts()
+static void
+checkTimeouts()
 {
     int fd;
     int (*hdl) () = NULL;
@@ -1180,7 +1130,8 @@ static void checkTimeouts()
     }
 }
 
-static void checkLifetimes()
+static void
+checkLifetimes()
 {
     int fd;
     time_t lft;
@@ -1228,7 +1179,8 @@ static void checkLifetimes()
 /*
  * Reserve_More_FDs() called when acceopt(), open(), or socket is failing
  */
-static void Reserve_More_FDs()
+static void
+Reserve_More_FDs()
 {
     if (RESERVED_FD < FD_SETSIZE - 64) {
        RESERVED_FD = RESERVED_FD + 1;
@@ -1240,9 +1192,8 @@ static void Reserve_More_FDs()
 }
 
 /* Read from FD. */
-static int commHandleRead(fd, state)
-     int fd;
-     RWStateData *state;
+static int
+commHandleRead(int fd, RWStateData * state)
 {
     int len;
 
@@ -1285,14 +1236,14 @@ static int commHandleRead(fd, state)
 
 /* Select for reading on FD, until SIZE bytes are received.  Call
  * HANDLER when complete. */
-void comm_read(fd, buf, size, timeout, immed, handler, handler_data)
-     int fd;
-     char *buf;
-     int size;
-     int timeout;
-     int immed;                        /* Call handler immediately when data available */
-     rw_complete_handler *handler;
-     void *handler_data;
+void
+comm_read(int fd,
+    char *buf,
+    int size,
+    int timeout,
+    int immed,
+    rw_complete_handler * handler,
+    void *handler_data)
 {
     RWStateData *state = NULL;
 
@@ -1321,9 +1272,8 @@ void comm_read(fd, buf, size, timeout, immed, handler, handler_data)
 }
 
 /* Write to FD. */
-static void commHandleWrite(fd, state)
-     int fd;
-     RWStateData *state;
+static void
+commHandleWrite(int fd, RWStateData * state)
 {
     int len = 0;
     int nleft;
@@ -1373,14 +1323,8 @@ static void commHandleWrite(fd, state)
 
 /* Select for Writing on FD, until SIZE bytes are sent.  Call
  * * HANDLER when complete. */
-void comm_write(fd, buf, size, timeout, handler, handler_data, free)
-     int fd;
-     char *buf;
-     int size;
-     int timeout;
-     rw_complete_handler *handler;
-     void *handler_data;
-     void (*free) (void *);
+void
+comm_write(int fd, char *buf, int size, int timeout, rw_complete_handler * handler, void *handler_data, void (*free) (void *))
 {
     RWStateData *state = NULL;
 
index eaed6a9cb6a87713527e0a97157aa35d028b30a9..79030de4f7fa39c7d39e8b3c59b26b63fd662888 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.22 1996/09/11 22:39:24 wessels Exp $
+ * $Id: debug.cc,v 1.23 1996/09/14 08:45:45 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -115,11 +115,13 @@ static char *debug_log_file = NULL;
 static int debugLevels[MAX_DEBUG_SECTIONS];
 
 #if defined(__STRICT_ANSI__)
-void _db_print(int section, int level, char *format,...)
+void
+_db_print(int section, int level, char *format,...)
 {
     va_list args;
 #else
-void _db_print(va_alist)
+void
+_db_print(va_alist)
      va_dcl
 {
     va_list args;
@@ -174,8 +176,8 @@ void _db_print(va_alist)
     va_end(args);
 }
 
-static void debugArg(arg)
-     char *arg;
+static void
+debugArg(char *arg)
 {
     int s = 0;
     int l = 0;
@@ -198,8 +200,8 @@ static void debugArg(arg)
        debugLevels[i] = l;
 }
 
-static void debugOpenLog(logfile)
-     char *logfile;
+static void
+debugOpenLog(char *logfile)
 {
     if (logfile == NULL) {
        debug_log = stderr;
@@ -220,9 +222,8 @@ static void debugOpenLog(logfile)
     }
 }
 
-void _db_init(logfile, options)
-     char *logfile;
-     char *options;
+void
+_db_init(char *logfile, char *options)
 {
     int i;
     char *p = NULL;
@@ -246,7 +247,8 @@ void _db_init(logfile, options)
 
 }
 
-void _db_rotate_log()
+void
+_db_rotate_log()
 {
     int i;
     LOCAL_ARRAY(char, from, MAXPATHLEN);
index 1bd44e1f9bf57ec78c27f21b5110312291478e78..3ecb420712727b28eff373efead5b1491783eea9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.22 1996/08/30 22:36:28 wessels Exp $
+ * $Id: disk.cc,v 1.23 1996/09/14 08:45:47 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -112,9 +112,9 @@ typedef struct _dwalk_ctrl {
     off_t offset;
     char *buf;                 /* line buffer */
     int cur_len;               /* line len */
-    int (*handler) _PARAMS((int fd, int errflag, void *data));
+    int (*handler) (int fd, int errflag, void *data);
     void *client_data;
-    int (*line_handler) _PARAMS((int fd, char *buf, int size, void *line_data));
+    int (*line_handler) (int fd, char *buf, int size, void *line_data);
     void *line_data;
 } dwalk_ctrl;
 
@@ -122,7 +122,8 @@ typedef struct _dwalk_ctrl {
 FileEntry *file_table;
 
 /* initialize table */
-int disk_init()
+int
+disk_init()
 {
     int fd;
 
@@ -143,10 +144,8 @@ int disk_init()
 }
 
 /* Open a disk file. Return a file descriptor */
-int file_open(path, handler, mode)
-     char *path;               /* path to file */
-     int (*handler) ();                /* Interrupt handler. */
-     int mode;
+int 
+file_open(char *path, int (*handler) (), int mode)
 {
     FD_ENTRY *conn;
     int fd;
@@ -187,10 +186,8 @@ int file_open(path, handler, mode)
 }
 
 #ifdef UNUSED_CODE
-int file_update_open(fd, path)
-     int fd;
-     char *path;               /* path to file */
-{
+int file_update_open(int fd, char *path;       /* path to file */
+) {
     FD_ENTRY *conn;
 
     /* update fdstat */
@@ -216,8 +213,8 @@ int file_update_open(fd, path)
 
 
 /* close a disk file. */
-int file_close(fd)
-     int fd;                   /* file descriptor */
+int 
+file_close(int fd)
 {
     FD_ENTRY *conn = NULL;
 
@@ -257,8 +254,8 @@ int file_close(fd)
 }
 
 /* grab a writing lock for file */
-int file_write_lock(fd)
-     int fd;
+int
+file_write_lock(int fd)
 {
     if (file_table[fd].write_lock == LOCK) {
        debug(6, 0, "trying to lock a locked file\n");
@@ -273,9 +270,8 @@ int file_write_lock(fd)
 
 
 /* release a writing lock for file */
-int file_write_unlock(fd, access_code)
-     int fd;
-     int access_code;
+int
+file_write_unlock(int fd, int access_code)
 {
     if (file_table[fd].access_code == access_code) {
        file_table[fd].write_lock = UNLOCK;
@@ -288,9 +284,8 @@ int file_write_unlock(fd, access_code)
 
 
 /* write handler */
-int diskHandleWrite(fd, entry)
-     int fd;
-     FileEntry *entry;
+int
+diskHandleWrite(int fd, FileEntry * entry)
 {
     int len;
     dwrite_q *q = NULL;
@@ -362,14 +357,8 @@ int diskHandleWrite(fd, entry)
 /* write block to a file */
 /* write back queue. Only one writer at a time. */
 /* call a handle when writing is complete. */
-int file_write(fd, ptr_to_buf, len, access_code, handle, handle_data, free)
-     int fd;
-     char *ptr_to_buf;
-     int len;
-     int access_code;
-     void (*handle) ();
-     void *handle_data;
-     void (*free) _PARAMS((void *));
+int
+file_write(int fd, char *ptr_to_buf, int len, int access_code, void (*handle) (), void *handle_data, void (*free) _PARAMS((void *)))
 {
     dwrite_q *wq = NULL;
 
@@ -418,9 +407,8 @@ int file_write(fd, ptr_to_buf, len, access_code, handle, handle_data, free)
 
 
 /* Read from FD */
-int diskHandleRead(fd, ctrl_dat)
-     int fd;
-     dread_ctrl *ctrl_dat;
+int
+diskHandleRead(int fd, dread_ctrl * ctrl_dat)
 {
     int len;
 
@@ -484,13 +472,8 @@ int diskHandleRead(fd, ctrl_dat)
 /* buffer must be allocated from the caller. 
  * It must have at least req_len space in there. 
  * call handler when a reading is complete. */
-int file_read(fd, buf, req_len, offset, handler, client_data)
-     int fd;
-     char *buf;
-     int req_len;
-     int offset;
-     FILE_READ_HD handler;
-     void *client_data;
+int
+file_read(int fd, char *buf, int req_len, int offset, FILE_READ_HD handler, void *client_data)
 {
     dread_ctrl *ctrl_dat;
 
@@ -517,9 +500,8 @@ int file_read(fd, buf, req_len, offset, handler, client_data)
 
 
 /* Read from FD and pass a line to routine. Walk to EOF. */
-int diskHandleWalk(fd, walk_dat)
-     int fd;
-     dwalk_ctrl *walk_dat;
+int
+diskHandleWalk(int fd, dwalk_ctrl * walk_dat)
 {
     int len;
     int end_pos;
@@ -586,13 +568,12 @@ int diskHandleWalk(fd, walk_dat)
  * read one block and chop it to a line and pass it to provided 
  * handler one line at a time.
  * call a completion handler when done. */
-int file_walk(fd, handler, client_data, line_handler, line_data)
-     int fd;
-     FILE_WALK_HD handler;
-     void *client_data;
-     FILE_WALK_LHD line_handler;
-     void *line_data;
-
+int
+file_walk(int fd,
+    FILE_WALK_HD handler,
+    void *client_data,
+    FILE_WALK_LHD line_handler,
+    void *line_data)
 {
     dwalk_ctrl *walk_dat;
 
@@ -611,8 +592,8 @@ int file_walk(fd, handler, client_data, line_handler, line_data)
     return DISK_OK;
 }
 
-char *diskFileName(fd)
-     int fd;
+char *
+diskFileName(int fd)
 {
     if (file_table[fd].filename[0])
        return (file_table[fd].filename);
@@ -620,7 +601,8 @@ char *diskFileName(fd)
        return (0);
 }
 
-int diskWriteIsComplete(fd)
+int
+diskWriteIsComplete(int fd)
 {
     return file_table[fd].write_q ? 0 : 1;
 }
index 64144d40be4168049ce6f6150b5502ea4ab628b9..d2971105db493ecfc71d627d87ad99eec3c24d8f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dns.cc,v 1.6 1996/08/30 22:37:23 wessels Exp $
+ * $Id: dns.cc,v 1.7 1996/09/14 08:45:48 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -110,7 +110,7 @@ struct dnsQueueData {
     void *data;
 };
 
-static int dnsOpenServer _PARAMS((char *command));
+static int dnsOpenServer(char *command);
 
 static dnsserver_t **dns_child_table = NULL;
 static int NDnsServersAlloc = 0;
@@ -118,8 +118,8 @@ static int NDnsServersAlloc = 0;
 char *dns_error_message = NULL;        /* possible error message */
 struct _dnsStats DnsStats;
 
-static int dnsOpenServer(command)
-     char *command;
+static int
+dnsOpenServer(char *command)
 {
     int pid;
     u_short port;
@@ -187,7 +187,8 @@ static int dnsOpenServer(command)
     return 0;
 }
 
-dnsserver_t *dnsGetFirstAvailable()
+dnsserver_t *
+dnsGetFirstAvailable()
 {
     int k;
     dnsserver_t *dns = NULL;
@@ -200,7 +201,8 @@ dnsserver_t *dnsGetFirstAvailable()
 }
 
 
-void dnsOpenServers()
+void
+dnsOpenServers()
 {
     int N = Config.dnsChildren;
     char *prg = Config.Program.dnsserver;
@@ -249,8 +251,8 @@ void dnsOpenServers()
 }
 
 
-void dnsStats(sentry)
-     StoreEntry *sentry;
+void
+dnsStats(StoreEntry * sentry)
 {
     int k;
 
@@ -271,7 +273,8 @@ void dnsStats(sentry)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-void dnsShutdownServers()
+void
+dnsShutdownServers()
 {
     dnsserver_t *dnsData = NULL;
     int k;
index 33075a1227a522d13e33a69d76e04da058452e61..19c42b037fefd5c694138b504976fa17b345e176 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.21 1996/09/12 03:24:02 wessels Exp $
+ * $Id: dnsserver.cc,v 1.22 1996/09/14 08:45:50 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
@@ -223,8 +223,8 @@ extern int _dns_ttl_;               /* this is a really *dirty* hack - bne */
 int do_debug = 0;
 
 /* error messages from gethostbyname() */
-static char *my_h_msgs(x)
-     int x;
+static char *
+my_h_msgs(int x)
 {
     if (x == HOST_NOT_FOUND)
        return "Host not found (authoritative)";
@@ -238,9 +238,8 @@ static char *my_h_msgs(x)
        return "Unknown DNS problem";
 }
 
-int main(argc, argv)
-     int argc;
-     char *argv[];
+int
+main(int argc, char *argv[])
 {
     char request[256];
     char msg[256];
index b813fc36982e3bdd91015c081a45b98710673990..f2500112a2574e6874c0b0d7c18b7c9f35a44449 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.37 1996/09/11 22:31:06 wessels Exp $
+ * $Id: errorpage.cc,v 1.38 1996/09/14 08:45:52 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -134,7 +134,8 @@ char *tmp_error_buf;
 static char *tbuf = NULL;
 static char *auth_msg = NULL;
 
-void errorInitialize()
+void
+errorInitialize()
 {
 #ifndef USE_PROXY_AUTH
     tmp_error_buf = xmalloc(MAX_URL * 4);
@@ -148,10 +149,8 @@ void errorInitialize()
     meta_data.misc += MAX_URL * 3;
 }
 
-void squid_error_entry(entry, type, msg)
-     StoreEntry *entry;
-     log_type type;
-     char *msg;
+void
+squid_error_entry(StoreEntry * entry, log_type type, char *msg)
 {
     int index;
 
@@ -184,13 +183,8 @@ void squid_error_entry(entry, type, msg)
 
 
 
-char *squid_error_url(url, method, type, address, code, msg)
-     char *url;
-     int method;
-     int type;
-     char *address;
-     int code;
-     char *msg;
+char *
+squid_error_url(char *url, int method, int type, char *address, int code, char *msg)
 {
     int index;
 
@@ -236,11 +230,8 @@ Generated by %s/%s@%s\n\
 </ADDRESS></BODY></HTML>\n\
 \n"
 
-char *squid_error_request(request, type, address, code)
-     char *request;
-     int type;
-     char *address;
-     int code;
+char *
+squid_error_request(char *request, int type, char *address, int code)
 {
     int index;
 
@@ -260,11 +251,8 @@ char *squid_error_request(request, type, address, code)
     return tmp_error_buf;
 }
 
-char *access_denied_msg(code, method, url, client)
-     int code;
-     int method;
-     char *url;
-     char *client;
+char *
+access_denied_msg(int code, int method, char *url, char *client)
 {
     sprintf(tmp_error_buf, "\
 HTTP/1.0 %d Cache Access Denied\r\n\
@@ -300,12 +288,8 @@ Generated by %s/%s@%s\n\
  *    the message that is sent on deny_info
  *      add a Location: and for old browsers a HREF to the info page
  */
-char *access_denied_redirect(code, method, url, client, redirect)
-     int code;
-     int method;
-     char *url;
-     char *client;
-     char *redirect;
+char *
+access_denied_redirect(int code, int method, char *url, char *client, char *redirect)
 {
     sprintf(tmp_error_buf, "\
 HTTP/1.0 %d Cache Access Deny Redirect\r\n\
@@ -343,9 +327,8 @@ Generated by %s/%s@%s\n\
     return tmp_error_buf;
 }
 
-char *authorization_needed_msg(request, realm)
-     request_t *request;
-     char *realm;
+char *
+authorization_needed_msg(request_t * request, char *realm)
 {
     sprintf(auth_msg, "<HTML><HEAD><TITLE>Authorization needed</TITLE>\n\
 </HEAD><BODY><H1>Authorization needed</H1>\n\
@@ -371,10 +354,10 @@ Generated by %s/%s@%s\n\
        getMyHostname());
 
     mk_mime_hdr(tbuf,
-       (time_t) Config.negativeTtl,
+       "text/html",
        strlen(auth_msg),
-       0,
-       "text/html");
+       squid_curtime,
+       squid_curtime + Config.negativeTtl);
     sprintf(tmp_error_buf, "HTTP/1.0 401 Unauthorized\r\n\
 %s\
 WWW-Authenticate: Basic realm=\"%s\"\r\n\
@@ -411,11 +394,8 @@ Generated by %s/%s@%s\n\
 </ADDRESS>\n\
 "
 
-char *proxy_denied_msg(code, method, url, client)
-     int code;
-     int method;
-     char *url;
-     char *client;
+char *
+proxy_denied_msg(int code, int method, char *url, char *client)
 {
     sprintf(tmp_error_buf, PROXY_AUTH_ERR_MSG,
        code,
index fdf8dba35f8686b6ddc23e26292ee242cfad2fe7..774adf1c15f60cefbf62de9fd20d5ae816d9ad29 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filemap.cc,v 1.8 1996/07/09 03:41:24 wessels Exp $
+ * $Id: filemap.cc,v 1.9 1996/09/14 08:45:56 wessels Exp $
  *
  * DEBUG: section 8     Swap File Bitmap
  * AUTHOR: Harvest Derived
 #define ALL_ONES (unsigned long) 0xFFFFFFFF
 #endif
 
-extern int storeGetSwapSpace _PARAMS((int));
-extern void fatal_dump _PARAMS((char *));
+extern int storeGetSwapSpace(int);
+extern void fatal_dump(char *);
 
 static fileMap *fm = NULL;
 
-fileMap *file_map_create(n)
-     int n;                    /* Number of files */
+fileMap *
+file_map_create(int n)
 {
     fm = xcalloc(1, sizeof(fileMap));
     fm->max_n_files = n;
@@ -142,8 +142,8 @@ fileMap *file_map_create(n)
     return (fm);
 }
 
-int file_map_bit_set(file_number)
-     int file_number;
+int
+file_map_bit_set(int file_number)
 {
     unsigned long bitmask = (1L << (file_number & LONG_BIT_MASK));
 
@@ -166,8 +166,8 @@ int file_map_bit_set(file_number)
     return (file_number);
 }
 
-void file_map_bit_reset(file_number)
-     int file_number;
+void
+file_map_bit_reset(int file_number)
 {
     unsigned long bitmask = (1L << (file_number & LONG_BIT_MASK));
 
@@ -175,16 +175,16 @@ void file_map_bit_reset(file_number)
     fm->n_files_in_map--;
 }
 
-int file_map_bit_test(file_number)
-     int file_number;
+int
+file_map_bit_test(int file_number)
 {
     unsigned long bitmask = (1L << (file_number & LONG_BIT_MASK));
     /* be sure the return value is an int, not a u_long */
     return (fm->file_map[file_number >> LONG_BIT_SHIFT] & bitmask ? 1 : 0);
 }
 
-int file_map_allocate(suggestion)
-     int suggestion;
+int
+file_map_allocate(int suggestion)
 {
     int word;
     int bit;
index a07d317c5a438a990d6c2241b2f3b084a90fa45d..a581d1509f3b9a99f74c0afb84efbe1bb9a7e955 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.16 1996/09/12 03:24:03 wessels Exp $
+ * $Id: fqdncache.cc,v 1.17 1996/09/14 08:45:58 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -137,26 +137,26 @@ static struct {
     int ghba_calls;            /* # calls to blocking gethostbyaddr() */
 } FqdncacheStats;
 
-static int fqdncache_compareLastRef _PARAMS((fqdncache_entry **, fqdncache_entry **));
-static int fqdncache_dnsHandleRead _PARAMS((int, dnsserver_t *));
-static fqdncache_entry *fqdncache_parsebuffer _PARAMS((char *buf, dnsserver_t *));
-static int fqdncache_purgelru _PARAMS((void));
-static void fqdncache_release _PARAMS((fqdncache_entry *));
-static fqdncache_entry *fqdncache_GetFirst _PARAMS((void));
-static fqdncache_entry *fqdncache_GetNext _PARAMS((void));
-static fqdncache_entry *fqdncache_create _PARAMS((void));
-static void fqdncache_add_to_hash _PARAMS((fqdncache_entry *));
-static void fqdncache_call_pending _PARAMS((fqdncache_entry *));
-static void fqdncache_call_pending_badname _PARAMS((int fd, FQDNH handler, void *));
-static void fqdncache_add _PARAMS((char *, fqdncache_entry *, struct hostent *, int));
-static int fqdncacheHasPending _PARAMS((fqdncache_entry *));
-static fqdncache_entry *fqdncache_get _PARAMS((char *));
-static void dummy_handler _PARAMS((int, char *, void *));
-static int fqdncacheExpiredEntry _PARAMS((fqdncache_entry *));
-static void fqdncacheAddPending _PARAMS((fqdncache_entry *, int fd, FQDNH, void *));
-static void fqdncacheEnqueue _PARAMS((fqdncache_entry *));
-static void *fqdncacheDequeue _PARAMS((void));
-static void fqdncache_dnsDispatch _PARAMS((dnsserver_t *, fqdncache_entry *));
+static int fqdncache_compareLastRef(fqdncache_entry **, fqdncache_entry **);
+static int fqdncache_dnsHandleRead(int, dnsserver_t *);
+static fqdncache_entry *fqdncache_parsebuffer(char *buf, dnsserver_t *);
+static int fqdncache_purgelru(void);
+static void fqdncache_release(fqdncache_entry *);
+static fqdncache_entry *fqdncache_GetFirst(void);
+static fqdncache_entry *fqdncache_GetNext(void);
+static fqdncache_entry *fqdncache_create(void);
+static void fqdncache_add_to_hash(fqdncache_entry *);
+static void fqdncache_call_pending(fqdncache_entry *);
+static void fqdncache_call_pending_badname(int fd, FQDNH handler, void *);
+static void fqdncache_add(char *, fqdncache_entry *, struct hostent *, int);
+static int fqdncacheHasPending(fqdncache_entry *);
+static fqdncache_entry *fqdncache_get(char *);
+static void dummy_handler(int, char *, void *);
+static int fqdncacheExpiredEntry(fqdncache_entry *);
+static void fqdncacheAddPending(fqdncache_entry *, int fd, FQDNH, void *);
+static void fqdncacheEnqueue(fqdncache_entry *);
+static void *fqdncacheDequeue(void);
+static void fqdncache_dnsDispatch(dnsserver_t *, fqdncache_entry *);
 
 static struct hostent *static_result = NULL;
 static HashID fqdn_table = 0;
@@ -174,8 +174,8 @@ static char fqdncache_status_char[] =
 long fqdncache_low = 180;
 long fqdncache_high = 200;
 
-static void fqdncacheEnqueue(f)
-     fqdncache_entry *f;
+static void
+fqdncacheEnqueue(fqdncache_entry * f)
 {
     struct fqdncacheQueueData *new = xcalloc(1, sizeof(struct fqdncacheQueueData));
     new->f = f;
@@ -183,7 +183,8 @@ static void fqdncacheEnqueue(f)
     fqdncacheQueueTailP = &new->next;
 }
 
-static void *fqdncacheDequeue()
+static void *
+fqdncacheDequeue()
 {
     struct fqdncacheQueueData *old = NULL;
     fqdncache_entry *f = NULL;
@@ -199,8 +200,8 @@ static void *fqdncacheDequeue()
 }
 
 /* removes the given fqdncache entry */
-static void fqdncache_release(f)
-     fqdncache_entry *f;
+static void
+fqdncache_release(fqdncache_entry * f)
 {
     fqdncache_entry *result = NULL;
     hash_link *table_entry = NULL;
@@ -241,8 +242,8 @@ static void fqdncache_release(f)
 }
 
 /* return match for given name */
-static fqdncache_entry *fqdncache_get(name)
-     char *name;
+static fqdncache_entry *
+fqdncache_get(char *name)
 {
     hash_link *e;
     static fqdncache_entry *f;
@@ -255,18 +256,20 @@ static fqdncache_entry *fqdncache_get(name)
     return f;
 }
 
-static fqdncache_entry *fqdncache_GetFirst()
+static fqdncache_entry *
+fqdncache_GetFirst()
 {
     return (fqdncache_entry *) hash_first(fqdn_table);
 }
 
-static fqdncache_entry *fqdncache_GetNext()
+static fqdncache_entry *
+fqdncache_GetNext()
 {
     return (fqdncache_entry *) hash_next(fqdn_table);
 }
 
-static int fqdncache_compareLastRef(e1, e2)
-     fqdncache_entry **e1, **e2;
+static int
+fqdncache_compareLastRef(fqdncache_entry ** e1, fqdncache_entry ** e2)
 {
     if (!e1 || !e2)
        fatal_dump(NULL);
@@ -277,8 +280,8 @@ static int fqdncache_compareLastRef(e1, e2)
     return (0);
 }
 
-static int fqdncacheExpiredEntry(f)
-     fqdncache_entry *f;
+static int
+fqdncacheExpiredEntry(fqdncache_entry * f)
 {
     if (f->status == FQDN_PENDING)
        return 0;
@@ -290,7 +293,8 @@ static int fqdncacheExpiredEntry(f)
 }
 
 /* finds the LRU and deletes */
-static int fqdncache_purgelru()
+static int
+fqdncache_purgelru()
 {
     fqdncache_entry *f = NULL;
     int local_fqdn_count = 0;
@@ -353,7 +357,8 @@ static int fqdncache_purgelru()
 
 
 /* create blank fqdncache_entry */
-static fqdncache_entry *fqdncache_create()
+static fqdncache_entry *
+fqdncache_create()
 {
     static fqdncache_entry *new;
 
@@ -367,8 +372,8 @@ static fqdncache_entry *fqdncache_create()
 
 }
 
-static void fqdncache_add_to_hash(f)
-     fqdncache_entry *f;
+static void
+fqdncache_add_to_hash(fqdncache_entry * f)
 {
     if (hash_join(fqdn_table, (hash_link *) f)) {
        debug(35, 1, "fqdncache_add_to_hash: Cannot add %s (%p) to hash table %d.\n",
@@ -378,11 +383,8 @@ static void fqdncache_add_to_hash(f)
 }
 
 
-static void fqdncache_add(name, f, hp, cached)
-     char *name;
-     fqdncache_entry *f;
-     struct hostent *hp;
-     int cached;
+static void
+fqdncache_add(char *name, fqdncache_entry * f, struct hostent *hp, int cached)
 {
     int k;
 
@@ -411,8 +413,8 @@ static void fqdncache_add(name, f, hp, cached)
 }
 
 /* walks down the pending list, calling handlers */
-static void fqdncache_call_pending(f)
-     fqdncache_entry *f;
+static void
+fqdncache_call_pending(fqdncache_entry * f)
 {
     struct _fqdn_pending *p = NULL;
     int nhandler = 0;
@@ -436,18 +438,15 @@ static void fqdncache_call_pending(f)
     debug(35, 10, "fqdncache_call_pending: Called %d handlers.\n", nhandler);
 }
 
-static void fqdncache_call_pending_badname(fd, handler, data)
-     int fd;
-     FQDNH handler;
-     void *data;
+static void
+fqdncache_call_pending_badname(int fd, FQDNH handler, void *data)
 {
     debug(35, 0, "fqdncache_call_pending_badname: Bad Name: Calling handler with NULL result.\n");
     handler(fd, NULL, data);
 }
 
-static fqdncache_entry *fqdncache_parsebuffer(inbuf, dnsData)
-     char *inbuf;
-     dnsserver_t *dnsData;
+static fqdncache_entry *
+fqdncache_parsebuffer(char *inbuf, dnsserver_t * dnsData)
 {
     char *buf = xstrdup(inbuf);
     char *token;
@@ -513,9 +512,8 @@ static fqdncache_entry *fqdncache_parsebuffer(inbuf, dnsData)
     return &f;
 }
 
-static int fqdncache_dnsHandleRead(fd, dnsData)
-     int fd;
-     dnsserver_t *dnsData;
+static int
+fqdncache_dnsHandleRead(int fd, dnsserver_t * dnsData)
 {
     int len;
     int svc_time;
@@ -576,11 +574,8 @@ static int fqdncache_dnsHandleRead(fd, dnsData)
     return 0;
 }
 
-static void fqdncacheAddPending(f, fd, handler, handlerData)
-     fqdncache_entry *f;
-     int fd;
-     FQDNH handler;
-     void *handlerData;
+static void
+fqdncacheAddPending(fqdncache_entry * f, int fd, FQDNH handler, void *handlerData)
 {
     struct _fqdn_pending *pending = xcalloc(1, sizeof(struct _fqdn_pending));
     struct _fqdn_pending **I = NULL;
@@ -593,11 +588,8 @@ static void fqdncacheAddPending(f, fd, handler, handlerData)
     *I = pending;
 }
 
-int fqdncache_nbgethostbyaddr(addr, fd, handler, handlerData)
-     struct in_addr addr;
-     int fd;
-     FQDNH handler;
-     void *handlerData;
+int
+fqdncache_nbgethostbyaddr(struct in_addr addr, int fd, FQDNH handler, void *handlerData)
 {
     fqdncache_entry *f = NULL;
     dnsserver_t *dnsData = NULL;
@@ -657,9 +649,8 @@ int fqdncache_nbgethostbyaddr(addr, fd, handler, handlerData)
     return 0;
 }
 
-static void fqdncache_dnsDispatch(dns, f)
-     dnsserver_t *dns;
-     fqdncache_entry *f;
+static void
+fqdncache_dnsDispatch(dnsserver_t * dns, fqdncache_entry * f)
 {
     char *buf = NULL;
     if (!fqdncacheHasPending(f)) {
@@ -694,7 +685,8 @@ static void fqdncache_dnsDispatch(dns, f)
 
 
 /* initialize the fqdncache */
-void fqdncache_init()
+void
+fqdncache_init()
 {
     debug(35, 3, "Initializing FQDN Cache...\n");
 
@@ -716,9 +708,8 @@ void fqdncache_init()
 
 /* clean up the pending entries in dnsserver */
 /* return 1 if we found the host, 0 otherwise */
-int fqdncacheUnregister(addr, fd)
-     struct in_addr addr;
-     int fd;
+int
+fqdncacheUnregister(struct in_addr addr, int fd)
 {
     char *name = inet_ntoa(addr);
     fqdncache_entry *f = NULL;
@@ -741,9 +732,8 @@ int fqdncacheUnregister(addr, fd)
     return n;
 }
 
-char *fqdncache_gethostbyaddr(addr, flags)
-     struct in_addr addr;
-     int flags;
+char *
+fqdncache_gethostbyaddr(struct in_addr addr, int flags)
 {
     char *name = inet_ntoa(addr);
     fqdncache_entry *f = NULL;
@@ -794,8 +784,8 @@ char *fqdncache_gethostbyaddr(addr, flags)
 
 
 /* process objects list */
-void fqdnStats(sentry)
-     StoreEntry *sentry;
+void
+fqdnStats(StoreEntry * sentry)
 {
     fqdncache_entry *f = NULL;
     int k;
@@ -841,16 +831,14 @@ void fqdnStats(sentry)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-static void dummy_handler(u1, u2, u3)
-     int u1;
-     char *u2;
-     void *u3;
+static void
+dummy_handler(int u1, char *u2, void *u3)
 {
     return;
 }
 
-static int fqdncacheHasPending(f)
-     fqdncache_entry *f;
+static int
+fqdncacheHasPending(fqdncache_entry * f)
 {
     struct _fqdn_pending *p = NULL;
     if (f->status != FQDN_PENDING)
@@ -861,8 +849,8 @@ static int fqdncacheHasPending(f)
     return 0;
 }
 
-void fqdncacheReleaseInvalid(name)
-     char *name;
+void
+fqdncacheReleaseInvalid(char *name)
 {
     fqdncache_entry *f;
     if ((f = fqdncache_get(name)) == NULL)
@@ -872,8 +860,8 @@ void fqdncacheReleaseInvalid(name)
     fqdncache_release(f);
 }
 
-char *fqdnFromAddr(addr)
-     struct in_addr addr;
+char *
+fqdnFromAddr(struct in_addr addr)
 {
     char *n;
     static char buf[32];
@@ -883,7 +871,8 @@ char *fqdnFromAddr(addr)
     return buf;
 }
 
-int fqdncacheQueueDrain()
+int
+fqdncacheQueueDrain()
 {
     fqdncache_entry *i;
     dnsserver_t *dnsData;
index c7930b79dae7356bd564648c5e2ee5d1b2697f41..305c1f1422a6ea52bfea947650ccfce15b8682cc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.54 1996/09/12 16:39:53 wessels Exp $
+ * $Id: ftp.cc,v 1.55 1996/09/14 08:45:59 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -127,26 +127,25 @@ typedef struct _Ftpdata {
 } FtpData;
 
 /* Local functions */
-static int ftpStateFree _PARAMS((int fd, FtpData * ftpState));
-static void ftpProcessReplyHeader _PARAMS((FtpData * data, char *buf, int size));
-static void ftpServerClosed _PARAMS((int fd, void *nodata));
-static void ftp_login_parser _PARAMS((char *login, FtpData * data));
-static char *ftpTransferMode _PARAMS((char *urlpath));
+static int ftpStateFree(int fd, FtpData * ftpState);
+static void ftpProcessReplyHeader(FtpData * data, char *buf, int size);
+static void ftpServerClosed(int fd, void *nodata);
+static void ftp_login_parser(char *login, FtpData * data);
+static char *ftpTransferMode(char *urlpath);
 
 /* Global functions not declared in ftp.h */
-void ftpLifetimeExpire _PARAMS((int fd, FtpData * data));
-int ftpReadReply _PARAMS((int fd, FtpData * data));
-void ftpSendComplete _PARAMS((int fd, char *buf, int size, int errflag, void *ftpData));
-void ftpSendRequest _PARAMS((int fd, FtpData * data));
-void ftpConnInProgress _PARAMS((int fd, FtpData * data));
-void ftpServerClose _PARAMS((void));
+void ftpLifetimeExpire(int fd, FtpData * data);
+int ftpReadReply(int fd, FtpData * data);
+void ftpSendComplete(int fd, char *buf, int size, int errflag, void *ftpData);
+void ftpSendRequest(int fd, FtpData * data);
+void ftpConnInProgress(int fd, FtpData * data);
+void ftpServerClose(void);
 
 /* External functions */
-extern char *base64_decode _PARAMS((char *coded));
+extern char *base64_decode(char *coded);
 
-static int ftpStateFree(fd, ftpState)
-     int fd;
-     FtpData *ftpState;
+static int
+ftpStateFree(int fd, FtpData * ftpState)
 {
     if (ftpState == NULL)
        return 1;
@@ -160,9 +159,8 @@ static int ftpStateFree(fd, ftpState)
     return 0;
 }
 
-static void ftp_login_parser(login, data)
-     char *login;
-     FtpData *data;
+static void
+ftp_login_parser(char *login, FtpData * data)
 {
     char *user = data->user;
     char *password = data->password;
@@ -184,9 +182,8 @@ static void ftp_login_parser(login, data)
 }
 
 /* This will be called when socket lifetime is expired. */
-void ftpLifetimeExpire(fd, data)
-     int fd;
-     FtpData *data;
+void
+ftpLifetimeExpire(int fd, FtpData * data)
 {
     StoreEntry *entry = NULL;
     entry = data->entry;
@@ -198,10 +195,8 @@ void ftpLifetimeExpire(fd, data)
 
 /* This is too much duplicated code from httpProcessReplyHeader.  Only
  * difference is FtpData vs HttpData. */
-static void ftpProcessReplyHeader(data, buf, size)
-     FtpData *data;
-     char *buf;                        /* chunk just read by ftpReadReply() */
-     int size;
+static void
+ftpProcessReplyHeader(FtpData * data, char *buf, int size)
 {
     char *t = NULL;
     StoreEntry *entry = data->entry;
@@ -279,9 +274,8 @@ static void ftpProcessReplyHeader(data, buf, size)
 
 /* This will be called when data is ready to be read from fd.  Read until
  * error or connection closed. */
-int ftpReadReply(fd, data)
-     int fd;
-     FtpData *data;
+int
+ftpReadReply(int fd, FtpData * data)
 {
     LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF);
     int len;
@@ -409,12 +403,8 @@ int ftpReadReply(fd, data)
     return 0;
 }
 
-void ftpSendComplete(fd, buf, size, errflag, data)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *data;
+void
+ftpSendComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     FtpData *ftpState = (FtpData *) data;
     StoreEntry *entry = NULL;
@@ -443,8 +433,8 @@ void ftpSendComplete(fd, buf, size, errflag, data)
     }
 }
 
-static char *ftpTransferMode(urlpath)
-     char *urlpath;
+static char *
+ftpTransferMode(char *urlpath)
 {
     static char ftpASCII[] = "A";
     static char ftpBinary[] = "I";
@@ -463,9 +453,8 @@ static char *ftpTransferMode(urlpath)
     return ftpBinary;
 }
 
-void ftpSendRequest(fd, data)
-     int fd;
-     FtpData *data;
+void
+ftpSendRequest(int fd, FtpData * data)
 {
     char *path = NULL;
     char *mode = NULL;
@@ -541,9 +530,8 @@ void ftpSendRequest(fd, data)
        put_free_8k_page);
 }
 
-void ftpConnInProgress(fd, data)
-     int fd;
-     FtpData *data;
+void
+ftpConnInProgress(int fd, FtpData * data)
 {
     StoreEntry *entry = data->entry;
 
@@ -575,11 +563,8 @@ void ftpConnInProgress(fd, data)
 }
 
 
-int ftpStart(unusedfd, url, request, entry)
-     int unusedfd;
-     char *url;
-     request_t *request;
-     StoreEntry *entry;
+int
+ftpStart(int unusedfd, char *url, request_t * request, StoreEntry * entry)
 {
     LOCAL_ARRAY(char, realm, 8192);
     FtpData *data = NULL;
@@ -682,9 +667,8 @@ int ftpStart(unusedfd, url, request, entry)
     return COMM_OK;
 }
 
-static void ftpServerClosed(fd, nodata)
-     int fd;
-     void *nodata;
+static void
+ftpServerClosed(int fd, void *nodata)
 {
     static time_t last_restart = 0;
     comm_close(fd);
@@ -698,7 +682,8 @@ static void ftpServerClosed(fd, nodata)
     (void) ftpInitialize();
 }
 
-void ftpServerClose()
+void
+ftpServerClose()
 {
     /* NOTE: this function will be called repeatedly while shutdown is
      * pending */
@@ -717,7 +702,8 @@ void ftpServerClose()
 }
 
 
-int ftpInitialize()
+int
+ftpInitialize()
 {
     int pid;
     int cfd;
index 4ec917f006240f1ce575a89590825e78e4010960..24cf0f249f4ba9820e995c28efc61eea2c232bb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.42 1996/09/12 16:39:53 wessels Exp $
+ * $Id: gopher.cc,v 1.43 1996/09/14 08:46:02 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -158,33 +158,32 @@ typedef struct gopher_ds {
     char *buf;                 /* pts to a 4k page */
 } GopherStateData;
 
-static int gopherStateFree _PARAMS((int fd, GopherStateData *));
-static void gopher_mime_content _PARAMS((char *buf, char *name, char *def));
-static void gopherMimeCreate _PARAMS((GopherStateData *));
+static int gopherStateFree(int fd, GopherStateData *);
+static void gopher_mime_content(char *buf, char *name, char *def);
+static void gopherMimeCreate(GopherStateData *);
 static int gopher_url_parser _PARAMS((char *url,
        char *host,
        int *port,
        char *type_id,
        char *request));
-static void gopherEndHTML _PARAMS((GopherStateData *));
-static void gopherToHTML _PARAMS((GopherStateData *, char *inbuf, int len));
-static int gopherReadReplyTimeout _PARAMS((int fd, GopherStateData *));
-static void gopherLifetimeExpire _PARAMS((int fd, GopherStateData *));
-static void gopherReadReply _PARAMS((int fd, GopherStateData *));
+static void gopherEndHTML(GopherStateData *);
+static void gopherToHTML(GopherStateData *, char *inbuf, int len);
+static int gopherReadReplyTimeout(int fd, GopherStateData *);
+static void gopherLifetimeExpire(int fd, GopherStateData *);
+static void gopherReadReply(int fd, GopherStateData *);
 static void gopherSendComplete _PARAMS((int fd,
        char *buf,
        int size,
        int errflag,
        void *data));
-static void gopherSendRequest _PARAMS((int fd, GopherStateData *));
-static GopherStateData *CreateGopherStateData _PARAMS((void));
+static void gopherSendRequest(int fd, GopherStateData *);
+static GopherStateData *CreateGopherStateData(void);
 
 static char def_gopher_bin[] = "www/unknown";
 static char def_gopher_text[] = "text/plain";
 
-static int gopherStateFree(fd, gopherState)
-     int fd;
-     GopherStateData *gopherState;
+static int
+gopherStateFree(int fd, GopherStateData * gopherState)
 {
     if (gopherState == NULL)
        return 1;
@@ -197,10 +196,8 @@ static int gopherStateFree(fd, gopherState)
 
 
 /* figure out content type from file extension */
-static void gopher_mime_content(buf, name, def)
-     char *buf;
-     char *name;
-     char *def;
+static void
+gopher_mime_content(char *buf, char *name, char *def)
 {
     LOCAL_ARRAY(char, temp, MAX_URL + 1);
     char *ext1 = NULL;
@@ -249,8 +246,8 @@ static void gopher_mime_content(buf, name, def)
 
 
 /* create MIME Header for Gopher Data */
-static void gopherMimeCreate(data)
-     GopherStateData *data;
+static void
+gopherMimeCreate(GopherStateData * data)
 {
     LOCAL_ARRAY(char, tempMIME, MAX_MIME);
 
@@ -300,12 +297,8 @@ MIME-version: 1.0\r\n", version_string);
 }
 
 /* Parse a gopher url into components.  By Anawat. */
-static int gopher_url_parser(url, host, port, type_id, request)
-     char *url;
-     char *host;
-     int *port;
-     char *type_id;
-     char *request;
+static int
+gopher_url_parser(char *url, char *host, int *port, char *type_id, char *request)
 {
     LOCAL_ARRAY(char, proto, MAX_URL);
     LOCAL_ARRAY(char, hostbuf, MAX_URL);
@@ -337,8 +330,8 @@ static int gopher_url_parser(url, host, port, type_id, request)
     return 0;
 }
 
-int gopherCachable(url)
-     char *url;
+int
+gopherCachable(char *url)
 {
     GopherStateData *data = NULL;
     int cachable = 1;
@@ -364,8 +357,8 @@ int gopherCachable(url)
     return cachable;
 }
 
-static void gopherEndHTML(data)
-     GopherStateData *data;
+static void
+gopherEndHTML(GopherStateData * data)
 {
     LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
 
@@ -380,10 +373,8 @@ static void gopherEndHTML(data)
 
 /* Convert Gopher to HTML */
 /* Borrow part of code from libwww2 came with Mosaic distribution */
-static void gopherToHTML(data, inbuf, len)
-     GopherStateData *data;
-     char *inbuf;
-     int len;
+static void
+gopherToHTML(GopherStateData * data, char *inbuf, int len)
 {
     char *pos = inbuf;
     char *lpos = NULL;
@@ -682,9 +673,8 @@ static void gopherToHTML(data, inbuf, len)
     return;
 }
 
-static int gopherReadReplyTimeout(fd, data)
-     int fd;
-     GopherStateData *data;
+static int
+gopherReadReplyTimeout(int fd, GopherStateData * data)
 {
     StoreEntry *entry = NULL;
     entry = data->entry;
@@ -695,9 +685,8 @@ static int gopherReadReplyTimeout(fd, data)
 }
 
 /* This will be called when socket lifetime is expired. */
-static void gopherLifetimeExpire(fd, data)
-     int fd;
-     GopherStateData *data;
+static void
+gopherLifetimeExpire(int fd, GopherStateData * data)
 {
     StoreEntry *entry = NULL;
     entry = data->entry;
@@ -715,9 +704,8 @@ static void gopherLifetimeExpire(fd, data)
 
 /* This will be called when data is ready to be read from fd.  Read until
  * error or connection closed. */
-static void gopherReadReply(fd, data)
-     int fd;
-     GopherStateData *data;
+static void
+gopherReadReply(int fd, GopherStateData * data)
 {
     char *buf = NULL;
     int len;
@@ -866,12 +854,8 @@ static void gopherReadReply(fd, data)
 
 /* This will be called when request write is complete. Schedule read of
  * reply. */
-static void gopherSendComplete(fd, buf, size, errflag, data)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *data;
+static void
+gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     GopherStateData *gopherState = (GopherStateData *) data;
     StoreEntry *entry = NULL;
@@ -939,9 +923,8 @@ static void gopherSendComplete(fd, buf, size, errflag, data)
 }
 
 /* This will be called when connect completes. Write request. */
-static void gopherSendRequest(fd, data)
-     int fd;
-     GopherStateData *data;
+static void
+gopherSendRequest(int fd, GopherStateData * data)
 {
     int len;
     LOCAL_ARRAY(char, query, MAX_URL);
@@ -975,10 +958,8 @@ static void gopherSendRequest(fd, data)
        storeSetPublicKey(data->entry);         /* Make it public */
 }
 
-int gopherStart(unusedfd, url, entry)
-     int unusedfd;
-     char *url;
-     StoreEntry *entry;
+int
+gopherStart(int unusedfd, char *url, StoreEntry * entry)
 {
     /* Create state structure. */
     int sock, status;
@@ -1062,7 +1043,8 @@ int gopherStart(unusedfd, url, entry)
 }
 
 
-static GopherStateData *CreateGopherStateData()
+static GopherStateData *
+CreateGopherStateData()
 {
     GopherStateData *gd = xcalloc(1, sizeof(GopherStateData));
     gd->buf = get_free_4k_page();
index 139b24031dd31b2a7e54f4af35553a0540707fe5..3059778497a7ff9e476009dc5d7ca782ba838ff9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.73 1996/09/12 16:39:54 wessels Exp $
+ * $Id: http.cc,v 1.74 1996/09/14 08:46:05 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -116,21 +116,20 @@ struct {
     int ctype;
 } ReplyHeaderStats;
 
-static int httpStateFree _PARAMS((int fd, HttpStateData *));
-static void httpReadReplyTimeout _PARAMS((int fd, HttpStateData *));
-static void httpLifetimeExpire _PARAMS((int fd, HttpStateData *));
-static void httpMakePublic _PARAMS((StoreEntry *));
-static void httpMakePrivate _PARAMS((StoreEntry *));
-static void httpCacheNegatively _PARAMS((StoreEntry *));
-static void httpReadReply _PARAMS((int fd, HttpStateData *));
-static void httpSendComplete _PARAMS((int fd, char *, int, int, void *));
-static void httpSendRequest _PARAMS((int fd, HttpStateData *));
-static void httpConnInProgress _PARAMS((int fd, HttpStateData *));
-static int httpConnect _PARAMS((int fd, struct hostent *, void *));
-
-static int httpStateFree(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static int httpStateFree(int fd, HttpStateData *);
+static void httpReadReplyTimeout(int fd, HttpStateData *);
+static void httpLifetimeExpire(int fd, HttpStateData *);
+static void httpMakePublic(StoreEntry *);
+static void httpMakePrivate(StoreEntry *);
+static void httpCacheNegatively(StoreEntry *);
+static void httpReadReply(int fd, HttpStateData *);
+static void httpSendComplete(int fd, char *, int, int, void *);
+static void httpSendRequest(int fd, HttpStateData *);
+static void httpConnInProgress(int fd, HttpStateData *);
+static int httpConnect(int fd, struct hostent *, void *);
+
+static int
+httpStateFree(int fd, HttpStateData * httpState)
 {
     if (httpState == NULL)
        return 1;
@@ -144,9 +143,8 @@ static int httpStateFree(fd, httpState)
     return 0;
 }
 
-int httpCachable(url, method)
-     char *url;
-     int method;
+int
+httpCachable(char *url, int method)
 {
     /* GET and HEAD are cachable. Others are not. */
     if (method != METHOD_GET && method != METHOD_HEAD)
@@ -156,9 +154,8 @@ int httpCachable(url, method)
 }
 
 /* This will be called when timeout on read. */
-static void httpReadReplyTimeout(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static void
+httpReadReplyTimeout(int fd, HttpStateData * httpState)
 {
     StoreEntry *entry = NULL;
 
@@ -170,9 +167,8 @@ static void httpReadReplyTimeout(fd, httpState)
 }
 
 /* This will be called when socket lifetime is expired. */
-static void httpLifetimeExpire(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static void
+httpLifetimeExpire(int fd, HttpStateData * httpState)
 {
     StoreEntry *entry = NULL;
 
@@ -185,8 +181,8 @@ static void httpLifetimeExpire(fd, httpState)
 }
 
 /* This object can be cached for a long time */
-static void httpMakePublic(entry)
-     StoreEntry *entry;
+static void
+httpMakePublic(StoreEntry * entry)
 {
     ttlSet(entry);
     if (BIT_TEST(entry->flag, ENTRY_CACHABLE))
@@ -194,8 +190,8 @@ static void httpMakePublic(entry)
 }
 
 /* This object should never be cached at all */
-static void httpMakePrivate(entry)
-     StoreEntry *entry;
+static void
+httpMakePrivate(StoreEntry * entry)
 {
     storeSetPrivateKey(entry);
     storeExpireNow(entry);
@@ -204,8 +200,8 @@ static void httpMakePrivate(entry)
 }
 
 /* This object may be negatively cached */
-static void httpCacheNegatively(entry)
-     StoreEntry *entry;
+static void
+httpCacheNegatively(StoreEntry * entry)
 {
     storeNegativeCache(entry);
     if (BIT_TEST(entry->flag, ENTRY_CACHABLE))
@@ -214,9 +210,8 @@ static void httpCacheNegatively(entry)
 
 
 /* Build a reply structure from HTTP reply headers */
-void httpParseHeaders(buf, reply)
-     char *buf;
-     struct _http_reply *reply;
+void
+httpParseHeaders(char *buf, struct _http_reply *reply)
 {
     char *headers = NULL;
     char *t = NULL;
@@ -279,10 +274,8 @@ void httpParseHeaders(buf, reply)
 }
 
 
-void httpProcessReplyHeader(httpState, buf, size)
-     HttpStateData *httpState;
-     char *buf;                        /* chunk just read by httpReadReply() */
-     int size;
+void
+httpProcessReplyHeader(HttpStateData * httpState, char *buf, int size)
 {
     char *t = NULL;
     StoreEntry *entry = httpState->entry;
@@ -393,9 +386,8 @@ void httpProcessReplyHeader(httpState, buf, size)
 /* This will be called when data is ready to be read from fd.  Read until
  * error or connection closed. */
 /* XXX this function is too long! */
-static void httpReadReply(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static void
+httpReadReply(int fd, HttpStateData * httpState)
 {
     LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF);
     int len;
@@ -517,12 +509,8 @@ static void httpReadReply(fd, httpState)
 
 /* This will be called when request write is complete. Schedule read of
  * reply. */
-static void httpSendComplete(fd, buf, size, errflag, data)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *data;
+static void
+httpSendComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     HttpStateData *httpState = data;
     StoreEntry *entry = NULL;
@@ -551,9 +539,8 @@ static void httpSendComplete(fd, buf, size, errflag, data)
 }
 
 /* This will be called when connect completes. Write request. */
-static void httpSendRequest(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static void
+httpSendRequest(int fd, HttpStateData * httpState)
 {
     char *xbuf = NULL;
     char *ybuf = NULL;
@@ -648,9 +635,8 @@ static void httpSendRequest(fd, httpState)
        buftype == BUF_TYPE_8K ? put_free_8k_page : xfree);
 }
 
-static void httpConnInProgress(fd, httpState)
-     int fd;
-     HttpStateData *httpState;
+static void
+httpConnInProgress(int fd, HttpStateData * httpState)
 {
     StoreEntry *entry = httpState->entry;
     request_t *req = httpState->request;
@@ -681,10 +667,8 @@ static void httpConnInProgress(fd, httpState)
        (PF) httpSendRequest, (void *) httpState);
 }
 
-int proxyhttpStart(e, url, entry)
-     edge *e;
-     char *url;
-     StoreEntry *entry;
+int
+proxyhttpStart(edge * e, char *url, StoreEntry * entry)
 {
     int sock;
     HttpStateData *httpState = NULL;
@@ -727,10 +711,8 @@ int proxyhttpStart(e, url, entry)
     return COMM_OK;
 }
 
-static int httpConnect(fd, hp, data)
-     int fd;
-     struct hostent *hp;
-     void *data;
+static int
+httpConnect(int fd, struct hostent *hp, void *data)
 {
     HttpStateData *httpState = data;
     request_t *request = httpState->request;
@@ -773,12 +755,8 @@ static int httpConnect(fd, hp, data)
     return COMM_OK;
 }
 
-int httpStart(unusedfd, url, request, req_hdr, entry)
-     int unusedfd;
-     char *url;
-     request_t *request;
-     char *req_hdr;
-     StoreEntry *entry;
+int
+httpStart(int unusedfd, char *url, request_t * request, char *req_hdr, StoreEntry * entry)
 {
     /* Create state structure. */
     int sock;
@@ -810,8 +788,8 @@ int httpStart(unusedfd, url, request, req_hdr, entry)
     return COMM_OK;
 }
 
-void httpReplyHeaderStats(entry)
-     StoreEntry *entry;
+void
+httpReplyHeaderStats(StoreEntry * entry)
 {
     storeAppendPrintf(entry, open_bracket);
     storeAppendPrintf(entry, "{HTTP Reply Headers}\n");
index 28ec383eebf8c47bb016c896fa04a5d0a7e75da8..2d1380d04887fccdca044529611e95c91cda35a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ident.cc,v 1.10 1996/08/31 06:40:19 wessels Exp $
+ * $Id: ident.cc,v 1.11 1996/09/14 08:46:09 wessels Exp $
  *
  * DEBUG: section 30    Ident (RFC 931)
  * AUTHOR: Duane Wessels
 
 #define IDENT_PORT 113
 
-static void identRequestComplete _PARAMS((int, char *, int, int, void *));
-static void identReadReply _PARAMS((int, icpStateData *));
-static void identClose _PARAMS((int, icpStateData *));
+static void identRequestComplete(int, char *, int, int, void *);
+static void identReadReply(int, icpStateData *);
+static void identClose(int, icpStateData *);
 
-static void identClose(fd, icpState)
-     int fd;
-     icpStateData *icpState;
+static void
+identClose(int fd, icpStateData * icpState)
 {
     icpState->ident_fd = -1;
 }
 
 /* start a TCP connection to the peer host on port 113 */
-void identStart(sock, icpState)
-     icpStateData *icpState;
+void
+identStart(int sock, icpStateData * icpState)
 {
     char *host;
     u_short port;
@@ -91,19 +90,14 @@ void identStart(sock, icpState)
        (void *) icpState);
 }
 
-static void identRequestComplete(fd, buf, size, errflag, data)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *data;
+static void
+identRequestComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     debug(30, 5, "identRequestComplete: FD %d: wrote %d bytes\n", fd, size);
 }
 
-static void identReadReply(fd, icpState)
-     int fd;
-     icpStateData *icpState;
+static void
+identReadReply(int fd, icpStateData * icpState)
 {
     LOCAL_ARRAY(char, buf, BUFSIZ);
     char *t = NULL;
index 33072dc2d548fd72beaba8bfb0f26b50d8d6db82..aae024d37c735f641626eefa916df832ca3babf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ipcache.cc,v 1.55 1996/09/04 22:03:26 wessels Exp $
+ * $Id: ipcache.cc,v 1.56 1996/09/14 08:46:10 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -135,30 +135,30 @@ static struct {
     int ghbn_calls;            /* # calls to blocking gethostbyname() */
 } IpcacheStats;
 
-static int ipcache_testname _PARAMS((void));
-static int ipcache_compareLastRef _PARAMS((ipcache_entry **, ipcache_entry **));
-static int ipcache_reverseLastRef _PARAMS((ipcache_entry **, ipcache_entry **));
-static int ipcache_dnsHandleRead _PARAMS((int, dnsserver_t *));
-static ipcache_entry *ipcache_parsebuffer _PARAMS((char *buf, dnsserver_t *));
-static void ipcache_release _PARAMS((ipcache_entry *));
-static ipcache_entry *ipcache_GetFirst _PARAMS((void));
-static ipcache_entry *ipcache_GetNext _PARAMS((void));
-static ipcache_entry *ipcache_create _PARAMS((void));
-static void ipcache_add_to_hash _PARAMS((ipcache_entry *));
-static void ipcache_call_pending _PARAMS((ipcache_entry *));
-static void ipcache_add _PARAMS((char *, ipcache_entry *, struct hostent *, int));
-static int ipcacheHasPending _PARAMS((ipcache_entry *));
-static ipcache_entry *ipcache_get _PARAMS((char *));
-static int dummy_handler _PARAMS((int, struct hostent * hp, void *));
-static int ipcacheExpiredEntry _PARAMS((ipcache_entry *));
-static void ipcacheAddPending _PARAMS((ipcache_entry *, int fd, IPH, void *));
-static void ipcacheEnqueue _PARAMS((ipcache_entry *));
-static void *ipcacheDequeue _PARAMS((void));
-static void ipcache_dnsDispatch _PARAMS((dnsserver_t *, ipcache_entry *));
-static struct hostent *ipcacheCheckNumeric _PARAMS((char *name));
-static void ipcacheStatPrint _PARAMS((ipcache_entry *, StoreEntry *));
-static void ipcacheUnlockEntry _PARAMS((ipcache_entry *));
-static void ipcacheLockEntry _PARAMS((ipcache_entry *));
+static int ipcache_testname(void);
+static int ipcache_compareLastRef(ipcache_entry **, ipcache_entry **);
+static int ipcache_reverseLastRef(ipcache_entry **, ipcache_entry **);
+static int ipcache_dnsHandleRead(int, dnsserver_t *);
+static ipcache_entry *ipcache_parsebuffer(char *buf, dnsserver_t *);
+static void ipcache_release(ipcache_entry *);
+static ipcache_entry *ipcache_GetFirst(void);
+static ipcache_entry *ipcache_GetNext(void);
+static ipcache_entry *ipcache_create(void);
+static void ipcache_add_to_hash(ipcache_entry *);
+static void ipcache_call_pending(ipcache_entry *);
+static void ipcache_add(char *, ipcache_entry *, struct hostent *, int);
+static int ipcacheHasPending(ipcache_entry *);
+static ipcache_entry *ipcache_get(char *);
+static int dummy_handler(int, struct hostent *hp, void *);
+static int ipcacheExpiredEntry(ipcache_entry *);
+static void ipcacheAddPending(ipcache_entry *, int fd, IPH, void *);
+static void ipcacheEnqueue(ipcache_entry *);
+static void *ipcacheDequeue(void);
+static void ipcache_dnsDispatch(dnsserver_t *, ipcache_entry *);
+static struct hostent *ipcacheCheckNumeric(char *name);
+static void ipcacheStatPrint(ipcache_entry *, StoreEntry *);
+static void ipcacheUnlockEntry(ipcache_entry *);
+static void ipcacheLockEntry(ipcache_entry *);
 
 static struct hostent *static_result = NULL;
 static HashID ip_table = 0;
@@ -176,8 +176,8 @@ static char ipcache_status_char[] =
 long ipcache_low = 180;
 long ipcache_high = 200;
 
-static void ipcacheEnqueue(i)
-     ipcache_entry *i;
+static void
+ipcacheEnqueue(ipcache_entry * i)
 {
     struct ipcacheQueueData *new = xcalloc(1, sizeof(struct ipcacheQueueData));
     new->i = i;
@@ -185,7 +185,8 @@ static void ipcacheEnqueue(i)
     ipcacheQueueTailP = &new->next;
 }
 
-static void *ipcacheDequeue()
+static void *
+ipcacheDequeue()
 {
     struct ipcacheQueueData *old = NULL;
     ipcache_entry *i = NULL;
@@ -200,7 +201,8 @@ static void *ipcacheDequeue()
     return i;
 }
 
-static int ipcache_testname()
+static int
+ipcache_testname()
 {
     wordlist *w = NULL;
     debug(14, 1, "Performing DNS Tests...\n");
@@ -215,8 +217,8 @@ static int ipcache_testname()
 }
 
 /* removes the given ipcache entry */
-static void ipcache_release(i)
-     ipcache_entry *i;
+static void
+ipcache_release(ipcache_entry * i)
 {
     hash_link *table_entry = NULL;
     int k;
@@ -260,8 +262,8 @@ static void ipcache_release(i)
 }
 
 /* return match for given name */
-static ipcache_entry *ipcache_get(name)
-     char *name;
+static ipcache_entry *
+ipcache_get(char *name)
 {
     hash_link *e;
     static ipcache_entry *i;
@@ -275,19 +277,21 @@ static ipcache_entry *ipcache_get(name)
 }
 
 /* get the first ip entry in the storage */
-static ipcache_entry *ipcache_GetFirst()
+static ipcache_entry *
+ipcache_GetFirst()
 {
     return (ipcache_entry *) hash_first(ip_table);
 }
 
 /* get the next ip entry in the storage for a given search pointer */
-static ipcache_entry *ipcache_GetNext()
+static ipcache_entry *
+ipcache_GetNext()
 {
     return (ipcache_entry *) hash_next(ip_table);
 }
 
-static int ipcache_compareLastRef(e1, e2)
-     ipcache_entry **e1, **e2;
+static int
+ipcache_compareLastRef(ipcache_entry ** e1, ipcache_entry ** e2)
 {
     if (!e1 || !e2)
        fatal_dump(NULL);
@@ -298,8 +302,8 @@ static int ipcache_compareLastRef(e1, e2)
     return (0);
 }
 
-static int ipcache_reverseLastRef(e1, e2)
-     ipcache_entry **e1, **e2;
+static int
+ipcache_reverseLastRef(ipcache_entry ** e1, ipcache_entry ** e2)
 {
     if ((*e1)->lastref < (*e2)->lastref)
        return (1);
@@ -308,8 +312,8 @@ static int ipcache_reverseLastRef(e1, e2)
     return (0);
 }
 
-static int ipcacheExpiredEntry(i)
-     ipcache_entry *i;
+static int
+ipcacheExpiredEntry(ipcache_entry * i)
 {
     if (i->status == IP_PENDING)
        return 0;
@@ -323,7 +327,8 @@ static int ipcacheExpiredEntry(i)
 }
 
 /* finds the LRU and deletes */
-int ipcache_purgelru()
+int
+ipcache_purgelru()
 {
     ipcache_entry *i = NULL;
     int local_ip_notpending_count = 0;
@@ -377,7 +382,8 @@ int ipcache_purgelru()
 
 
 /* create blank ipcache_entry */
-static ipcache_entry *ipcache_create()
+static ipcache_entry *
+ipcache_create()
 {
     static ipcache_entry *new;
 
@@ -395,8 +401,8 @@ static ipcache_entry *ipcache_create()
 
 }
 
-static void ipcache_add_to_hash(i)
-     ipcache_entry *i;
+static void
+ipcache_add_to_hash(ipcache_entry * i)
 {
     if (hash_join(ip_table, (hash_link *) i)) {
        debug(14, 1, "ipcache_add_to_hash: Cannot add %s (%p) to hash table %d.\n",
@@ -406,11 +412,8 @@ static void ipcache_add_to_hash(i)
 }
 
 
-static void ipcache_add(name, i, hp, cached)
-     char *name;
-     ipcache_entry *i;
-     struct hostent *hp;
-     int cached;
+static void
+ipcache_add(char *name, ipcache_entry * i, struct hostent *hp, int cached)
 {
     int addr_count;
     int alias_count;
@@ -464,8 +467,8 @@ static void ipcache_add(name, i, hp, cached)
 }
 
 /* walks down the pending list, calling handlers */
-static void ipcache_call_pending(i)
-     ipcache_entry *i;
+static void
+ipcache_call_pending(ipcache_entry * i)
 {
     struct _ip_pending *p = NULL;
     int nhandler = 0;
@@ -491,9 +494,8 @@ static void ipcache_call_pending(i)
     ipcacheUnlockEntry(i);
 }
 
-static ipcache_entry *ipcache_parsebuffer(inbuf, dnsData)
-     char *inbuf;
-     dnsserver_t *dnsData;
+static ipcache_entry *
+ipcache_parsebuffer(char *inbuf, dnsserver_t * dnsData)
 {
     char *buf = xstrdup(inbuf);
     char *token;
@@ -575,9 +577,8 @@ static ipcache_entry *ipcache_parsebuffer(inbuf, dnsData)
     return &i;
 }
 
-static int ipcache_dnsHandleRead(fd, dnsData)
-     int fd;
-     dnsserver_t *dnsData;
+static int
+ipcache_dnsHandleRead(int fd, dnsserver_t * dnsData)
 {
     int len;
     int svc_time;
@@ -645,11 +646,8 @@ static int ipcache_dnsHandleRead(fd, dnsData)
     return 0;
 }
 
-static void ipcacheAddPending(i, fd, handler, handlerData)
-     ipcache_entry *i;
-     int fd;
-     IPH handler;
-     void *handlerData;
+static void
+ipcacheAddPending(ipcache_entry * i, int fd, IPH handler, void *handlerData)
 {
     struct _ip_pending *pending = xcalloc(1, sizeof(struct _ip_pending));
     struct _ip_pending **I = NULL;
@@ -661,11 +659,8 @@ static void ipcacheAddPending(i, fd, handler, handlerData)
     *I = pending;
 }
 
-void ipcache_nbgethostbyname(name, fd, handler, handlerData)
-     char *name;
-     int fd;
-     IPH handler;
-     void *handlerData;
+void
+ipcache_nbgethostbyname(char *name, int fd, IPH handler, void *handlerData)
 {
     ipcache_entry *i = NULL;
     dnsserver_t *dnsData = NULL;
@@ -728,9 +723,8 @@ void ipcache_nbgethostbyname(name, fd, handler, handlerData)
        ipcacheEnqueue(i);
 }
 
-static void ipcache_dnsDispatch(dns, i)
-     dnsserver_t *dns;
-     ipcache_entry *i;
+static void
+ipcache_dnsDispatch(dnsserver_t * dns, ipcache_entry * i)
 {
     char *buf = NULL;
     if (!ipcacheHasPending(i)) {
@@ -765,7 +759,8 @@ static void ipcache_dnsDispatch(dns, i)
 
 
 /* initialize the ipcache */
-void ipcache_init()
+void
+ipcache_init()
 {
     debug(14, 3, "Initializing IP Cache...\n");
 
@@ -796,9 +791,8 @@ void ipcache_init()
 
 /* clean up the pending entries in dnsserver */
 /* return 1 if we found the host, 0 otherwise */
-int ipcache_unregister(name, fd)
-     char *name;
-     int fd;
+int
+ipcache_unregister(char *name, int fd)
 {
     ipcache_entry *i = NULL;
     struct _ip_pending *p = NULL;
@@ -820,9 +814,8 @@ int ipcache_unregister(name, fd)
     return n;
 }
 
-struct hostent *ipcache_gethostbyname(name, flags)
-     char *name;
-     int flags;
+struct hostent *
+ipcache_gethostbyname(char *name, int flags)
 {
     ipcache_entry *i = NULL;
     struct hostent *hp = NULL;
@@ -878,9 +871,8 @@ struct hostent *ipcache_gethostbyname(name, flags)
     return NULL;
 }
 
-static void ipcacheStatPrint(i, sentry)
-     ipcache_entry *i;
-     StoreEntry *sentry;
+static void
+ipcacheStatPrint(ipcache_entry * i, StoreEntry * sentry)
 {
     int k;
     storeAppendPrintf(sentry, " {%-32.32s  %c %6d %6d %d",
@@ -904,8 +896,8 @@ static void ipcacheStatPrint(i, sentry)
 }
 
 /* process objects list */
-void stat_ipcache_get(sentry)
-     StoreEntry *sentry;
+void
+stat_ipcache_get(StoreEntry * sentry)
 {
     int k;
     int N;
@@ -954,16 +946,14 @@ void stat_ipcache_get(sentry)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-static int dummy_handler(u1, u2, u3)
-     int u1;
-     struct hostent *u2;
-     void *u3;
+static int
+dummy_handler(int u1, struct hostent *u2, void *u3)
 {
     return 0;
 }
 
-static int ipcacheHasPending(i)
-     ipcache_entry *i;
+static int
+ipcacheHasPending(ipcache_entry * i)
 {
     struct _ip_pending *p = NULL;
     if (i->status != IP_PENDING)
@@ -974,8 +964,8 @@ static int ipcacheHasPending(i)
     return 0;
 }
 
-void ipcacheReleaseInvalid(name)
-     char *name;
+void
+ipcacheReleaseInvalid(char *name)
 {
     ipcache_entry *i;
     if ((i = ipcache_get(name)) == NULL)
@@ -985,8 +975,8 @@ void ipcacheReleaseInvalid(name)
     ipcache_release(i);
 }
 
-void ipcacheInvalidate(name)
-     char *name;
+void
+ipcacheInvalidate(char *name)
 {
     ipcache_entry *i;
     if ((i = ipcache_get(name)) == NULL)
@@ -997,8 +987,8 @@ void ipcacheInvalidate(name)
      * FMR */
 }
 
-static struct hostent *ipcacheCheckNumeric(name)
-     char *name;
+static struct hostent *
+ipcacheCheckNumeric(char *name)
 {
     unsigned int ip;
     /* check if it's already a IP address in text form. */
@@ -1009,7 +999,8 @@ static struct hostent *ipcacheCheckNumeric(name)
     return static_result;
 }
 
-int ipcacheQueueDrain()
+int
+ipcacheQueueDrain()
 {
     ipcache_entry *i;
     dnsserver_t *dnsData;
@@ -1020,14 +1011,14 @@ int ipcacheQueueDrain()
     return 1;
 }
 
-static void ipcacheLockEntry(i)
-     ipcache_entry *i;
+static void
+ipcacheLockEntry(ipcache_entry * i)
 {
     i->locks++;
 }
 
-static void ipcacheUnlockEntry(i)
-     ipcache_entry *i;
+static void
+ipcacheUnlockEntry(ipcache_entry * i)
 {
     i->locks--;
     if (ipcacheExpiredEntry(i))
index 8819c8683c56d230fdca40547b30da9d58d9b538..e476826987df6d221f1338101bab172b773c1aab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.cc,v 1.72 1996/09/13 23:16:39 wessels Exp $
+ * $Id: main.cc,v 1.73 1996/09/14 08:46:12 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -130,7 +130,7 @@ struct in_addr local_addr;
 char *dash_str = "-";
 
 /* for error reporting from xmalloc and friends */
-extern void (*failure_notify) _PARAMS((char *));
+extern void (*failure_notify) (char *);
 
 static int rotate_pending = 0; /* set by SIGUSR1 handler */
 static int httpPortNumOverride = 1;
@@ -145,16 +145,17 @@ static time_t next_dirclean;
 static time_t next_announce;
 static time_t next_ip_purge;
 
-static void rotate_logs _PARAMS((int));
-static void reconfigure _PARAMS((int));
-static void mainInitialize _PARAMS((void));
-static void mainReinitialize _PARAMS((void));
-static time_t mainMaintenance _PARAMS((void));
-static void usage _PARAMS((void));
-static void mainParseOptions _PARAMS((int, char **));
-static void sendSignal _PARAMS((void));
-
-static void usage()
+static void rotate_logs(int);
+static void reconfigure(int);
+static void mainInitialize(void);
+static void mainReinitialize(void);
+static time_t mainMaintenance(void);
+static void usage(void);
+static void mainParseOptions(int, char **);
+static void sendSignal(void);
+
+static void
+usage()
 {
     fprintf(stderr, "\
 Usage: %s [-hsvzCDFRUVY] [-f config-file] [-[au] port] [-k signal]\n\
@@ -180,9 +181,8 @@ Usage: %s [-hsvzCDFRUVY] [-f config-file] [-[au] port] [-k signal]\n\
     exit(1);
 }
 
-static void mainParseOptions(argc, argv)
-     int argc;
-     char *argv[];
+static void
+mainParseOptions(int argc, char *argv[])
 {
     extern char *optarg;
     int c;
@@ -275,8 +275,8 @@ static void mainParseOptions(argc, argv)
     }
 }
 
-static void rotate_logs(sig)
-     int sig;
+static void
+rotate_logs(int sig)
 {
     debug(21, 1, "rotate_logs: SIGUSR1 received.\n");
     rotate_pending = 1;
@@ -285,8 +285,8 @@ static void rotate_logs(sig)
 #endif
 }
 
-static void reconfigure(sig)
-     int sig;
+static void
+reconfigure(int sig)
 {
     debug(21, 1, "reconfigure: SIGHUP received\n");
     debug(21, 1, "Waiting %d seconds for active connections to finish\n",
@@ -297,8 +297,8 @@ static void reconfigure(sig)
 #endif
 }
 
-void shut_down(sig)
-     int sig;
+void
+shut_down(int sig)
 {
     debug(21, 1, "Preparing for shutdown after %d connections\n",
        ntcpconn + nudpconn);
@@ -311,7 +311,8 @@ void shut_down(sig)
 #endif
 }
 
-void serverConnectionsOpen()
+void
+serverConnectionsOpen()
 {
     struct in_addr addr;
     u_short port;
@@ -374,7 +375,8 @@ void serverConnectionsOpen()
     }
 }
 
-void serverConnectionsClose()
+void
+serverConnectionsClose()
 {
     /* NOTE, this function will be called repeatedly while shutdown
      * is pending */
@@ -408,7 +410,8 @@ void serverConnectionsClose()
     }
 }
 
-static void mainReinitialize()
+static void
+mainReinitialize()
 {
     debug(1, 0, "Restarting Squid Cache (version %s)...\n", version_string);
     /* Already called serverConnectionsClose and ipcacheShutdownServers() */
@@ -425,7 +428,8 @@ static void mainReinitialize()
     debug(1, 0, "Ready to serve requests.\n");
 }
 
-static void mainInitialize()
+static void
+mainInitialize()
 {
     static int first_time = 1;
     if (opt_catch_signals) {
@@ -520,7 +524,8 @@ static void mainInitialize()
     first_time = 0;
 }
 
-static time_t mainMaintenance()
+static time_t
+mainMaintenance()
 {
     time_t next;
     int n;
@@ -556,9 +561,8 @@ static time_t mainMaintenance()
     return next - squid_curtime;
 }
 
-int main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char **argv)
 {
     int errcount = 0;
     int n;                     /* # of GC'd objects */
@@ -673,7 +677,8 @@ int main(argc, argv)
     return 0;
 }
 
-static void sendSignal()
+static void
+sendSignal()
 {
     int pid;
     debug_log = stderr;
index 98292173700835a1a3569a6d31f9b5b14fdae187..7e4d167912c40094e5d8b46b32fca9917f5c2341 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.cc,v 1.15 1996/09/04 22:03:27 wessels Exp $
+ * $Id: mime.cc,v 1.16 1996/09/14 08:46:13 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
 
 #define GET_HDR_SZ 1024
 
-char *mime_get_header(char *mime, char *name)
+char *
+mime_get_header(char *mime, char *name)
 {
     LOCAL_ARRAY(char, header, GET_HDR_SZ);
     char *p = NULL;
@@ -150,7 +151,8 @@ char *mime_get_header(char *mime, char *name)
 
 /* need to take the lowest, non-zero pointer to the end of the headers.
  * The headers end at the first empty line */
-char *mime_headers_end(char *mime)
+char *
+mime_headers_end(char *mime)
 {
     char *p1, *p2;
     char *end = NULL;
@@ -168,7 +170,8 @@ char *mime_headers_end(char *mime)
     return end;
 }
 
-int mime_headers_size(char *mime)
+int
+mime_headers_size(char *mime)
 {
     char *end;
 
@@ -180,8 +183,8 @@ int mime_headers_size(char *mime)
        return 0;
 }
 
-ext_table_entry *mime_ext_to_type(extension)
-     char *extension;
+ext_table_entry *
+mime_ext_to_type(char *extension)
 {
     int i;
     int low;
@@ -220,12 +223,8 @@ ext_table_entry *mime_ext_to_type(extension)
  *  Returns the MIME header in the provided 'result' buffer, and
  *  returns non-zero on error, or 0 on success.
  */
-int mk_mime_hdr(result, ttl, size, lmt, type)
-     char *result;
-     char *type;
-     int size;
-     time_t ttl;
-     time_t lmt;
+int
+mk_mime_hdr(char *result, char *type, int size, time_t ttl, time_t lmt)
 {
     time_t expiretime;
     time_t t;
index 5d966a96444228f0e929a0c600de2c44fe47acad..3141eb9f0c799bc62d36e831f069d9e1854b9548 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.50 1996/09/13 23:20:49 wessels Exp $
+ * $Id: neighbors.cc,v 1.51 1996/09/14 08:46:15 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
 
 #include "squid.h"
 
-static int edgeWouldBePinged _PARAMS((edge *, request_t *));
-static void neighborRemove _PARAMS((edge *));
-static edge *whichEdge _PARAMS((icp_common_t *, struct sockaddr_in *));
+static int edgeWouldBePinged(edge *, request_t *);
+static void neighborRemove(edge *);
+static edge *whichEdge(icp_common_t *, struct sockaddr_in *);
 
 static neighbors *friends = NULL;
 static struct neighbor_cf *Neighbor_cf = NULL;
@@ -134,9 +134,8 @@ char *hier_strings[] =
 };
 
 
-static edge *whichEdge(header, from)
-     icp_common_t *header;
-     struct sockaddr_in *from;
+static edge *
+whichEdge(icp_common_t * header, struct sockaddr_in *from)
 {
     int j;
     u_short port;
@@ -158,11 +157,8 @@ static edge *whichEdge(header, from)
     return (NULL);
 }
 
-void hierarchyNote(request, code, timeout, cache_host)
-     request_t *request;
-     hier_code code;
-     int timeout;
-     char *cache_host;
+void
+hierarchyNote(request_t * request, hier_code code, int timeout, char *cache_host)
 {
     if (request) {
        request->hierarchy.code = code;
@@ -171,9 +167,8 @@ void hierarchyNote(request, code, timeout, cache_host)
     }
 }
 
-static int edgeWouldBePinged(e, request)
-     edge *e;
-     request_t *request;
+static int
+edgeWouldBePinged(edge * e, request_t * request)
 {
     dom_list *d = NULL;
     int do_ping = 1;
@@ -198,9 +193,8 @@ static int edgeWouldBePinged(e, request)
     return do_ping;
 }
 
-edge *getSingleParent(request, n)
-     request_t *request;
-     int *n;
+edge *
+getSingleParent(request_t * request, int *n)
 {
     edge *p = NULL;
     edge *e = NULL;
@@ -237,8 +231,8 @@ edge *getSingleParent(request, n)
     return NULL;
 }
 
-edge *getFirstUpParent(request)
-     request_t *request;
+edge *
+getFirstUpParent(request_t * request)
 {
     edge *e = NULL;
     if (friends->n_parent < 1)
@@ -254,18 +248,20 @@ edge *getFirstUpParent(request)
     return NULL;
 }
 
-edge *getNextEdge(edge * e)
+edge *
+getNextEdge(edge * e)
 {
     return e->next;
 }
 
-edge *getFirstEdge()
+edge *
+getFirstEdge(void)
 {
     return friends->edges_head;
 }
 
-static void neighborRemove(target)
-     edge *target;
+static void
+neighborRemove(edge * target)
 {
     edge *e = NULL;
     edge **E = NULL;
@@ -285,7 +281,8 @@ static void neighborRemove(target)
     }
 }
 
-void neighborsDestroy()
+void
+neighborsDestroy()
 {
     edge *e = NULL;
     edge *next = NULL;
@@ -302,8 +299,8 @@ void neighborsDestroy()
     friends = NULL;
 }
 
-void neighbors_open(fd)
-     int fd;
+void
+neighbors_open(int fd)
 {
     int j;
     struct sockaddr_in name;
@@ -398,8 +395,8 @@ void neighbors_open(fd)
 }
 
 
-int neighborsUdpPing(proto)
-     protodispatch_data *proto;
+int
+neighborsUdpPing(protodispatch_data * proto)
 {
     char *host = proto->request->host;
     char *url = proto->url;
@@ -536,14 +533,8 @@ int neighborsUdpPing(proto)
  * 
  * If a hit process is already started, then sobeit
  */
-void neighborsUdpAck(fd, url, header, from, entry, data, data_sz)
-     int fd;
-     char *url;
-     icp_common_t *header;
-     struct sockaddr_in *from;
-     StoreEntry *entry;
-     char *data;
-     int data_sz;
+void
+neighborsUdpAck(int fd, char *url, icp_common_t * header, struct sockaddr_in *from, StoreEntry * entry, char *data, int data_sz)
 {
     edge *e = NULL;
     MemObject *mem = entry->mem_obj;
@@ -612,8 +603,8 @@ void neighborsUdpAck(fd, url, header, from, entry, data, data_sz)
        } else if (entry->object_len != 0) {
            debug(15, 1, "Too late UDP_HIT_OBJ '%s'?\n", entry->url);
        } else {
-            if (e->options & NEIGHBOR_PROXY_ONLY)
-                storeReleaseRequest(entry);
+           if (e->options & NEIGHBOR_PROXY_ONLY)
+               storeReleaseRequest(entry);
            protoCancelTimeout(0, entry);
            entry->ping_status = PING_DONE;
            httpState = xcalloc(1, sizeof(HttpStateData));
@@ -695,13 +686,8 @@ void neighborsUdpAck(fd, url, header, from, entry, data, data_sz)
     }
 }
 
-void neighbors_cf_add(host, type, http_port, icp_port, options, weight)
-     char *host;
-     char *type;
-     int http_port;
-     int icp_port;
-     int options;
-     int weight;
+void
+neighbors_cf_add(char *host, char *type, int http_port, int icp_port, int options, int weight)
 {
     struct neighbor_cf *t, *u;
 
@@ -722,9 +708,8 @@ void neighbors_cf_add(host, type, http_port, icp_port, options, weight)
     }
 }
 
-void neighbors_cf_domain(host, domain)
-     char *host;
-     char *domain;
+void
+neighbors_cf_domain(char *host, char *domain)
 {
     struct neighbor_cf *t = NULL;
     dom_list *l = NULL;
@@ -751,9 +736,8 @@ void neighbors_cf_domain(host, domain)
     *L = l;
 }
 
-void neighbors_cf_acl(host, aclname)
-     char *host;
-     char *aclname;
+void
+neighbors_cf_acl(char *host, char *aclname)
 {
     struct neighbor_cf *t = NULL;
     struct _acl_list *L = NULL;
@@ -796,7 +780,8 @@ void neighbors_cf_acl(host, aclname)
     *Tail = L;
 }
 
-void neighbors_init()
+void
+neighbors_init()
 {
     struct neighbor_cf *t = NULL;
     struct neighbor_cf *next = NULL;
@@ -850,8 +835,8 @@ void neighbors_init()
     any_addr.s_addr = inet_addr("0.0.0.0");
 }
 
-edge *neighborFindByName(name)
-     char *name;
+edge *
+neighborFindByName(char *name)
 {
     edge *e = NULL;
     for (e = friends->edges_head; e; e = e->next) {
index e3fdcfc53c9aa8345d6a01e4c7520d995c64440c..fa785ae0b1cfe7182e4f463d95a9f4280378373c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: recv-announce.cc,v 1.6 1996/07/19 17:35:36 wessels Exp $
+ * $Id: recv-announce.cc,v 1.7 1996/09/14 08:46:20 wessels Exp $
  *
  * DEBUG: section 0     Announement Server
  * AUTHOR: Harvest Derived
 
 #define RECV_BUF_SIZE 8192
 
-extern void xmemcpy _PARAMS((void *from, void *to, int len));
+extern void xmemcpy(void *from, void *to, int len);
 
 /*
  * This program must be run from inetd.  First add something like this
@@ -140,7 +140,8 @@ extern void xmemcpy _PARAMS((void *from, void *to, int len));
  * usage: recv-announce logfile
  */
 
-void sig_handle()
+void
+sig_handle()
 {
     fflush(stdout);
     close(2);
@@ -150,9 +151,8 @@ void sig_handle()
 }
 
 
-int main(argc, argv)
-     int argc;
-     char *argv[];
+int
+main(int argc, char *argv[])
 {
     char buf[RECV_BUF_SIZE];
     struct sockaddr_in R;
index 2f8639b4182c1f2ecf3e9fe6aaadaa6c856c2b2e..1eebc5718b0e34eb8644e49b4734607ddb20448d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.13 1996/08/30 22:44:11 wessels Exp $
+ * $Id: redirect.cc,v 1.14 1996/09/14 08:46:21 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -70,12 +70,12 @@ struct redirectQueueData {
     redirectStateData *redirectState;
 };
 
-static redirector_t *GetFirstAvailable _PARAMS((void));
-static int redirectCreateRedirector _PARAMS((char *command));
-static int redirectHandleRead _PARAMS((int, redirector_t *));
-static redirectStateData *Dequeue _PARAMS(());
-static void Enqueue _PARAMS((redirectStateData *));
-static void redirectDispatch _PARAMS((redirector_t *, redirectStateData *));
+static redirector_t *GetFirstAvailable(void);
+static int redirectCreateRedirector(char *command);
+static int redirectHandleRead(int, redirector_t *);
+static redirectStateData *Dequeue();
+static void Enqueue(redirectStateData *);
+static void redirectDispatch(redirector_t *, redirectStateData *);
 
 
 static redirector_t **redirect_child_table = NULL;
@@ -84,8 +84,8 @@ static int NRedirectorsOpen = 0;
 static struct redirectQueueData *redirectQueueHead = NULL;
 static struct redirectQueueData **redirectQueueTailP = &redirectQueueHead;
 
-static int redirectCreateRedirector(command)
-     char *command;
+static int
+redirectCreateRedirector(char *command)
 {
     int pid;
     u_short port;
@@ -155,9 +155,8 @@ static int redirectCreateRedirector(command)
     return 0;
 }
 
-static int redirectHandleRead(fd, redirector)
-     int fd;
-     redirector_t *redirector;
+static int
+redirectHandleRead(int fd, redirector_t * redirector)
 {
     int len;
     redirectStateData *r = redirector->redirectState;
@@ -216,8 +215,8 @@ static int redirectHandleRead(fd, redirector)
     return 0;
 }
 
-static void Enqueue(r)
-     redirectStateData *r;
+static void
+Enqueue(redirectStateData * r)
 {
     struct redirectQueueData *new = xcalloc(1, sizeof(struct redirectQueueData));
     new->redirectState = r;
@@ -226,7 +225,8 @@ static void Enqueue(r)
     RedirectStats.queue_size++;
 }
 
-static redirectStateData *Dequeue()
+static redirectStateData *
+Dequeue()
 {
     struct redirectQueueData *old = NULL;
     redirectStateData *r = NULL;
@@ -242,7 +242,8 @@ static redirectStateData *Dequeue()
     return r;
 }
 
-static redirector_t *GetFirstAvailable()
+static redirector_t *
+GetFirstAvailable()
 {
     int k;
     redirector_t *redirect = NULL;
@@ -255,9 +256,8 @@ static redirector_t *GetFirstAvailable()
 }
 
 
-static void redirectDispatch(redirect, r)
-     redirector_t *redirect;
-     redirectStateData *r;
+static void
+redirectDispatch(redirector_t * redirect, redirectStateData * r)
 {
     char *buf = NULL;
     char *fqdn = NULL;
@@ -298,11 +298,8 @@ static void redirectDispatch(redirect, r)
 /**** PUBLIC FUNCTIONS ****/
 
 
-void redirectStart(cfd, icpState, handler, data)
-     int cfd;
-     icpStateData *icpState;
-     RH handler;
-     void *data;
+void
+redirectStart(int cfd, icpStateData * icpState, RH handler, void *data)
 {
     redirectStateData *r = NULL;
     redirector_t *redirector = NULL;
@@ -332,7 +329,8 @@ void redirectStart(cfd, icpState, handler, data)
        Enqueue(r);
 }
 
-void redirectOpenServers()
+void
+redirectOpenServers()
 {
     char *prg = Config.Program.redirect;
     int k;
@@ -384,7 +382,8 @@ void redirectOpenServers()
     }
 }
 
-void redirectShutdownServers()
+void
+redirectShutdownServers()
 {
     redirector_t *redirect = NULL;
     redirectStateData *r = NULL;
@@ -412,9 +411,8 @@ void redirectShutdownServers()
 }
 
 
-int redirectUnregister(url, fd)
-     char *url;
-     int fd;
+int
+redirectUnregister(char *url, int fd)
 {
     redirector_t *redirect = NULL;
     redirectStateData *r = NULL;
@@ -451,8 +449,8 @@ int redirectUnregister(url, fd)
     return n;
 }
 
-void redirectStats(sentry)
-     StoreEntry *sentry;
+void
+redirectStats(StoreEntry * sentry)
 {
     int k;
     storeAppendPrintf(sentry, open_bracket);
index 4e12c6ff7a79894d6705394dc10288f729c91208..0dc3d012e01c2e4b8951d7ce7fcd3eae5b955cbf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: send-announce.cc,v 1.16 1996/07/25 07:10:40 wessels Exp $
+ * $Id: send-announce.cc,v 1.17 1996/09/14 08:46:22 wessels Exp $
  *
  * DEBUG: section 27    Cache Announcer
  * AUTHOR: Duane Wessels
@@ -31,7 +31,8 @@
 
 #include "squid.h"
 
-void send_announce()
+void
+send_announce()
 {
     LOCAL_ARRAY(char, tbuf, 256);
     LOCAL_ARRAY(char, sndbuf, BUFSIZ);
index 69939552605463ffa71e532ff837b3739698d28d..746e1071fb00b312f57c1f6ad463fc6c110d5bb4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.44 1996/09/03 19:24:04 wessels Exp $
+ * $Id: squid.h,v 1.45 1996/09/14 08:46:23 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -217,7 +217,7 @@ typedef unsigned long u_num32;
 #include "ansihelp.h"
 
 typedef void (*SIH) _PARAMS((int, void *));    /* swap in */
-typedef int (*QS) _PARAMS((const void *, const void *));
+typedef int (*QS) (const void *, const void *);
 
 #include "cache_cf.h"
 #include "comm.h"
@@ -255,8 +255,8 @@ typedef int (*QS) _PARAMS((const void *, const void *));
 #include "tempnam.h"
 #endif
 
-extern void serverConnectionsClose _PARAMS((void));
-extern void shut_down _PARAMS((int));
+extern void serverConnectionsClose(void);
+extern void shut_down(int);
 
 
 extern time_t squid_starttime; /* main.c */
@@ -287,14 +287,14 @@ extern struct in_addr no_addr;    /* comm.c */
 
 #define  CONNECT_PORT        443
 
-extern int objcacheStart _PARAMS((int, char *, StoreEntry *));
-extern void send_announce _PARAMS((void));
-extern int sslStart _PARAMS((int fd, char *, request_t *, char *, int *sz));
-extern char *storeToString _PARAMS((StoreEntry *));
-extern void ttlSet _PARAMS((StoreEntry *));
-extern void ttlFreeList _PARAMS((void));
-extern void ttlAddToList _PARAMS((char *, int, int, time_t, int, time_t));
-extern void ttlAddToForceList _PARAMS((char *, time_t, time_t));
-extern int waisStart _PARAMS((int, char *, method_t, char *, StoreEntry *));
-extern void storeDirClean _PARAMS((void));
+extern int objcacheStart(int, char *, StoreEntry *);
+extern void send_announce(void);
+extern int sslStart(int fd, char *, request_t *, char *, int *sz);
+extern char *storeToString(StoreEntry *);
+extern void ttlSet(StoreEntry *);
+extern void ttlFreeList(void);
+extern void ttlAddToList(char *, int, int, time_t, int, time_t);
+extern void ttlAddToForceList(char *, time_t, time_t);
+extern int waisStart(int, char *, method_t, char *, StoreEntry *);
+extern void storeDirClean(void);
 extern char *dash_str;
index 9d964d366c4e23757e79217c974f96401022faa5..94102c9c75c6a203ded6df13837265f043f5648b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.13 1996/08/31 06:40:20 wessels Exp $
+ * $Id: ssl.cc,v 1.14 1996/09/14 08:46:24 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -49,22 +49,22 @@ typedef struct {
 
 static char conn_established[] = "HTTP/1.0 200 Connection established\r\n\r\n";
 
-static void sslLifetimeExpire _PARAMS((int fd, SslStateData * sslState));
-static void sslReadTimeout _PARAMS((int fd, SslStateData * sslState));
-static void sslReadServer _PARAMS((int fd, SslStateData * sslState));
-static void sslReadClient _PARAMS((int fd, SslStateData * sslState));
-static void sslWriteServer _PARAMS((int fd, SslStateData * sslState));
-static void sslWriteClient _PARAMS((int fd, SslStateData * sslState));
-static void sslConnected _PARAMS((int fd, SslStateData * sslState));
-static void sslProxyConnected _PARAMS((int fd, SslStateData * sslState));
-static int sslConnect _PARAMS((int fd, struct hostent *, SslStateData *));
-static void sslConnInProgress _PARAMS((int fd, SslStateData * sslState));
-static void sslErrorComplete _PARAMS((int, char *, int, int, void *));
-static void sslClose _PARAMS((SslStateData * sslState));
-static int sslClientClosed _PARAMS((int fd, SslStateData * sslState));
+static void sslLifetimeExpire(int fd, SslStateData * sslState);
+static void sslReadTimeout(int fd, SslStateData * sslState);
+static void sslReadServer(int fd, SslStateData * sslState);
+static void sslReadClient(int fd, SslStateData * sslState);
+static void sslWriteServer(int fd, SslStateData * sslState);
+static void sslWriteClient(int fd, SslStateData * sslState);
+static void sslConnected(int fd, SslStateData * sslState);
+static void sslProxyConnected(int fd, SslStateData * sslState);
+static int sslConnect(int fd, struct hostent *, SslStateData *);
+static void sslConnInProgress(int fd, SslStateData * sslState);
+static void sslErrorComplete(int, char *, int, int, void *);
+static void sslClose(SslStateData * sslState);
+static int sslClientClosed(int fd, SslStateData * sslState);
 
-static void sslClose(sslState)
-     SslStateData *sslState;
+static void
+sslClose(SslStateData * sslState)
 {
     if (sslState->client.fd > -1) {
        /* remove the "unexpected" client close handler */
@@ -81,9 +81,8 @@ static void sslClose(sslState)
 
 /* This is called only if the client connect closes unexpectedly,
  * ie from icpDetectClientClose() */
-static int sslClientClosed(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static int
+sslClientClosed(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslClientClosed: FD %d\n", fd);
     /* we have been called from comm_close for the client side, so
@@ -96,9 +95,8 @@ static int sslClientClosed(fd, sslState)
     return 0;
 }
 
-static int sslStateFree(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static int
+sslStateFree(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslStateFree: FD %d, sslState=%p\n", fd, sslState);
     if (sslState == NULL)
@@ -119,9 +117,8 @@ static int sslStateFree(fd, sslState)
 }
 
 /* This will be called when the server lifetime is expired. */
-static void sslLifetimeExpire(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslLifetimeExpire(int fd, SslStateData * sslState)
 {
     debug(26, 4, "sslLifeTimeExpire: FD %d: URL '%s'>\n",
        fd, sslState->url);
@@ -129,9 +126,8 @@ static void sslLifetimeExpire(fd, sslState)
 }
 
 /* Read from server side and queue it for writing to the client */
-static void sslReadServer(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadServer(int fd, SslStateData * sslState)
 {
     int len;
     len = read(sslState->server.fd, sslState->server.buf, SQUID_TCP_SO_RCVBUF);
@@ -168,9 +164,8 @@ static void sslReadServer(fd, sslState)
 }
 
 /* Read from client side and queue it for writing to the server */
-static void sslReadClient(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadClient(int fd, SslStateData * sslState)
 {
     int len;
     len = read(sslState->client.fd, sslState->client.buf, SQUID_TCP_SO_RCVBUF);
@@ -203,9 +198,8 @@ static void sslReadClient(fd, sslState)
 }
 
 /* Writes data from the client buffer to the server side */
-static void sslWriteServer(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslWriteServer(int fd, SslStateData * sslState)
 {
     int len;
     len = write(sslState->server.fd,
@@ -239,9 +233,8 @@ static void sslWriteServer(fd, sslState)
 }
 
 /* Writes data from the server buffer to the client side */
-static void sslWriteClient(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslWriteClient(int fd, SslStateData * sslState)
 {
     int len;
     debug(26, 5, "sslWriteClient FD %d len=%d offset=%d\n",
@@ -275,17 +268,15 @@ static void sslWriteClient(fd, sslState)
     }
 }
 
-static void sslReadTimeout(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadTimeout(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslReadTimeout: FD %d\n", fd);
     sslClose(sslState);
 }
 
-static void sslConnected(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslConnected(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslConnected: FD %d sslState=%p\n", fd, sslState);
     strcpy(sslState->server.buf, conn_established);
@@ -302,21 +293,16 @@ static void sslConnected(fd, sslState)
        (void *) sslState);
 }
 
-static void sslErrorComplete(fd, buf, size, errflag, sslState)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *sslState;
+static void
+sslErrorComplete(int fd, char *buf, int size, int errflag, void *sslState)
 {
     safe_free(buf);
     sslClose(sslState);
 }
 
 
-static void sslConnInProgress(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslConnInProgress(int fd, SslStateData * sslState)
 {
     char *buf = NULL;
     debug(26, 5, "sslConnInProgress: FD %d sslState=%p\n", fd, sslState);
@@ -360,10 +346,8 @@ static void sslConnInProgress(fd, sslState)
     return;
 }
 
-static int sslConnect(fd, hp, sslState)
-     int fd;
-     struct hostent *hp;
-     SslStateData *sslState;
+static int
+sslConnect(int fd, struct hostent *hp, SslStateData * sslState)
 {
     request_t *request = sslState->request;
     int status;
@@ -437,12 +421,8 @@ static int sslConnect(fd, hp, sslState)
     return COMM_OK;
 }
 
-int sslStart(fd, url, request, mime_hdr, size_ptr)
-     int fd;
-     char *url;
-     request_t *request;
-     char *mime_hdr;
-     int *size_ptr;
+int
+sslStart(int fd, char *url, request_t * request, char *mime_hdr, int *size_ptr)
 {
     /* Create state structure. */
     SslStateData *sslState = NULL;
@@ -506,9 +486,8 @@ int sslStart(fd, url, request, mime_hdr, size_ptr)
     return COMM_OK;
 }
 
-static void sslProxyConnected(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslProxyConnected(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslProxyConnected: FD %d sslState=%p\n", fd, sslState);
     sprintf(sslState->client.buf, "CONNECT %s HTTP/1.0\r\n\r\n", sslState->url);
index ff4986568bf44033434a1f66d379677731a3d7c1..4ae2b9594cab46a79afed5178ef0b5c9fb5a4daf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.66 1996/09/13 23:16:42 wessels Exp $
+ * $Id: stat.cc,v 1.67 1996/09/14 08:46:26 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -135,39 +135,37 @@ char *diskFileName();
 char *open_bracket = "{\n";
 char *close_bracket = "}\n";
 
-static void dummyhandler _PARAMS((cacheinfo *, StoreEntry *));
-static void info_get _PARAMS((cacheinfo *, StoreEntry *));
-static void info_get_mallstat _PARAMS((int, int, StoreEntry *));
-static void logReadEndHandler _PARAMS((int, int, log_read_data_t *));
-static void log_clear _PARAMS((cacheinfo *, StoreEntry *));
-static void log_disable _PARAMS((cacheinfo *, StoreEntry *));
-static void log_enable _PARAMS((cacheinfo *, StoreEntry *));
-static void log_get_start _PARAMS((cacheinfo *, StoreEntry *));
-static void log_status_get _PARAMS((cacheinfo *, StoreEntry *));
-static void parameter_get _PARAMS((cacheinfo *, StoreEntry *));
-static void proto_count _PARAMS((cacheinfo *, protocol_t, log_type));
-static void proto_newobj _PARAMS((cacheinfo *, protocol_t, int, int));
-static void proto_purgeobj _PARAMS((cacheinfo *, protocol_t, int));
-static void proto_touchobj _PARAMS((cacheinfo *, protocol_t, int));
-static void server_list _PARAMS((cacheinfo *, StoreEntry *));
-static void squidReadEndHandler _PARAMS((int, int, squid_read_data_t *));
-static void squid_get_start _PARAMS((cacheinfo *, StoreEntry *));
-static void statFiledescriptors _PARAMS((StoreEntry *));
-static void stat_get _PARAMS((cacheinfo *, char *req, StoreEntry *));
-static void stat_io_get _PARAMS((StoreEntry *));
-static void stat_obj _PARAMS((cacheinfo *, StoreEntry *, int vm_or_not));
-static void stat_utilization_get _PARAMS((cacheinfo *, StoreEntry *, char *desc));
-static int cache_size_get _PARAMS((cacheinfo *));
-static int logReadHandler _PARAMS((int, char *, int, log_read_data_t *));
-static int squidReadHandler _PARAMS((int, char *, int, squid_read_data_t *));
-static int memoryAccounted _PARAMS((void));
-static int mallinfoTotal _PARAMS((void));
+static void dummyhandler(cacheinfo *, StoreEntry *);
+static void info_get(cacheinfo *, StoreEntry *);
+static void info_get_mallstat(int, int, StoreEntry *);
+static void logReadEndHandler(int, int, log_read_data_t *);
+static void log_clear(cacheinfo *, StoreEntry *);
+static void log_disable(cacheinfo *, StoreEntry *);
+static void log_enable(cacheinfo *, StoreEntry *);
+static void log_get_start(cacheinfo *, StoreEntry *);
+static void log_status_get(cacheinfo *, StoreEntry *);
+static void parameter_get(cacheinfo *, StoreEntry *);
+static void proto_count(cacheinfo *, protocol_t, log_type);
+static void proto_newobj(cacheinfo *, protocol_t, int, int);
+static void proto_purgeobj(cacheinfo *, protocol_t, int);
+static void proto_touchobj(cacheinfo *, protocol_t, int);
+static void server_list(cacheinfo *, StoreEntry *);
+static void squidReadEndHandler(int, int, squid_read_data_t *);
+static void squid_get_start(cacheinfo *, StoreEntry *);
+static void statFiledescriptors(StoreEntry *);
+static void stat_get(cacheinfo *, char *req, StoreEntry *);
+static void stat_io_get(StoreEntry *);
+static void stat_obj(cacheinfo *, StoreEntry *, int vm_or_not);
+static void stat_utilization_get(cacheinfo *, StoreEntry *, char *desc);
+static int cache_size_get(cacheinfo *);
+static int logReadHandler(int, char *, int, log_read_data_t *);
+static int squidReadHandler(int, char *, int, squid_read_data_t *);
+static int memoryAccounted(void);
+static int mallinfoTotal(void);
 
 /* process utilization information */
-static void stat_utilization_get(obj, sentry, desc)
-     cacheinfo *obj;
-     StoreEntry *sentry;
-     char *desc;
+static void
+stat_utilization_get(cacheinfo * obj, StoreEntry * sentry, char *desc)
 {
     protocol_t proto_id;
     proto_stat *p = &obj->proto_stat_data[PROTO_MAX];
@@ -222,8 +220,8 @@ static void stat_utilization_get(obj, sentry, desc)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-static void stat_io_get(sentry)
-     StoreEntry *sentry;
+static void
+stat_io_get(StoreEntry * sentry)
 {
     int i;
 
@@ -294,8 +292,8 @@ static void stat_io_get(sentry)
 /* return total bytes of all registered and known objects.
  * may not reflect the retrieving object....
  * something need to be done here to get more accurate cache size */
-static int cache_size_get(obj)
-     cacheinfo *obj;
+static int
+cache_size_get(cacheinfo * obj)
 {
     int size = 0;
     protocol_t proto_id;
@@ -306,10 +304,8 @@ static int cache_size_get(obj)
 }
 
 /* process objects list */
-static void stat_objects_get(obj, sentry, vm_or_not)
-     cacheinfo *obj;
-     StoreEntry *sentry;
-     int vm_or_not;
+static void
+stat_objects_get(cacheinfo * obj, StoreEntry * sentry, int vm_or_not)
 {
     LOCAL_ARRAY(char, space, 40);
     LOCAL_ARRAY(char, space2, 40);
@@ -351,10 +347,8 @@ static void stat_objects_get(obj, sentry, vm_or_not)
 
 
 /* process a requested object into a manager format */
-static void stat_get(obj, req, sentry)
-     cacheinfo *obj;
-     char *req;
-     StoreEntry *sentry;
+static void
+stat_get(cacheinfo * obj, char *req, StoreEntry * sentry)
 {
 
     if (strcmp(req, "objects") == 0) {
@@ -383,9 +377,8 @@ static void stat_get(obj, req, sentry)
 
 
 /* generate logfile status information */
-static void log_status_get(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+log_status_get(cacheinfo * obj, StoreEntry * sentry)
 {
     if (obj->logfile_status == LOG_ENABLE) {
        storeAppendPrintf(sentry, "{\"Logfile is Enabled. Filename: %s\"}\n",
@@ -399,11 +392,8 @@ static void log_status_get(obj, sentry)
 
 /* log convert handler */
 /* call for each line in file, use fileWalk routine */
-static int logReadHandler(fd_unused, buf, size_unused, data)
-     int fd_unused;
-     char *buf;
-     int size_unused;
-     log_read_data_t *data;
+static int
+logReadHandler(int fd_unused, char *buf, int size_unused, log_read_data_t * data)
 {
     storeAppendPrintf(data->sentry, "{%s}\n", buf);
     return 0;
@@ -411,10 +401,8 @@ static int logReadHandler(fd_unused, buf, size_unused, data)
 
 /* log convert end handler */
 /* call when a walk is completed or error. */
-static void logReadEndHandler(fd, errflag_unused, data)
-     int fd;
-     int errflag_unused;
-     log_read_data_t *data;
+static void
+logReadEndHandler(int fd, int errflag_unused, log_read_data_t * data)
 {
     storeAppendPrintf(data->sentry, close_bracket);
     storeComplete(data->sentry);
@@ -425,9 +413,8 @@ static void logReadEndHandler(fd, errflag_unused, data)
 
 
 /* start converting logfile to processed format */
-static void log_get_start(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+log_get_start(cacheinfo * obj, StoreEntry * sentry)
 {
     log_read_data_t *data = NULL;
     int fd;
@@ -458,11 +445,8 @@ static void log_get_start(obj, sentry)
 
 /* squid convert handler */
 /* call for each line in file, use fileWalk routine */
-static int squidReadHandler(fd_unused, buf, size_unused, data)
-     int fd_unused;
-     char *buf;
-     int size_unused;
-     squid_read_data_t *data;
+static int
+squidReadHandler(int fd_unused, char *buf, int size_unused, squid_read_data_t * data)
 {
     storeAppendPrintf(data->sentry, "{\"%s\"}\n", buf);
     return 0;
@@ -470,10 +454,8 @@ static int squidReadHandler(fd_unused, buf, size_unused, data)
 
 /* squid convert end handler */
 /* call when a walk is completed or error. */
-static void squidReadEndHandler(fd_unused, errflag_unused, data)
-     int fd_unused;
-     int errflag_unused;
-     squid_read_data_t *data;
+static void
+squidReadEndHandler(int fd_unused, int errflag_unused, squid_read_data_t * data)
 {
     storeAppendPrintf(data->sentry, close_bracket);
     storeComplete(data->sentry);
@@ -483,9 +465,8 @@ static void squidReadEndHandler(fd_unused, errflag_unused, data)
 
 
 /* start convert squid.conf file to processed format */
-static void squid_get_start(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+squid_get_start(cacheinfo * obj, StoreEntry * sentry)
 {
     squid_read_data_t *data;
 
@@ -498,16 +479,14 @@ static void squid_get_start(obj, sentry)
 }
 
 
-static void dummyhandler(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+dummyhandler(cacheinfo * obj, StoreEntry * sentry)
 {
     storeAppendPrintf(sentry, "{ \"Not_Implemented_yet.\"}\n");
 }
 
-static void server_list(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+server_list(cacheinfo * obj, StoreEntry * sentry)
 {
     edge *e = NULL;
     dom_list *d = NULL;
@@ -563,26 +542,24 @@ static void server_list(obj, sentry)
 }
 
 #if XMALLOC_STATISTICS
-static void info_get_mallstat(size, number, sentry)
-     int size, number;
-     StoreEntry *sentry;
+static void
+info_get_mallstat(int size, number, StoreEntry * sentry)
 {
     if (number > 0)
        storeAppendPrintf(sentry, "{\t%d = %d}\n", size, number);
 }
 #endif
 
-static char *host_port_fmt(host, port)
-     char *host;
-     u_short port;
+static char *
+host_port_fmt(char *host, u_short port)
 {
     LOCAL_ARRAY(char, buf, 32);
     sprintf(buf, "%s.%d", host, (int) port);
     return buf;
 }
 
-static void statFiledescriptors(sentry)
-     StoreEntry *sentry;
+static void
+statFiledescriptors(StoreEntry * sentry)
 {
     int i;
     int j;
@@ -644,7 +621,8 @@ static void statFiledescriptors(sentry)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-static int memoryAccounted()
+static int
+memoryAccounted()
 {
     return (int)
        meta_data.store_entries * sizeof(StoreEntry) +
@@ -659,7 +637,8 @@ static int memoryAccounted()
        meta_data.misc;
 }
 
-static int mallinfoTotal()
+static int
+mallinfoTotal()
 {
     int total = 0;
 #if HAVE_MALLINFO
@@ -670,9 +649,8 @@ static int mallinfoTotal()
     return total;
 }
 
-static void info_get(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+info_get(cacheinfo * obj, StoreEntry * sentry)
 {
     char *tod = NULL;
     float f;
@@ -862,9 +840,8 @@ static void info_get(obj, sentry)
     storeAppendPrintf(sentry, close_bracket);
 }
 
-static void parameter_get(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+parameter_get(cacheinfo * obj, StoreEntry * sentry)
 {
     storeAppendPrintf(sentry, open_bracket);
     storeAppendPrintf(sentry,
@@ -945,8 +922,8 @@ static char c2x[] =
 
 /* log_quote -- URL-style encoding on MIME headers. */
 
-char *log_quote(header)
-     char *header;
+char *
+log_quote(char *header)
 {
     int c, i;
     char *buf, *buf_cursor;
@@ -996,25 +973,24 @@ char *log_quote(header)
 #endif /* LOG_FULL_HEADERS */
 
 
-#if LOG_FULL_HEADERS
-static void log_append(obj, url, caddr, size, action, method, http_code, msec, ident, hierData, request_hdr, reply_hdr)
+static void
+log_append(cacheinfo * obj,
+    char *url,
+    struct in_addr caddr,
+    int size,
+    char *action,
+    char *method,
+    int http_code,
+    int msec,
+    char *ident,
+#if !LOG_FULL_HEADERS
+    struct _hierarchyLogData *hierData
 #else
-static void log_append(obj, url, caddr, size, action, method, http_code, msec, ident, hierData)
+    struct _hierarchyLogData *hierData,
+    char *request_hdr,
+    char *reply_hdr
 #endif                         /* LOG_FULL_HEADERS */
-     cacheinfo *obj;
-     char *url;
-     struct in_addr caddr;
-     int size;
-     char *action;
-     char *method;
-     int http_code;
-     int msec;
-     char *ident;
-     struct _hierarchyLogData *hierData;
-#if LOG_FULL_HEADERS
-     char *request_hdr;
-     char *reply_hdr;
-#endif /* LOG_FULL_HEADERS */
+)
 {
 #if LOG_FULL_HEADERS
     LOCAL_ARRAY(char, tmp, 10000);     /* MAX_URL is 4096 */
@@ -1096,9 +1072,8 @@ static void log_append(obj, url, caddr, size, action, method, http_code, msec, i
     }
 }
 
-static void log_enable(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+log_enable(cacheinfo * obj, StoreEntry * sentry)
 {
     if (obj->logfile_status == LOG_DISABLE) {
        obj->logfile_status = LOG_ENABLE;
@@ -1116,9 +1091,8 @@ static void log_enable(obj, sentry)
     storeAppendPrintf(sentry, " ");
 }
 
-static void log_disable(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+log_disable(cacheinfo * obj, StoreEntry * sentry)
 {
     if (obj->logfile_status == LOG_ENABLE)
        file_close(obj->logfile_fd);
@@ -1130,9 +1104,8 @@ static void log_disable(obj, sentry)
 
 
 
-static void log_clear(obj, sentry)
-     cacheinfo *obj;
-     StoreEntry *sentry;
+static void
+log_clear(cacheinfo * obj, StoreEntry * sentry)
 {
     /* what should be done here. Erase file ??? or move it to another name?  At the moment, just erase it.  bug here need to be fixed. what if there are still data in memory. Need flush here */
     if (obj->logfile_status == LOG_ENABLE)
@@ -1152,11 +1125,8 @@ static void log_clear(obj, sentry)
 
 
 
-static void proto_newobject(obj, proto_id, size, restart)
-     cacheinfo *obj;
-     protocol_t proto_id;
-     int size;
-     int restart;
+static void
+proto_newobject(cacheinfo * obj, protocol_t proto_id, int size, int restart)
 {
     proto_stat *p = &obj->proto_stat_data[proto_id];
 
@@ -1172,10 +1142,8 @@ static void proto_newobject(obj, proto_id, size, restart)
 }
 
 
-static void proto_purgeobject(obj, proto_id, size)
-     cacheinfo *obj;
-     protocol_t proto_id;
-     int size;
+static void
+proto_purgeobject(cacheinfo * obj, protocol_t proto_id, int size)
 {
     proto_stat *p = &obj->proto_stat_data[proto_id];
 
@@ -1189,19 +1157,15 @@ static void proto_purgeobject(obj, proto_id, size)
 }
 
 /* update stat for each particular protocol when an object is fetched */
-static void proto_touchobject(obj, proto_id, size)
-     cacheinfo *obj;
-     protocol_t proto_id;
-     int size;
+static void
+proto_touchobject(cacheinfo * obj, protocol_t proto_id, int size)
 {
     obj->proto_stat_data[proto_id].refcount++;
     obj->proto_stat_data[proto_id].transferbyte += (1023 + size) >> 10;
 }
 
-static void proto_count(obj, proto_id, type)
-     cacheinfo *obj;
-     protocol_t proto_id;
-     log_type type;
+static void
+proto_count(cacheinfo * obj, protocol_t proto_id, log_type type)
 {
     switch (type) {
     case LOG_TCP_HIT:
@@ -1218,9 +1182,8 @@ static void proto_count(obj, proto_id, type)
 }
 
 
-void stat_init(object, logfilename)
-     cacheinfo **object;
-     char *logfilename;
+void
+stat_init(cacheinfo ** object, char *logfilename)
 {
     cacheinfo *obj = NULL;
     int i;
@@ -1296,8 +1259,8 @@ void stat_init(object, logfilename)
     *object = obj;
 }
 
-char *stat_describe(entry)
-     StoreEntry *entry;
+char *
+stat_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, state, 256);
 
@@ -1308,8 +1271,8 @@ char *stat_describe(entry)
     return (state);
 }
 
-char *mem_describe(entry)
-     StoreEntry *entry;
+char *
+mem_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, where, 100);
 
@@ -1322,8 +1285,8 @@ char *mem_describe(entry)
 }
 
 
-char *ttl_describe(entry)
-     StoreEntry *entry;
+char *
+ttl_describe(StoreEntry * entry)
 {
     int hh, mm, ss;
     LOCAL_ARRAY(char, TTL, 60);
@@ -1347,10 +1310,8 @@ char *ttl_describe(entry)
     return (TTL);
 }
 
-char *elapsed_time(entry, since, TTL)
-     StoreEntry *entry;
-     int since;
-     char *TTL;
+char *
+elapsed_time(StoreEntry * entry, int since, char *TTL)
 {
     int hh, mm, ss, ttl;
 
@@ -1373,8 +1334,8 @@ char *elapsed_time(entry, since, TTL)
 }
 
 
-char *flags_describe(entry)
-     StoreEntry *entry;
+char *
+flags_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, FLAGS, 32);
     char LOCK_CNT[32];
@@ -1403,7 +1364,8 @@ char *flags_describe(entry)
     return (FLAGS);
 }
 
-void stat_rotate_log()
+void
+stat_rotate_log()
 {
     int i;
     LOCAL_ARRAY(char, from, MAXPATHLEN);
@@ -1439,7 +1401,8 @@ void stat_rotate_log()
     HTTPCacheInfo->logfile_access = file_write_lock(HTTPCacheInfo->logfile_fd);
 }
 
-void statCloseLog()
+void
+statCloseLog()
 {
     file_close(HTTPCacheInfo->logfile_fd);
 }
index 254f0d92e8c51a1b05f75f7d1da5cf7ca475397a..9769178076ede016e7fd8d7741968c87132c63ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stmem.cc,v 1.19 1996/08/27 05:17:50 wessels Exp $
+ * $Id: stmem.cc,v 1.20 1996/09/14 08:46:28 wessels Exp $
  *
  * DEBUG: section 19    Memory Primitives
  * AUTHOR: Harvest Derived
@@ -116,12 +116,12 @@ stmem_stats mem_obj_pool;
 #define USE_MEMALIGN 0
 #endif
 
-static void *get_free_thing _PARAMS((stmem_stats * thing));
-static void put_free_thing _PARAMS((stmem_stats * thing, void *p));
+static void *get_free_thing(stmem_stats * thing);
+static void put_free_thing(stmem_stats * thing, void *p);
 
 
-void memFree(mem)
-     mem_ptr mem;
+void
+memFree(mem_ptr mem)
 {
     mem_node lastp, p = mem->head;
 
@@ -144,8 +144,8 @@ void memFree(mem)
     safe_free(mem);
 }
 
-void memFreeData(mem)
-     mem_ptr mem;
+void
+memFreeData(mem_ptr mem)
 {
     mem_node lastp, p = mem->head;
 
@@ -165,9 +165,8 @@ void memFreeData(mem)
     mem->origin_offset = 0;
 }
 
-int memFreeDataUpto(mem, target_offset)
-     mem_ptr mem;
-     int target_offset;
+int
+memFreeDataUpto(mem_ptr mem, int target_offset)
 {
     int current_offset = mem->origin_offset;
     mem_node lastp, p = mem->head;
@@ -204,10 +203,8 @@ int memFreeDataUpto(mem, target_offset)
 
 
 /* Append incoming data. */
-int memAppend(mem, data, len)
-     mem_ptr mem;
-     char *data;
-     int len;
+int
+memAppend(mem_ptr mem, char *data, int len)
 {
     mem_node p;
     int avail_len;
@@ -251,10 +248,8 @@ int memAppend(mem, data, len)
 }
 
 #ifdef UNUSED_CODE
-int memGrep(mem, string, nbytes)
-     mem_ptr mem;
-     char *string;
-     int nbytes;
+int
+memGrep(mem_ptr mem, char *string, int nbytes)
 {
     mem_node p = mem->head;
     char *str_i, *mem_i;
@@ -303,11 +298,8 @@ int memGrep(mem, string, nbytes)
 }
 #endif
 
-int memCopy(mem, offset, buf, size)
-     mem_ptr mem;
-     int offset;
-     char *buf;
-     int size;
+int
+memCopy(mem_ptr mem, int offset, char *buf, int size)
 {
     mem_node p = mem->head;
     int t_off = mem->origin_offset;
@@ -364,7 +356,8 @@ int memCopy(mem, offset, buf, size)
 
 
 /* Do whatever is necessary to begin storage of new object */
-mem_ptr memInit()
+mem_ptr
+memInit()
 {
     mem_ptr new = xcalloc(1, sizeof(Mem_Hdr));
     new->tail = new->head = NULL;
@@ -379,8 +372,8 @@ mem_ptr memInit()
     return new;
 }
 
-static void *get_free_thing(thing)
-     stmem_stats *thing;
+static void *
+get_free_thing(stmem_stats * thing)
 {
     void *p = NULL;
     if (!empty_stack(&thing->free_page_stack)) {
@@ -396,29 +389,32 @@ static void *get_free_thing(thing)
     return p;
 }
 
-void *get_free_request_t()
+void *
+get_free_request_t()
 {
     return get_free_thing(&request_pool);
 }
 
-void *get_free_mem_obj()
+void *
+get_free_mem_obj()
 {
     return get_free_thing(&mem_obj_pool);
 }
 
-char *get_free_4k_page()
+char *
+get_free_4k_page()
 {
     return (char *) get_free_thing(&sm_stats);
 }
 
-char *get_free_8k_page()
+char *
+get_free_8k_page()
 {
     return (char *) get_free_thing(&disk_stats);
 }
 
-static void put_free_thing(thing, p)
-     stmem_stats *thing;
-     void *p;
+static void
+put_free_thing(stmem_stats * thing, void *p)
 {
     if (p == NULL)
        fatal_dump("Somebody is putting a NULL pointer!");
@@ -434,31 +430,32 @@ static void put_free_thing(thing, p)
     }
 }
 
-void put_free_request_t(req)
-     void *req;
+void
+put_free_request_t(void *req)
 {
     put_free_thing(&request_pool, req);
 }
 
-void put_free_mem_obj(mem)
-     void *mem;
+void
+put_free_mem_obj(void *mem)
 {
     put_free_thing(&mem_obj_pool, mem);
 }
 
-void put_free_4k_page(page)
-     void *page;
+void
+put_free_4k_page(void *page)
 {
     put_free_thing(&sm_stats, page);
 }
 
-void put_free_8k_page(page)
-     void *page;
+void
+put_free_8k_page(void *page)
 {
     put_free_thing(&disk_stats, page);
 }
 
-void stmemInit()
+void
+stmemInit()
 {
     sm_stats.page_size = SM_PAGE_SIZE;
     sm_stats.total_pages_allocated = 0;
index 7cb4f35818e7c9b4d01acc66f9fbd948c1303425..1962d857923d81288732f86b40f598c1d610c123 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.108 1996/09/14 07:22:04 wessels Exp $
+ * $Id: store.cc,v 1.109 1996/09/14 08:46:30 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -202,24 +202,24 @@ struct storeRebuild_data {
 int store_rebuilding = STORE_REBUILDING_SLOW;
 
 /* Static Functions */
-static int storeSwapInStart _PARAMS((StoreEntry *, SIH, void *));
-static void destroy_MemObject _PARAMS((MemObject *));
-static void destroy_MemObjectData _PARAMS((MemObject *));
-static void destroy_StoreEntry _PARAMS((StoreEntry *));
-static MemObject *new_MemObject _PARAMS((void));
-static mem_ptr new_MemObjectData _PARAMS((void));
-static StoreEntry *new_StoreEntry _PARAMS((int mem_obj_flag));
-static int storeCheckPurgeMem _PARAMS((StoreEntry * e));
-static int storeCheckExpired _PARAMS((StoreEntry * e));
-static void storeSwapLog _PARAMS((StoreEntry *));
-static int storeHashDelete _PARAMS((StoreEntry *));
-static char *storeDescribeStatus _PARAMS((StoreEntry *));
-static int compareLastRef _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
-static int compareSize _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
-static int storeClientListSearch _PARAMS((MemObject *, int fd));
-static void storeHashMemInsert _PARAMS((StoreEntry *));
-static void storeHashMemDelete _PARAMS((StoreEntry *));
-static int storeCopy _PARAMS((StoreEntry *, int, int, char *, int *));
+static int storeSwapInStart(StoreEntry *, SIH, void *);
+static void destroy_MemObject(MemObject *);
+static void destroy_MemObjectData(MemObject *);
+static void destroy_StoreEntry(StoreEntry *);
+static MemObject *new_MemObject(void);
+static mem_ptr new_MemObjectData(void);
+static StoreEntry *new_StoreEntry(int mem_obj_flag);
+static int storeCheckPurgeMem(StoreEntry * e);
+static int storeCheckExpired(StoreEntry * e);
+static void storeSwapLog(StoreEntry *);
+static int storeHashDelete(StoreEntry *);
+static char *storeDescribeStatus(StoreEntry *);
+static int compareLastRef(StoreEntry ** e1, StoreEntry ** e2);
+static int compareSize(StoreEntry ** e1, StoreEntry ** e2);
+static int storeClientListSearch(MemObject *, int fd);
+static void storeHashMemInsert(StoreEntry *);
+static void storeHashMemDelete(StoreEntry *);
+static int storeCopy(StoreEntry *, int, int, char *, int *);
 
 /* Now, this table is inaccessible to outsider. They have to use a method
  * to access a value in internal storage data structure. */
@@ -257,7 +257,8 @@ char **CacheDirs = NULL;
 static int CacheDirsAllocated = 0;
 int ncache_dirs = 0;
 
-static MemObject *new_MemObject()
+static MemObject *
+new_MemObject(void)
 {
     MemObject *mem = get_free_mem_obj();
     mem->reply = xcalloc(1, sizeof(struct _http_reply));
@@ -267,8 +268,8 @@ static MemObject *new_MemObject()
     return mem;
 }
 
-static StoreEntry *new_StoreEntry(mem_obj_flag)
-     int mem_obj_flag;
+static StoreEntry *
+new_StoreEntry(int mem_obj_flag)
 {
     StoreEntry *e = NULL;
 
@@ -280,8 +281,8 @@ static StoreEntry *new_StoreEntry(mem_obj_flag)
     return e;
 }
 
-static void destroy_MemObject(mem)
-     MemObject *mem;
+static void
+destroy_MemObject(MemObject * mem)
 {
     int i;
     debug(20, 3, "destroy_MemObject: destroying %p\n", mem);
@@ -303,8 +304,8 @@ static void destroy_MemObject(mem)
     meta_data.misc -= sizeof(struct _http_reply);
 }
 
-static void destroy_StoreEntry(e)
-     StoreEntry *e;
+static void
+destroy_StoreEntry(StoreEntry * e)
 {
     debug(20, 3, "destroy_StoreEntry: destroying %p\n", e);
     if (!e) {
@@ -328,15 +329,16 @@ static void destroy_StoreEntry(e)
     meta_data.store_entries--;
 }
 
-static mem_ptr new_MemObjectData()
+static mem_ptr
+new_MemObjectData(void)
 {
     debug(20, 3, "new_MemObjectData: calling memInit()\n");
     meta_data.mem_data_count++;
     return memInit();
 }
 
-static void destroy_MemObjectData(mem)
-     MemObject *mem;
+static void
+destroy_MemObjectData(MemObject * mem)
 {
     debug(20, 3, "destroy_MemObjectData: destroying %p\n", mem->data);
     store_mem_size -= mem->e_current_len - mem->e_lowest_offset;
@@ -359,23 +361,23 @@ static void destroy_MemObjectData(mem)
  * objects in the memory.
  */
 
-HashID storeCreateHashTable(cmp_func)
-     int (*cmp_func) (char *, char *);
+HashID
+storeCreateHashTable(int (*cmp_func) (char *, char *))
 {
     store_table = hash_create(cmp_func, STORE_BUCKETS, hash_url);
     in_mem_table = hash_create(cmp_func, STORE_IN_MEM_BUCKETS, hash_url);
     return store_table;
 }
 
-static void storeHashMemInsert(e)
-     StoreEntry *e;
+static void
+storeHashMemInsert(StoreEntry * e)
 {
     hash_insert(in_mem_table, e->key, e);
     meta_data.hot_vm++;
 }
 
-static void storeHashMemDelete(e)
-     StoreEntry *e;
+static void
+storeHashMemDelete(StoreEntry * e)
 {
     hash_link *hptr = hash_lookup(in_mem_table, e->key);
     if (hptr == NULL) {
@@ -386,8 +388,8 @@ static void storeHashMemDelete(e)
     meta_data.hot_vm--;
 }
 
-static int storeHashInsert(e)
-     StoreEntry *e;
+static int
+storeHashInsert(StoreEntry * e)
 {
     debug(20, 3, "storeHashInsert: Inserting Entry %p key '%s'\n",
        e, e->key);
@@ -396,8 +398,8 @@ static int storeHashInsert(e)
     return hash_join(store_table, (hash_link *) e);
 }
 
-static int storeHashDelete(e)
-     StoreEntry *e;
+static int
+storeHashDelete(StoreEntry * e)
 {
     if (e->mem_status == IN_MEMORY)
        storeHashMemDelete(e);
@@ -408,9 +410,8 @@ static int storeHashDelete(e)
  * maintain the in-mem hash table according to the changes of mem_status
  * This routine replaces the instruction "e->store_status = status;"
  */
-void storeSetMemStatus(e, status)
-     StoreEntry *e;
-     mem_status_t status;
+void
+storeSetMemStatus(StoreEntry * e, mem_status_t status)
 {
     if (e->key == NULL) {
        debug_trap("storeSetMemStatus: NULL key");
@@ -424,8 +425,8 @@ void storeSetMemStatus(e, status)
 
 /* -------------------------------------------------------------------------- */
 
-static char *time_describe(t)
-     time_t t;
+static char *
+time_describe(time_t t)
 {
     LOCAL_ARRAY(char, buf, 128);
 
@@ -447,9 +448,8 @@ static char *time_describe(t)
     return buf;
 }
 
-static void storeLog(tag, e)
-     int tag;
-     StoreEntry *e;
+static void
+storeLog(int tag, StoreEntry * e)
 {
     LOCAL_ARRAY(char, logmsg, MAX_URL << 1);
     time_t t;
@@ -486,8 +486,8 @@ static void storeLog(tag, e)
 
 /* get rid of memory copy of the object */
 /* Only call this if storeCheckPurgeMem(e) returns 1 */
-void storePurgeMem(e)
-     StoreEntry *e;
+void
+storePurgeMem(StoreEntry * e)
 {
     debug(20, 3, "storePurgeMem: Freeing memory-copy of %s\n", e->key);
     if (e->mem_obj == NULL)
@@ -503,10 +503,8 @@ void storePurgeMem(e)
  * storeAbort()
  * {http,ftp,gopher,wais}Start()
  */
-int storeLockObject(e, handler, data)
-     StoreEntry *e;
-     SIH handler;
-     void *data;
+int
+storeLockObject(StoreEntry * e, SIH handler, void *data)
 {
     int status = 0;
     e->lock_count++;
@@ -546,8 +544,8 @@ int storeLockObject(e, handler, data)
     return status;
 }
 
-void storeReleaseRequest(e)
-     StoreEntry *e;
+void
+storeReleaseRequest(StoreEntry * e)
 {
     if (e->flag & RELEASE_REQUEST)
        return;
@@ -561,8 +559,8 @@ void storeReleaseRequest(e)
 
 /* unlock object, return -1 if object get released after unlock
  * otherwise lock_count */
-int storeUnlockObject(e)
-     StoreEntry *e;
+int
+storeUnlockObject(StoreEntry * e)
 {
     MemObject *mem = e->mem_obj;
     e->lock_count--;
@@ -591,8 +589,8 @@ int storeUnlockObject(e)
 
 /* Lookup an object in the cache. 
  * return just a reference to object, don't start swapping in yet. */
-StoreEntry *storeGet(url)
-     char *url;
+StoreEntry *
+storeGet(char *url)
 {
     hash_link *hptr = NULL;
 
@@ -603,7 +601,8 @@ StoreEntry *storeGet(url)
     return NULL;
 }
 
-unsigned int getKeyCounter()
+unsigned int
+getKeyCounter(void)
 {
     static unsigned int key_counter = 0;
     if (++key_counter == 0)
@@ -611,10 +610,8 @@ unsigned int getKeyCounter()
     return key_counter;
 }
 
-char *storeGeneratePrivateKey(url, method, num)
-     char *url;
-     method_t method;
-     int num;
+char *
+storeGeneratePrivateKey(char *url, method_t method, int num)
 {
     if (num == 0)
        num = getKeyCounter();
@@ -627,9 +624,8 @@ char *storeGeneratePrivateKey(url, method, num)
     return key_temp_buffer;
 }
 
-char *storeGeneratePublicKey(url, method)
-     char *url;
-     method_t method;
+char *
+storeGeneratePublicKey(char *url, method_t method)
 {
     debug(20, 3, "storeGeneratePublicKey: type=%d %s\n", method, url);
     switch (method) {
@@ -664,8 +660,8 @@ char *storeGeneratePublicKey(url, method)
     return NULL;
 }
 
-void storeSetPrivateKey(e)
-     StoreEntry *e;
+void
+storeSetPrivateKey(StoreEntry * e)
 {
     StoreEntry *e2 = NULL;
     hash_link *table_entry = NULL;
@@ -694,8 +690,8 @@ void storeSetPrivateKey(e)
     BIT_SET(e->flag, KEY_PRIVATE);
 }
 
-void storeSetPublicKey(e)
-     StoreEntry *e;
+void
+storeSetPublicKey(StoreEntry * e)
 {
     StoreEntry *e2 = NULL;
     hash_link *table_entry = NULL;
@@ -732,11 +728,8 @@ void storeSetPublicKey(e)
     storeHashInsert(e);
 }
 
-StoreEntry *storeCreateEntry(url, req_hdr, flags, method)
-     char *url;
-     char *req_hdr;
-     int flags;
-     method_t method;
+StoreEntry *
+storeCreateEntry(char *url, char *req_hdr, int flags, method_t method)
 {
     StoreEntry *e = NULL;
     MemObject *mem = NULL;
@@ -795,13 +788,8 @@ StoreEntry *storeCreateEntry(url, req_hdr, flags, method)
 
 /* Add a new object to the cache with empty memory copy and pointer to disk
  * use to rebuild store from disk. */
-StoreEntry *storeAddDiskRestore(url, file_number, size, expires, timestamp, lastmod)
-     char *url;
-     int file_number;
-     int size;
-     time_t expires;
-     time_t timestamp;
-     time_t lastmod;
+StoreEntry *
+storeAddDiskRestore(char *url, int file_number, int size, time_t expires, time_t timestamp, time_t lastmod)
 {
     StoreEntry *e = NULL;
 
@@ -838,11 +826,8 @@ StoreEntry *storeAddDiskRestore(url, file_number, size, expires, timestamp, last
 }
 
 /* Register interest in an object currently being retrieved. */
-int storeRegister(e, fd, handler, data)
-     StoreEntry *e;
-     int fd;
-     PIF handler;
-     void *data;
+int
+storeRegister(StoreEntry * e, int fd, PIF handler, void *data)
 {
     PendingEntry *pe = NULL;
     int old_size;
@@ -898,9 +883,8 @@ int storeRegister(e, fd, handler, data)
 /* remove handler assoicate to that fd from store pending list */
 /* Also remove entry from client_list if exist. */
 /* return number of successfully free pending entries */
-int storeUnregister(e, fd)
-     StoreEntry *e;
-     int fd;
+int
+storeUnregister(StoreEntry * e, int fd)
 {
     int i;
     int freed = 0;
@@ -928,8 +912,8 @@ int storeUnregister(e, fd)
     return freed;
 }
 
-int storeGetLowestReaderOffset(entry)
-     StoreEntry *entry;
+int
+storeGetLowestReaderOffset(StoreEntry * entry)
 {
     MemObject *mem = entry->mem_obj;
     int lowest = mem->e_current_len;
@@ -945,8 +929,8 @@ int storeGetLowestReaderOffset(entry)
 
 /* Call to delete behind upto "target lowest offset"
  * also, update e_lowest_offset  */
-void storeDeleteBehind(e)
-     StoreEntry *e;
+void
+storeDeleteBehind(StoreEntry * e)
 {
     MemObject *mem = e->mem_obj;
     int free_up_to;
@@ -970,8 +954,8 @@ void storeDeleteBehind(e)
 }
 
 /* Call handlers waiting for  data to be appended to E. */
-static void InvokeHandlers(e)
-     StoreEntry *e;
+static void
+InvokeHandlers(StoreEntry * e)
 {
     int i;
     int fd;
@@ -996,8 +980,8 @@ static void InvokeHandlers(e)
 }
 
 /* Mark object as expired */
-void storeExpireNow(e)
-     StoreEntry *e;
+void
+storeExpireNow(StoreEntry * e)
 {
     debug(20, 3, "storeExpireNow: '%s'\n", e->key);
     e->expires = squid_curtime;
@@ -1005,8 +989,8 @@ void storeExpireNow(e)
 
 /* switch object to deleting behind mode call by
  * retrieval module when object gets too big.  */
-void storeStartDeleteBehind(e)
-     StoreEntry *e;
+void
+storeStartDeleteBehind(StoreEntry * e)
 {
     debug(20, 2, "storeStartDeleteBehind: Object: %s\n", e->key);
     if (e->flag & DELETE_BEHIND)
@@ -1021,10 +1005,8 @@ void storeStartDeleteBehind(e)
 }
 
 /* Append incoming data from a primary server to an entry. */
-void storeAppend(e, data, len)
-     StoreEntry *e;
-     char *data;
-     int len;
+void
+storeAppend(StoreEntry * e, char *data, int len)
 {
     /* sanity check */
     if (e == NULL) {
@@ -1049,13 +1031,15 @@ void storeAppend(e, data, len)
 }
 
 #if defined(__STRICT_ANSI__)
-void storeAppendPrintf(StoreEntry * e, char *fmt,...)
+void
+storeAppendPrintf(StoreEntry * e, char *fmt,...)
 {
     va_list args;
     LOCAL_ARRAY(char, buf, 4096);
     va_start(args, fmt);
 #else
-void storeAppendPrintf(va_alist)
+void
+storeAppendPrintf(va_alist)
      va_dcl
 {
     va_list args;
@@ -1073,8 +1057,8 @@ void storeAppendPrintf(va_alist)
 }
 
 /* add directory to swap disk */
-int storeAddSwapDisk(path)
-     char *path;
+int
+storeAddSwapDisk(char *path)
 {
     char **tmp = NULL;
     int i;
@@ -1095,17 +1079,16 @@ int storeAddSwapDisk(path)
 }
 
 /* return the nth swap directory */
-char *swappath(n)
-     int n;
+char *
+swappath(int n)
 {
     return *(CacheDirs + (n % ncache_dirs));
 }
 
 
 /* return full name to swapfile */
-char *storeSwapFullPath(fn, fullpath)
-     int fn;
-     char *fullpath;
+char *
+storeSwapFullPath(int fn, char *fullpath)
 {
     LOCAL_ARRAY(char, fullfilename, MAX_FILE_NAME_LEN);
     if (!fullpath)
@@ -1120,13 +1103,8 @@ char *storeSwapFullPath(fn, fullpath)
 }
 
 /* swapping in handle */
-int storeSwapInHandle(fd_notused, buf, len, flag, e, offset_notused)
-     int fd_notused;
-     char *buf;
-     int len;
-     int flag;
-     StoreEntry *e;
-     int offset_notused;
+int
+storeSwapInHandle(int fd_notused, char *buf, int len, int flag, StoreEntry * e, int offset_notused)
 {
     MemObject *mem = e->mem_obj;
     SIH handler = NULL;
@@ -1193,10 +1171,8 @@ int storeSwapInHandle(fd_notused, buf, len, flag, e, offset_notused)
 }
 
 /* start swapping in */
-static int storeSwapInStart(e, swapin_complete_handler, swapin_complete_data)
-     StoreEntry *e;
-     SIH swapin_complete_handler;
-     void *swapin_complete_data;
+static int
+storeSwapInStart(StoreEntry * e, SIH swapin_complete_handler, void *swapin_complete_data)
 {
     int fd;
     char *path = NULL;
@@ -1242,8 +1218,8 @@ static int storeSwapInStart(e, swapin_complete_handler, swapin_complete_data)
     return 0;
 }
 
-static void storeSwapLog(e)
-     StoreEntry *e;
+static void
+storeSwapLog(StoreEntry * e)
 {
     LOCAL_ARRAY(char, logmsg, MAX_URL << 1);
     /* Note this printf format appears in storeWriteCleanLog() too */
@@ -1263,10 +1239,8 @@ static void storeSwapLog(e)
        xfree);
 }
 
-void storeSwapOutHandle(fd, flag, e)
-     int fd;
-     int flag;
-     StoreEntry *e;
+void
+storeSwapOutHandle(int fd, int flag, StoreEntry * e)
 {
     LOCAL_ARRAY(char, filename, MAX_FILE_NAME_LEN);
     MemObject *mem = e->mem_obj;
@@ -1345,8 +1319,8 @@ void storeSwapOutHandle(fd, flag, e)
 
 
 /* start swapping object to disk */
-static int storeSwapOutStart(e)
-     StoreEntry *e;
+static int
+storeSwapOutStart(StoreEntry * e)
 {
     int fd;
     int x;
@@ -1401,8 +1375,8 @@ static int storeSwapOutStart(e)
 /* recreate meta data from disk image in swap directory */
 
 /* Add one swap file at a time from disk storage */
-static int storeDoRebuildFromDisk(data)
-     struct storeRebuild_data *data;
+static int
+storeDoRebuildFromDisk(struct storeRebuild_data *data)
 {
     LOCAL_ARRAY(char, swapfile, MAXPATHLEN);
     LOCAL_ARRAY(char, url, MAX_URL + 1);
@@ -1548,8 +1522,8 @@ static int storeDoRebuildFromDisk(data)
 }
 
 /* meta data recreated from disk image in swap directory */
-static void storeRebuiltFromDisk(data)
-     struct storeRebuild_data *data;
+static void
+storeRebuiltFromDisk(struct storeRebuild_data *data)
 {
     time_t r;
     time_t stop;
@@ -1584,7 +1558,8 @@ static void storeRebuiltFromDisk(data)
     swaplog_lock = file_write_lock(swaplog_fd);
 }
 
-void storeStartRebuildFromDisk()
+void
+storeStartRebuildFromDisk(void)
 {
     struct stat sb;
     int i;
@@ -1653,19 +1628,21 @@ void storeStartRebuildFromDisk()
 }
 
 /* return current swap size in kilo-bytes */
-int storeGetSwapSize()
+int
+storeGetSwapSize(void)
 {
     return store_swap_size;
 }
 
 /* return current swap size in bytes */
-int storeGetMemSize()
+int
+storeGetMemSize(void)
 {
     return store_mem_size;
 }
 
-static int storeCheckSwapable(e)
-     StoreEntry *e;
+static int
+storeCheckSwapable(StoreEntry * e)
 {
 
     if (squid_curtime - e->expires > Config.expireAge) {
@@ -1692,8 +1669,8 @@ static int storeCheckSwapable(e)
 
 
 /* Complete transfer into the local cache.  */
-void storeComplete(e)
-     StoreEntry *e;
+void
+storeComplete(StoreEntry * e)
 {
     debug(20, 3, "storeComplete: '%s'\n", e->key);
     e->object_len = e->mem_obj->e_current_len;
@@ -1714,9 +1691,8 @@ void storeComplete(e)
  * Fetch aborted.  Tell all clients to go home.  Negatively cache
  * abort message, freeing the data for this object 
  */
-void storeAbort(e, msg)
-     StoreEntry *e;
-     char *msg;
+void
+storeAbort(StoreEntry * e, char *msg)
 {
     LOCAL_ARRAY(char, mime_hdr, 300);
     LOCAL_ARRAY(char, abort_msg, 2000);
@@ -1749,10 +1725,10 @@ void storeAbort(e, msg)
        mem->request ? mem->request->protocol : PROTO_NONE,
        mem->e_current_len);
     mk_mime_hdr(mime_hdr,
-       (time_t) Config.negativeTtl,
-       6 + strlen(msg),
+       "text/html",
+       strlen(msg),
        squid_curtime,
-       "text/html");
+       squid_curtime + Config.negativeTtl);
     if (msg) {
        /* This can run off the end here. Be careful */
        if ((int) (strlen(msg) + strlen(mime_hdr) + 50) < 2000) {
@@ -1778,8 +1754,8 @@ void storeAbort(e, msg)
 }
 
 /* get the first in memory object entry in the storage */
-hash_link *storeFindFirst(id)
-     HashID id;
+hash_link *
+storeFindFirst(HashID id)
 {
     if (id == (HashID) 0)
        return NULL;
@@ -1788,8 +1764,8 @@ hash_link *storeFindFirst(id)
 
 /* get the next in memory object entry in the storage for a given
  * search pointer */
-hash_link *storeFindNext(id)
-     HashID id;
+hash_link *
+storeFindNext(HashID id)
 {
     if (id == (HashID) 0)
        return NULL;
@@ -1797,7 +1773,8 @@ hash_link *storeFindNext(id)
 }
 
 /* get the first in memory object entry in the storage */
-StoreEntry *storeGetInMemFirst()
+StoreEntry *
+storeGetInMemFirst(void)
 {
     hash_link *first = NULL;
     first = storeFindFirst(in_mem_table);
@@ -1807,7 +1784,8 @@ StoreEntry *storeGetInMemFirst()
 
 /* get the next in memory object entry in the storage for a given
  * search pointer */
-StoreEntry *storeGetInMemNext()
+StoreEntry *
+storeGetInMemNext(void)
 {
     hash_link *next = NULL;
     next = storeFindNext(in_mem_table);
@@ -1815,20 +1793,23 @@ StoreEntry *storeGetInMemNext()
 }
 
 /* get the first entry in the storage */
-StoreEntry *storeGetFirst()
+StoreEntry *
+storeGetFirst(void)
 {
     return ((StoreEntry *) storeFindFirst(store_table));
 }
 
 
 /* get the next entry in the storage for a given search pointer */
-StoreEntry *storeGetNext()
+StoreEntry *
+storeGetNext(void)
 {
     return ((StoreEntry *) storeFindNext(store_table));
 }
 
 /* free up all ttl-expired objects */
-int storePurgeOld()
+int
+storePurgeOld(void)
 {
     StoreEntry *e = NULL;
     int n = 0;
@@ -1850,9 +1831,8 @@ int storePurgeOld()
 
 
 /* Clear Memory storage to accommodate the given object len */
-int storeGetMemSpace(size, check_vm_number)
-     int size;
-     int check_vm_number;
+int
+storeGetMemSpace(int size, int check_vm_number)
 {
     StoreEntry *e = NULL;
     StoreEntry **list = NULL;
@@ -1947,8 +1927,8 @@ int storeGetMemSpace(size, check_vm_number)
     return 0;
 }
 
-static int compareSize(e1, e2)
-     StoreEntry **e1, **e2;
+static int
+compareSize(StoreEntry ** e1, StoreEntry ** e2)
 {
     if (!e1 || !e2)
        fatal_dump(NULL);
@@ -1959,8 +1939,8 @@ static int compareSize(e1, e2)
     return (0);
 }
 
-static int compareLastRef(e1, e2)
-     StoreEntry **e1, **e2;
+static int
+compareLastRef(StoreEntry ** e1, StoreEntry ** e2)
 {
     if (!e1 || !e2)
        fatal_dump(NULL);
@@ -1974,7 +1954,8 @@ static int compareLastRef(e1, e2)
 /* returns the bucket number to work on,
  * pointer to next bucket after each calling
  */
-unsigned int storeGetBucketNum()
+unsigned int
+storeGetBucketNum(void)
 {
     static unsigned int bucket = 0;
     if (bucket >= STORE_BUCKETS)
@@ -1990,8 +1971,8 @@ unsigned int storeGetBucketNum()
 #define SWAP_LRU_REMOVE_COUNT  8
 
 /* Clear Swap storage to accommodate the given object len */
-int storeGetSwapSpace(size)
-     int size;
+int
+storeGetSwapSpace(int size)
 {
     static int fReduceSwap = 0;
     static int swap_help = 0;
@@ -2134,8 +2115,8 @@ int storeGetSwapSpace(size)
 
 /* release an object from a cache */
 /* return 0 when success. */
-int storeRelease(e)
-     StoreEntry *e;
+int
+storeRelease(StoreEntry * e)
 {
     StoreEntry *result = NULL;
     StoreEntry *head_result = NULL;
@@ -2208,8 +2189,8 @@ int storeRelease(e)
 
 
 /* return if the current key is the original one. */
-int storeOriginalKey(e)
-     StoreEntry *e;
+int
+storeOriginalKey(StoreEntry * e)
 {
     if (!e)
        return 1;
@@ -2217,8 +2198,8 @@ int storeOriginalKey(e)
 }
 
 /* return 1 if a store entry is locked */
-int storeEntryLocked(e)
-     StoreEntry *e;
+int
+storeEntryLocked(StoreEntry * e)
 {
     if (e->lock_count)
        return 1;
@@ -2232,12 +2213,8 @@ int storeEntryLocked(e)
 }
 
 /*  use this for internal call only */
-static int storeCopy(e, stateoffset, maxSize, buf, size)
-     StoreEntry *e;
-     int stateoffset;
-     int maxSize;
-     char *buf;
-     int *size;
+static int
+storeCopy(StoreEntry * e, int stateoffset, int maxSize, char *buf, int *size)
 {
     int available_to_write = 0;
 
@@ -2265,8 +2242,8 @@ static int storeCopy(e, stateoffset, maxSize, buf, size)
 
 /* check if there is any client waiting for this object at all */
 /* return 1 if there is at least one client */
-int storeClientWaiting(e)
-     StoreEntry *e;
+int
+storeClientWaiting(StoreEntry * e)
 {
     int i;
     MemObject *mem = e->mem_obj;
@@ -2286,9 +2263,8 @@ int storeClientWaiting(e)
 }
 
 /* return index to matched clientstatus in client_list, -1 on NOT_FOUND */
-static int storeClientListSearch(mem, fd)
-     MemObject *mem;
-     int fd;
+static int
+storeClientListSearch(MemObject * mem, int fd)
 {
     int i;
     if (mem->client_list) {
@@ -2304,10 +2280,8 @@ static int storeClientListSearch(mem, fd)
 }
 
 /* add client with fd to client list */
-void storeClientListAdd(e, fd, last_offset)
-     StoreEntry *e;
-     int fd;
-     int last_offset;
+void
+storeClientListAdd(StoreEntry * e, int fd, int last_offset)
 {
     int i;
     MemObject *mem = e->mem_obj;
@@ -2342,13 +2316,8 @@ void storeClientListAdd(e, fd, last_offset)
 
 /* same to storeCopy but also register client fd and last requested offset
  * for each client */
-int storeClientCopy(e, stateoffset, maxSize, buf, size, fd)
-     StoreEntry *e;
-     int stateoffset;
-     int maxSize;
-     char *buf;
-     int *size;
-     int fd;
+int
+storeClientCopy(StoreEntry * e, int stateoffset, int maxSize, char *buf, int *size, int fd)
 {
     int next_offset;
     int client_list_index;
@@ -2389,8 +2358,8 @@ int storeClientCopy(e, stateoffset, maxSize, buf, size, fd)
 }
 
 
-int storeEntryValidToSend(e)
-     StoreEntry *e;
+int
+storeEntryValidToSend(StoreEntry * e)
 {
     if (squid_curtime < e->expires)
        return 1;
@@ -2403,8 +2372,8 @@ int storeEntryValidToSend(e)
     return 1;                  /* STORE_PENDING, IN_MEMORY, exp=0 */
 }
 
-int storeEntryValidLength(e)
-     StoreEntry *e;
+int
+storeEntryValidLength(StoreEntry * e)
 {
     int diff;
     int hdr_sz;
@@ -2442,8 +2411,8 @@ int storeEntryValidLength(e)
     return 1;
 }
 
-static int storeVerifySwapDirs(clean)
-     int clean;
+static int
+storeVerifySwapDirs(int clean)
 {
     int inx;
     char *path = NULL;
@@ -2488,7 +2457,8 @@ static int storeVerifySwapDirs(clean)
     return directory_created;
 }
 
-static void storeCreateSwapSubDirs()
+static void
+storeCreateSwapSubDirs(void)
 {
     int i, j, k;
     LOCAL_ARRAY(char, name, MAXPATHLEN);
@@ -2519,7 +2489,8 @@ static void storeCreateSwapSubDirs()
     }
 }
 
-void storeInit()
+void
+storeInit(void)
 {
     int dir_created;
     wordlist *w = NULL;
@@ -2558,7 +2529,8 @@ void storeInit()
        storeCreateSwapSubDirs();
 }
 
-void storeConfigure()
+void
+storeConfigure(void)
 {
     store_mem_high = (long) (Config.Mem.maxSize / 100) *
        Config.Mem.highWaterMark;
@@ -2592,7 +2564,8 @@ void storeConfigure()
  *  storeSanityCheck - verify that all swap storage areas exist, and
  *  are writable; otherwise, force -z.
  */
-void storeSanityCheck()
+void
+storeSanityCheck(void)
 {
     LOCAL_ARRAY(char, name, 4096);
     int i;
@@ -2620,8 +2593,8 @@ void storeSanityCheck()
     }
 }
 
-int urlcmp(url1, url2)
-     char *url1, *url2;
+int
+urlcmp(char *url1, char *url2)
 {
     if (!url1 || !url2)
        fatal_dump("urlcmp: Got a NULL url pointer.");
@@ -2635,7 +2608,8 @@ int urlcmp(url1, url2)
  *
  * This should get called 1/s from main().
  */
-int storeMaintainSwapSpace()
+int
+storeMaintainSwapSpace(void)
 {
     static time_t last_time = 0;
     static unsigned int bucket = 0;
@@ -2677,7 +2651,8 @@ int storeMaintainSwapSpace()
  * 
  *  Writes a "clean" swap log file from in-memory metadata.
  */
-int storeWriteCleanLog()
+int
+storeWriteCleanLog(void)
 {
     StoreEntry *e = NULL;
     LOCAL_ARRAY(char, swapfilename, MAX_FILE_NAME_LEN);
@@ -2762,16 +2737,15 @@ int storeWriteCleanLog()
     return n;
 }
 
-int swapInError(fd_unused, entry)
-     int fd_unused;
-     StoreEntry *entry;
+int
+swapInError(int fd_unused, StoreEntry * entry)
 {
     squid_error_entry(entry, ERR_DISK_IO, xstrerror());
     return 0;
 }
 
-int storePendingNClients(e)
-     StoreEntry *e;
+int
+storePendingNClients(StoreEntry * e)
 {
     int npend = 0;
     int i;
@@ -2785,7 +2759,8 @@ int storePendingNClients(e)
     return npend;
 }
 
-void storeRotateLog()
+void
+storeRotateLog(void)
 {
     char *fname = NULL;
     int i;
@@ -2828,8 +2803,8 @@ void storeRotateLog()
  * leave the StoreEntry around.  Designed to be called from
  * storeUnlockObject() and storeSwapOutHandle().
  */
-static int storeCheckPurgeMem(e)
-     StoreEntry *e;
+static int
+storeCheckPurgeMem(StoreEntry * e)
 {
     if (storeEntryLocked(e))
        return 0;
@@ -2840,8 +2815,8 @@ static int storeCheckPurgeMem(e)
     return 1;
 }
 
-static int storeCheckExpired(e)
-     StoreEntry *e;
+static int
+storeCheckExpired(StoreEntry * e)
 {
     if (storeEntryLocked(e))
        return 0;
@@ -2850,8 +2825,8 @@ static int storeCheckExpired(e)
     return 1;
 }
 
-static char *storeDescribeStatus(e)
-     StoreEntry *e;
+static char *
+storeDescribeStatus(StoreEntry * e)
 {
     static char buf[MAX_URL << 1];
     sprintf(buf, "mem:%13s ping:%12s store:%13s swap:%12s locks:%d %s\n",
@@ -2864,14 +2839,15 @@ static char *storeDescribeStatus(e)
     return buf;
 }
 
-void storeCloseLog()
+void
+storeCloseLog(void)
 {
     file_close(swaplog_fd);
     file_close(storelog_fd);
 }
 
-void storeNegativeCache(e)
-     StoreEntry *e;
+void
+storeNegativeCache(StoreEntry * e)
 {
     e->expires = squid_curtime + Config.negativeTtl;
     BIT_SET(e->flag, ENTRY_NEGCACHED);
index c2cbdd1a04a535309d19b22c45171a8e20034b7f..2ea1758203489b67dd39ad546535f4911d74bfd0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.56 1996/09/12 22:18:01 wessels Exp $
+ * $Id: tools.cc,v 1.57 1996/09/14 08:46:34 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -120,14 +120,16 @@ and report the trace back to squid-bugs@nlanr.net.\n\
 \n\
 Thanks!\n"
 
-static char *dead_msg()
+static char *
+dead_msg()
 {
     LOCAL_ARRAY(char, msg, 1024);
     sprintf(msg, DEAD_MSG, version_string, version_string);
     return msg;
 }
 
-void mail_warranty()
+void
+mail_warranty()
 {
     FILE *fp = NULL;
     char *filename;
@@ -145,8 +147,8 @@ void mail_warranty()
     unlink(filename);
 }
 
-static void dumpMallocStats(f)
-     FILE *f;
+static void
+dumpMallocStats(FILE * f)
 {
 #if HAVE_MALLINFO
     struct mallinfo mp;
@@ -197,9 +199,8 @@ static void dumpMallocStats(f)
 #endif /* HAVE_MALLINFO */
 }
 
-static int PrintRusage(f, lf)
-     void (*f) ();
-     FILE *lf;
+static int
+PrintRusage(void (*f) (), FILE * lf)
 {
 #if HAVE_GETRUSAGE && defined(RUSAGE_SELF)
     struct rusage rusage;
@@ -217,8 +218,8 @@ static int PrintRusage(f, lf)
     return 0;
 }
 
-void death(sig)
-     int sig;
+void
+death(int sig)
 {
     if (sig == SIGSEGV)
        fprintf(debug_log, "FATAL: Received Segment Violation...dying.\n");
@@ -244,8 +245,8 @@ void death(sig)
 }
 
 
-void sigusr2_handle(sig)
-     int sig;
+void
+sigusr2_handle(int sig)
 {
     static int state = 0;
     debug(21, 1, "sigusr2_handle: SIGUSR2 received.\n");
@@ -261,7 +262,8 @@ void sigusr2_handle(sig)
 #endif
 }
 
-void setSocketShutdownLifetimes()
+void
+setSocketShutdownLifetimes()
 {
     FD_ENTRY *f = NULL;
     int lft = Config.lifetimeShutdown;
@@ -280,7 +282,8 @@ void setSocketShutdownLifetimes()
     }
 }
 
-void normal_shutdown()
+void
+normal_shutdown()
 {
     debug(21, 1, "Shutting down...\n");
     if (Config.pidFilename) {
@@ -298,8 +301,8 @@ void normal_shutdown()
     exit(0);
 }
 
-void fatal_common(message)
-     char *message;
+void
+fatal_common(char *message)
 {
 #if HAVE_SYSLOG
     if (opt_syslog_enable)
@@ -313,16 +316,16 @@ void fatal_common(message)
 }
 
 /* fatal */
-void fatal(message)
-     char *message;
+void
+fatal(char *message)
 {
     fatal_common(message);
     exit(1);
 }
 
 /* fatal with dumping core */
-void fatal_dump(message)
-     char *message;
+void
+fatal_dump(char *message)
 {
     if (message)
        fatal_common(message);
@@ -332,16 +335,16 @@ void fatal_dump(message)
 }
 
 /* fatal with dumping core */
-void _debug_trap(message)
-     char *message;
+void
+_debug_trap(char *message)
 {
     if (opt_catch_signals)
        fatal_dump(message);
     _db_print(0, 0, "WARNING: %s\n", message);
 }
 
-void sig_child(sig)
-     int sig;
+void
+sig_child(int sig)
 {
 #ifdef _SQUID_NEXT_
     union wait status;
@@ -365,7 +368,8 @@ void sig_child(sig)
 #endif
 }
 
-char *getMyHostname()
+char *
+getMyHostname()
 {
     LOCAL_ARRAY(char, host, SQUIDHOSTNAMELEN + 1);
     static int present = 0;
@@ -394,9 +398,8 @@ char *getMyHostname()
     return host;
 }
 
-int safeunlink(s, quiet)
-     char *s;
-     int quiet;
+int
+safeunlink(char *s, int quiet)
 {
     int err;
     if ((err = unlink(s)) < 0)
@@ -410,7 +413,8 @@ int safeunlink(s, quiet)
  * and leave_suid()
  * To give upp all posibilites to gain privilegies use no_suid()
  */
-void leave_suid()
+void
+leave_suid()
 {
     struct passwd *pwd = NULL;
     struct group *grp = NULL;
@@ -439,7 +443,8 @@ void leave_suid()
 }
 
 /* Enter a privilegied section */
-void enter_suid()
+void
+enter_suid()
 {
     debug(21, 3, "enter_suid: PID %d taking root priveleges\n", getpid());
 #if HAVE_SETRESUID
@@ -452,7 +457,8 @@ void enter_suid()
 /* Give up the posibility to gain privilegies.
  * this should be used before starting a sub process
  */
-void no_suid()
+void
+no_suid()
 {
     uid_t uid;
     leave_suid();
@@ -466,7 +472,8 @@ void no_suid()
 #endif
 }
 
-void writePidFile()
+void
+writePidFile()
 {
     FILE *pid_fp = NULL;
     char *f = NULL;
@@ -486,7 +493,8 @@ void writePidFile()
 }
 
 
-int readPidFile()
+int
+readPidFile()
 {
     FILE *pid_fp = NULL;
     char *f = NULL;
@@ -512,7 +520,8 @@ int readPidFile()
 }
 
 
-void setMaxFD()
+void
+setMaxFD()
 {
 #if HAVE_SETRLIMIT
     /* try to use as many file descriptors as possible */
@@ -560,7 +569,8 @@ void setMaxFD()
 #endif /* RLIMIT_DATA */
 }
 
-time_t getCurrentTime()
+time_t
+getCurrentTime()
 {
 #if GETTIMEOFDAY_NO_TZP
     gettimeofday(&current_time);
@@ -570,25 +580,21 @@ time_t getCurrentTime()
     return squid_curtime = current_time.tv_sec;
 }
 
-int tvSubMsec(t1, t2)
-     struct timeval t1;
-     struct timeval t2;
+int
+tvSubMsec(struct timeval t1, struct timeval t2)
 {
     return (t2.tv_sec - t1.tv_sec) * 1000 +
        (t2.tv_usec - t1.tv_usec) / 1000;
 }
 
-int percent(a, b)
-     int a;
-     int b;
+int
+percent(int a, int b)
 {
     return b ? ((int) (100.0 * a / b + 0.5)) : 0;
 }
 
-void squid_signal(sig, func, flags)
-     int sig;
-     void (*func) ();
-     int flags;
+void
+squid_signal(int sig, void (*func) (), int flags)
 {
 #if HAVE_SIGACTION
     struct sigaction sa;
@@ -602,8 +608,8 @@ void squid_signal(sig, func, flags)
 #endif
 }
 
-char *accessLogTime(t)
-     time_t t;
+char *
+accessLogTime(time_t t)
 {
     struct tm *tm;
     static char buf[128];
index eb52b927a28e4d0e1e7cd96eaf163d19946e73bb..1cd1cd00add3added48fc5e74ae81da222455cbf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.13 1996/08/31 06:40:20 wessels Exp $
+ * $Id: tunnel.cc,v 1.14 1996/09/14 08:46:24 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -49,22 +49,22 @@ typedef struct {
 
 static char conn_established[] = "HTTP/1.0 200 Connection established\r\n\r\n";
 
-static void sslLifetimeExpire _PARAMS((int fd, SslStateData * sslState));
-static void sslReadTimeout _PARAMS((int fd, SslStateData * sslState));
-static void sslReadServer _PARAMS((int fd, SslStateData * sslState));
-static void sslReadClient _PARAMS((int fd, SslStateData * sslState));
-static void sslWriteServer _PARAMS((int fd, SslStateData * sslState));
-static void sslWriteClient _PARAMS((int fd, SslStateData * sslState));
-static void sslConnected _PARAMS((int fd, SslStateData * sslState));
-static void sslProxyConnected _PARAMS((int fd, SslStateData * sslState));
-static int sslConnect _PARAMS((int fd, struct hostent *, SslStateData *));
-static void sslConnInProgress _PARAMS((int fd, SslStateData * sslState));
-static void sslErrorComplete _PARAMS((int, char *, int, int, void *));
-static void sslClose _PARAMS((SslStateData * sslState));
-static int sslClientClosed _PARAMS((int fd, SslStateData * sslState));
+static void sslLifetimeExpire(int fd, SslStateData * sslState);
+static void sslReadTimeout(int fd, SslStateData * sslState);
+static void sslReadServer(int fd, SslStateData * sslState);
+static void sslReadClient(int fd, SslStateData * sslState);
+static void sslWriteServer(int fd, SslStateData * sslState);
+static void sslWriteClient(int fd, SslStateData * sslState);
+static void sslConnected(int fd, SslStateData * sslState);
+static void sslProxyConnected(int fd, SslStateData * sslState);
+static int sslConnect(int fd, struct hostent *, SslStateData *);
+static void sslConnInProgress(int fd, SslStateData * sslState);
+static void sslErrorComplete(int, char *, int, int, void *);
+static void sslClose(SslStateData * sslState);
+static int sslClientClosed(int fd, SslStateData * sslState);
 
-static void sslClose(sslState)
-     SslStateData *sslState;
+static void
+sslClose(SslStateData * sslState)
 {
     if (sslState->client.fd > -1) {
        /* remove the "unexpected" client close handler */
@@ -81,9 +81,8 @@ static void sslClose(sslState)
 
 /* This is called only if the client connect closes unexpectedly,
  * ie from icpDetectClientClose() */
-static int sslClientClosed(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static int
+sslClientClosed(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslClientClosed: FD %d\n", fd);
     /* we have been called from comm_close for the client side, so
@@ -96,9 +95,8 @@ static int sslClientClosed(fd, sslState)
     return 0;
 }
 
-static int sslStateFree(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static int
+sslStateFree(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslStateFree: FD %d, sslState=%p\n", fd, sslState);
     if (sslState == NULL)
@@ -119,9 +117,8 @@ static int sslStateFree(fd, sslState)
 }
 
 /* This will be called when the server lifetime is expired. */
-static void sslLifetimeExpire(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslLifetimeExpire(int fd, SslStateData * sslState)
 {
     debug(26, 4, "sslLifeTimeExpire: FD %d: URL '%s'>\n",
        fd, sslState->url);
@@ -129,9 +126,8 @@ static void sslLifetimeExpire(fd, sslState)
 }
 
 /* Read from server side and queue it for writing to the client */
-static void sslReadServer(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadServer(int fd, SslStateData * sslState)
 {
     int len;
     len = read(sslState->server.fd, sslState->server.buf, SQUID_TCP_SO_RCVBUF);
@@ -168,9 +164,8 @@ static void sslReadServer(fd, sslState)
 }
 
 /* Read from client side and queue it for writing to the server */
-static void sslReadClient(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadClient(int fd, SslStateData * sslState)
 {
     int len;
     len = read(sslState->client.fd, sslState->client.buf, SQUID_TCP_SO_RCVBUF);
@@ -203,9 +198,8 @@ static void sslReadClient(fd, sslState)
 }
 
 /* Writes data from the client buffer to the server side */
-static void sslWriteServer(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslWriteServer(int fd, SslStateData * sslState)
 {
     int len;
     len = write(sslState->server.fd,
@@ -239,9 +233,8 @@ static void sslWriteServer(fd, sslState)
 }
 
 /* Writes data from the server buffer to the client side */
-static void sslWriteClient(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslWriteClient(int fd, SslStateData * sslState)
 {
     int len;
     debug(26, 5, "sslWriteClient FD %d len=%d offset=%d\n",
@@ -275,17 +268,15 @@ static void sslWriteClient(fd, sslState)
     }
 }
 
-static void sslReadTimeout(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslReadTimeout(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslReadTimeout: FD %d\n", fd);
     sslClose(sslState);
 }
 
-static void sslConnected(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslConnected(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslConnected: FD %d sslState=%p\n", fd, sslState);
     strcpy(sslState->server.buf, conn_established);
@@ -302,21 +293,16 @@ static void sslConnected(fd, sslState)
        (void *) sslState);
 }
 
-static void sslErrorComplete(fd, buf, size, errflag, sslState)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *sslState;
+static void
+sslErrorComplete(int fd, char *buf, int size, int errflag, void *sslState)
 {
     safe_free(buf);
     sslClose(sslState);
 }
 
 
-static void sslConnInProgress(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslConnInProgress(int fd, SslStateData * sslState)
 {
     char *buf = NULL;
     debug(26, 5, "sslConnInProgress: FD %d sslState=%p\n", fd, sslState);
@@ -360,10 +346,8 @@ static void sslConnInProgress(fd, sslState)
     return;
 }
 
-static int sslConnect(fd, hp, sslState)
-     int fd;
-     struct hostent *hp;
-     SslStateData *sslState;
+static int
+sslConnect(int fd, struct hostent *hp, SslStateData * sslState)
 {
     request_t *request = sslState->request;
     int status;
@@ -437,12 +421,8 @@ static int sslConnect(fd, hp, sslState)
     return COMM_OK;
 }
 
-int sslStart(fd, url, request, mime_hdr, size_ptr)
-     int fd;
-     char *url;
-     request_t *request;
-     char *mime_hdr;
-     int *size_ptr;
+int
+sslStart(int fd, char *url, request_t * request, char *mime_hdr, int *size_ptr)
 {
     /* Create state structure. */
     SslStateData *sslState = NULL;
@@ -506,9 +486,8 @@ int sslStart(fd, url, request, mime_hdr, size_ptr)
     return COMM_OK;
 }
 
-static void sslProxyConnected(fd, sslState)
-     int fd;
-     SslStateData *sslState;
+static void
+sslProxyConnected(int fd, SslStateData * sslState)
 {
     debug(26, 3, "sslProxyConnected: FD %d sslState=%p\n", fd, sslState);
     sprintf(sslState->client.buf, "CONNECT %s HTTP/1.0\r\n\r\n", sslState->url);
index baeb48421c5c5e1bc033de76932011f20c28a3e7..37a0b28a1d72487a9fa69a5b1a0e851427c40991 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.32 1996/09/03 19:24:08 wessels Exp $
+ * $Id: url.cc,v 1.33 1996/09/14 08:46:36 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -58,9 +58,8 @@ static char hex[17] = "0123456789abcdef";
 /* convert %xx in url string to a character 
  * Allocate a new string and return a pointer to converted string */
 
-char *url_convert_hex(org_url, allocate)
-     char *org_url;
-     int allocate;
+char *
+url_convert_hex(char *org_url, int allocate)
 {
     static char code[] = "00";
     char *url = NULL;
@@ -90,7 +89,8 @@ char *url_convert_hex(org_url, allocate)
 
 /* INIT Acceptable table. 
  * Borrow from libwww2 with Mosaic2.4 Distribution   */
-void urlInitialize()
+void
+urlInitialize()
 {
     unsigned int i;
     char *good =
@@ -105,8 +105,8 @@ void urlInitialize()
 
 /* Encode prohibited char in string */
 /* return the pointer to new (allocated) string */
-char *url_escape(url)
-     char *url;
+char *
+url_escape(char *url)
 {
     char *p, *q;
     char *tmpline = xcalloc(1, MAX_URL);
@@ -125,8 +125,8 @@ char *url_escape(url)
     return tmpline;
 }
 
-method_t urlParseMethod(s)
-     char *s;
+method_t
+urlParseMethod(char *s)
 {
     if (strcasecmp(s, "GET") == 0) {
        return METHOD_GET;
@@ -143,8 +143,8 @@ method_t urlParseMethod(s)
 }
 
 
-protocol_t urlParseProtocol(s)
-     char *s;
+protocol_t
+urlParseProtocol(char *s)
 {
     if (strncasecmp(s, "http", 4) == 0)
        return PROTO_HTTP;
@@ -166,8 +166,8 @@ protocol_t urlParseProtocol(s)
 }
 
 
-int urlDefaultPort(p)
-     protocol_t p;
+int
+urlDefaultPort(protocol_t p)
 {
     switch (p) {
     case PROTO_HTTP:
@@ -185,9 +185,8 @@ int urlDefaultPort(p)
     }
 }
 
-request_t *urlParse(method, url)
-     method_t method;
-     char *url;
+request_t *
+urlParse(method_t method, char *url)
 {
     LOCAL_ARRAY(char, proto, MAX_URL + 1);
     LOCAL_ARRAY(char, login, MAX_URL + 1);
@@ -247,9 +246,8 @@ request_t *urlParse(method, url)
     return request;
 }
 
-char *urlCanonical(request, buf)
-     request_t *request;
-     char *buf;
+char *
+urlCanonical(request_t * request, char *buf)
 {
     LOCAL_ARRAY(char, urlbuf, MAX_URL + 1);
     LOCAL_ARRAY(char, portbuf, 32);
@@ -275,15 +273,15 @@ char *urlCanonical(request, buf)
     return buf;
 }
 
-request_t *requestLink(request)
-     request_t *request;
+request_t *
+requestLink(request_t * request)
 {
     request->link_count++;
     return request;
 }
 
-void requestUnlink(request)
-     request_t *request;
+void
+requestUnlink(request_t * request)
 {
     if (request == NULL)
        return;
@@ -294,9 +292,8 @@ void requestUnlink(request)
     put_free_request_t(request);
 }
 
-int matchDomainName(domain, host)
-     char *domain;
-     char *host;
+int
+matchDomainName(char *domain, char *host)
 {
     int offset;
     if ((offset = strlen(host) - strlen(domain)) < 0)
@@ -312,8 +309,8 @@ int matchDomainName(domain, host)
     return 0;
 }
 
-int urlCheckRequest(r)
-     request_t *r;
+int
+urlCheckRequest(request_t * r)
 {
     int rc = 0;
     if (r->method == METHOD_CONNECT)
index dedc68796cf164255fee0d27b862baca62bbcdd6..05a92d3a5f9fb4f93530b4c3d18f4c69ea6bd7a0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.39 1996/09/12 22:18:01 wessels Exp $
+ * $Id: wais.cc,v 1.40 1996/09/14 08:46:38 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -118,18 +118,17 @@ typedef struct {
     char request[MAX_URL + 1];
 } WaisStateData;
 
-static int waisStateFree _PARAMS((int, WaisStateData *));
-static void waisReadReplyTimeout _PARAMS((int, WaisStateData *));
-static void waisLifetimeExpire _PARAMS((int, WaisStateData *));
-static void waisReadReply _PARAMS((int, WaisStateData *));
-static void waisSendComplete _PARAMS((int, char *, int, int, void *));
-static void waisSendRequest _PARAMS((int, WaisStateData *));
-static void waisConnInProgress _PARAMS((int, WaisStateData *));
-static int waisConnect _PARAMS((int, struct hostent *, WaisStateData *));
+static int waisStateFree(int, WaisStateData *);
+static void waisReadReplyTimeout(int, WaisStateData *);
+static void waisLifetimeExpire(int, WaisStateData *);
+static void waisReadReply(int, WaisStateData *);
+static void waisSendComplete(int, char *, int, int, void *);
+static void waisSendRequest(int, WaisStateData *);
+static void waisConnInProgress(int, WaisStateData *);
+static int waisConnect(int, struct hostent *, WaisStateData *);
 
-static int waisStateFree(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static int
+waisStateFree(int fd, WaisStateData * waisState)
 {
     if (waisState == NULL)
        return 1;
@@ -139,9 +138,8 @@ static int waisStateFree(fd, waisState)
 }
 
 /* This will be called when timeout on read. */
-static void waisReadReplyTimeout(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static void
+waisReadReplyTimeout(int fd, WaisStateData * waisState)
 {
     StoreEntry *entry = NULL;
 
@@ -153,9 +151,8 @@ static void waisReadReplyTimeout(fd, waisState)
 }
 
 /* This will be called when socket lifetime is expired. */
-static void waisLifetimeExpire(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static void
+waisLifetimeExpire(int fd, WaisStateData * waisState)
 {
     StoreEntry *entry = NULL;
 
@@ -170,9 +167,8 @@ static void waisLifetimeExpire(fd, waisState)
 
 /* This will be called when data is ready to be read from fd.  Read until
  * error or connection closed. */
-static void waisReadReply(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static void
+waisReadReply(int fd, WaisStateData * waisState)
 {
     LOCAL_ARRAY(char, buf, 4096);
     int len;
@@ -286,12 +282,8 @@ static void waisReadReply(fd, waisState)
 
 /* This will be called when request write is complete. Schedule read of
  * reply. */
-static void waisSendComplete(fd, buf, size, errflag, data)
-     int fd;
-     char *buf;
-     int size;
-     int errflag;
-     void *data;
+static void
+waisSendComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     StoreEntry *entry = NULL;
     WaisStateData *waisState = data;
@@ -316,9 +308,8 @@ static void waisSendComplete(fd, buf, size, errflag, data)
 }
 
 /* This will be called when connect completes. Write request. */
-static void waisSendRequest(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static void
+waisSendRequest(int fd, WaisStateData * waisState)
 {
     int len = strlen(waisState->request) + 4;
     char *buf = NULL;
@@ -350,9 +341,8 @@ static void waisSendRequest(fd, waisState)
        storeSetPublicKey(waisState->entry);    /* Make it public */
 }
 
-static void waisConnInProgress(fd, waisState)
-     int fd;
-     WaisStateData *waisState;
+static void
+waisConnInProgress(int fd, WaisStateData * waisState)
 {
     StoreEntry *entry = waisState->entry;
 
@@ -382,12 +372,8 @@ static void waisConnInProgress(fd, waisState)
        (PF) waisSendRequest, (void *) waisState);
 }
 
-int waisStart(unusedfd, url, method, mime_hdr, entry)
-     int unusedfd;
-     char *url;
-     method_t method;
-     char *mime_hdr;
-     StoreEntry *entry;
+int
+waisStart(int unusedfd, char *url, method_t method, char *mime_hdr, StoreEntry * entry)
 {
     WaisStateData *waisState = NULL;
     int fd;
@@ -424,10 +410,8 @@ int waisStart(unusedfd, url, method, mime_hdr, entry)
 }
 
 
-static int waisConnect(fd, hp, waisState)
-     int fd;
-     struct hostent *hp;
-     WaisStateData *waisState;
+static int
+waisConnect(int fd, struct hostent *hp, WaisStateData * waisState)
 {
     int status;
     char *host = waisState->relayhost;