/*
- * $Id: GNUregex.c,v 1.14 2003/06/19 22:25:18 robertc Exp $
+ * $Id: GNUregex.c,v 1.15 2003/06/20 00:05:11 hno Exp $
*/
/* Extended regular expression matching and search library,
static char re_syntax_table[CHAR_SET_SIZE];
static void
-init_syntax_once()
+init_syntax_once(void)
{
register int c;
static int done = 0;
\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();
-
/* 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
unsigned avail; /* Offset of next open position. */
} compile_stack_type;
+static void store_op1(re_opcode_t op, unsigned char *loc, int arg);
+static void store_op2( re_opcode_t op, unsigned char *loc, int arg1, int arg2);
+static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end);
+static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end);
+static boolean at_begline_loc_p(const char * pattern, const char *p, reg_syntax_t syntax);
+static boolean at_endline_loc_p(const char *p, const char *pend, int syntax);
+static boolean group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum);
+static reg_errcode_t compile_range(const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b);
#define INIT_COMPILE_STACK_SIZE 32
* examined nor set. */
static reg_errcode_t
-regex_compile(pattern, size, syntax, bufp)
- const char *pattern;
- int size;
- reg_syntax_t syntax;
- struct re_pattern_buffer *bufp;
+regex_compile(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
} /* regex_compile */
\f
/* Subroutines for `regex_compile'. */
-static void store_op1(re_opcode_t op, unsigned char *loc, int arg);
-static void store_op2( re_opcode_t op, unsigned char *loc, int arg1, int arg2);
-static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end);
-static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end);
-static boolean at_begline_loc_p(const char * pattern, const char *p, reg_syntax_t syntax);
-static boolean at_endline_loc_p(const char *p, const char *pend, int syntax);
-static boolean group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum);
-static reg_errcode_t compile_range(const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b);
/* Store OP at LOC followed by two-byte integer parameter ARG. */
\f
/* Declarations and macros for re_match_2. */
-static boolean 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
static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info);
static boolean common_op_match_null_string_p( unsigned char **p, unsigned char *end, register_info_type *reg_info);
static int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate);
+static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
#define IS_ACTIVE(R) ((R).bits.is_active)
} /* re_match_2 */
\f
/* Subroutine definitions for re_match_2. */
-static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
-
/* We are passed P pointing to a register number after a start_memory.
*