summaryrefslogtreecommitdiff
path: root/libc/misc/regex
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-07-23 11:23:36 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-07-23 11:23:36 +0000
commit1f020b178664857b0e107778d04fb971a58e6230 (patch)
treec1cd86593b5d354091e0fa3201c5789bec5c53ad /libc/misc/regex
parentf1775381f91f1250b20f1949dfd0364ddb0ee9fc (diff)
- trim any trailing whitespace
Diffstat (limited to 'libc/misc/regex')
-rw-r--r--libc/misc/regex/regcomp.c22
-rw-r--r--libc/misc/regex/regex_internal.c6
-rw-r--r--libc/misc/regex/regex_internal.h2
-rw-r--r--libc/misc/regex/regex_old.c44
-rw-r--r--libc/misc/regex/regexec.c10
5 files changed, 42 insertions, 42 deletions
diff --git a/libc/misc/regex/regcomp.c b/libc/misc/regex/regcomp.c
index ab6bdd876..210ae05ee 100644
--- a/libc/misc/regex/regcomp.c
+++ b/libc/misc/regex/regcomp.c
@@ -120,7 +120,7 @@ static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa);
static void free_token (re_token_t *node);
static reg_errcode_t free_tree (void *extra, bin_tree_t *node);
static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node);
-
+
/* 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.
POSIX doesn't require that we do anything for REG_NOERROR,
@@ -200,7 +200,7 @@ const size_t __re_error_msgid_idx[] attribute_hidden =
REG_ESIZE_IDX,
REG_ERPAREN_IDX
};
-
+
/* Entry points for GNU code. */
/* re_compile_pattern is the GNU regular expression compiler: it
@@ -406,7 +406,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
}
}
}
-
+
/* Entry point for POSIX code. */
/* regcomp takes a regular expression as a string and compiles it.
@@ -632,7 +632,7 @@ regfree (preg)
#if defined _LIBC || defined __UCLIBC__
strong_alias(__regfree, regfree)
#endif
-
+
/* Entry points compatible with 4.2 BSD regex library. We don't define
them unless specifically requested. */
@@ -701,7 +701,7 @@ libc_freeres_fn (free_mem)
#endif
#endif /* _REGEX_RE_COMP */
-
+
/* Internal entry point.
Compile the regular expression PATTERN, whose length is LENGTH.
SYNTAX indicate regular expression's syntax. */
@@ -1019,7 +1019,7 @@ create_initial_state (re_dfa_t *dfa)
re_node_set_free (&init_nodes);
return REG_NOERROR;
}
-
+
#ifdef RE_ENABLE_I18N
/* If it is possible to do searching in single byte encoding instead of UTF-8
to speed things up, set dfa->mb_cur_max to 1, clear is_utf8 and change
@@ -1089,7 +1089,7 @@ optimize_utf8 (re_dfa_t *dfa)
dfa->has_mb_node = dfa->nbackref > 0 || has_period;
}
#endif
-
+
/* Analyze the structure tree, and calculate "first", "next", "edest",
"eclosure", and "inveclosure". */
@@ -1700,7 +1700,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root)
*new_set = eclosure;
return REG_NOERROR;
}
-
+
/* Functions for token which are used in the parser. */
/* Fetch a token from INPUT.
@@ -2037,7 +2037,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
}
return 1;
}
-
+
/* Functions for parser. */
/* Entry point of the parser.
@@ -3660,7 +3660,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
}
return num;
}
-
+
#ifdef RE_ENABLE_I18N
static void
free_charset (re_charset_t *cset)
@@ -3676,7 +3676,7 @@ free_charset (re_charset_t *cset)
re_free (cset);
}
#endif /* RE_ENABLE_I18N */
-
+
/* Functions for binary tree operation. */
/* Create a tree node. */
diff --git a/libc/misc/regex/regex_internal.c b/libc/misc/regex/regex_internal.c
index 7bf59ef20..11b1be7c2 100644
--- a/libc/misc/regex/regex_internal.c
+++ b/libc/misc/regex/regex_internal.c
@@ -29,7 +29,7 @@ static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
const re_node_set *nodes,
unsigned int context,
unsigned int hash) internal_function;
-
+
/* Functions for string operation. */
/* This function allocate the buffers. It is necessary to call
@@ -873,7 +873,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags)
return IS_NEWLINE (c) && input->newline_anchor ? CONTEXT_NEWLINE : 0;
}
}
-
+
/* Functions for set operation. */
static reg_errcode_t
@@ -1314,7 +1314,7 @@ re_node_set_remove_at (re_node_set *set, int idx)
for (; idx < set->nelem; idx++)
set->elems[idx] = set->elems[idx + 1];
}
-
+
/* Add the token TOKEN to dfa->nodes, and return the index of the token.
Or return -1, if an error will be occured. */
diff --git a/libc/misc/regex/regex_internal.h b/libc/misc/regex/regex_internal.h
index 17fdb9b3c..725e33a5a 100644
--- a/libc/misc/regex/regex_internal.h
+++ b/libc/misc/regex/regex_internal.h
@@ -656,7 +656,7 @@ struct re_dfa_t
(re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
#define re_node_set_empty(p) ((p)->nelem = 0)
#define re_node_set_free(set) re_free ((set)->elems)
-
+
typedef enum
{
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index dc5781967..f56c56bf9 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -223,7 +223,7 @@ char *realloc ();
# ifndef MB_LEN_MAX
# define MB_LEN_MAX 1
# endif
-
+
/* Get the interface, including the syntax bits. */
# ifdef __UCLIBC__
# include "_regex.h"
@@ -296,7 +296,7 @@ char *realloc ();
/* As in Harbison and Steele. */
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
# endif
-
+
# ifndef emacs
/* How many characters in the character set. */
# define CHAR_SET_SIZE 256
@@ -335,7 +335,7 @@ init_syntax_once ()
# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
# endif /* emacs */
-
+
/* Integer type for pointers. */
# if !defined _LIBC && !defined __intptr_t_defined
typedef unsigned long int uintptr_t;
@@ -482,7 +482,7 @@ static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
struct re_registers *regs, int stop));
static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
#endif
-
+
/* 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
@@ -641,7 +641,7 @@ typedef enum
# endif /* emacs */
} re_opcode_t;
#endif /* not INSIDE_RECURSION */
-
+
#ifdef BYTE
# define CHAR_T char
@@ -777,7 +777,7 @@ PREFIX(extract_number_and_incr) (destination, source)
# endif /* DEBUG */
-
+
/* If DEBUG is defined, Regex prints many voluminous messages about what
it is doing (if the variable `debug' is nonzero). If linked with the
@@ -1277,7 +1277,7 @@ printchar (c)
# endif /* not DEBUG */
-
+
# ifdef WCHAR
/* This convert a multibyte string to a wide character string.
@@ -1394,7 +1394,7 @@ re_set_syntax (syntax)
# if defined _LIBC || defined __UCLIBC__
strong_alias(__re_set_syntax, re_set_syntax)
# endif
-
+
/* 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.
POSIX doesn't require that we do anything for REG_NOERROR,
@@ -1474,7 +1474,7 @@ static const size_t re_error_msgid_idx[] =
REG_ESIZE_IDX,
REG_ERPAREN_IDX
};
-
+
#endif /* INSIDE_RECURSION */
#ifndef DEFINED_ONCE
@@ -1515,7 +1515,7 @@ static const size_t re_error_msgid_idx[] =
# undef MATCH_MAY_ALLOCATE
# endif
#endif /* not DEFINED_ONCE */
-
+
#ifdef INSIDE_RECURSION
/* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of
@@ -1887,7 +1887,7 @@ typedef struct
set_regs_matched_done = 0; \
DEBUG_STATEMENT (nfailure_points_popped++); \
} /* POP_FAILURE_POINT */
-
+
/* Structure for per-register (a.k.a. per-group) information.
Other register information, such as the
starting and ending positions (which are addresses), and the list of
@@ -2306,7 +2306,7 @@ typedef struct
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif
# endif /* DEFINED_ONCE */
-
+
# ifndef MATCH_MAY_ALLOCATE
/* If we cannot allocate large objects within re_match_2_internal,
@@ -2357,7 +2357,7 @@ PREFIX(regex_grow_registers) (num_regs)
}
# endif /* not MATCH_MAY_ALLOCATE */
-
+
# ifndef DEFINED_ONCE
static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
compile_stack,
@@ -4648,7 +4648,7 @@ byte_compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
return ret;
}
#endif /* WCHAR */
-
+
/* 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
@@ -5018,7 +5018,7 @@ re_compile_fastmap (bufp)
#if defined _LIBC || defined __UCLIBC__
strong_alias(__re_compile_fastmap, re_compile_fastmap)
#endif
-
+
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
@@ -5057,7 +5057,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
#if defined _LIBC || defined __UCLIBC__
strong_alias(__re_set_registers, re_set_registers)
#endif
-
+
/* Searching routines. */
/* Like re_search_2, below, but only one string is specified, and
@@ -5546,7 +5546,7 @@ PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range,
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)
-
+
#else /* not INSIDE_RECURSION */
/* Matching routines. */
@@ -7659,7 +7659,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
return -1; /* Failure to match. */
} /* re_match_2 */
-
+
/* Subroutine definitions for re_match_2. */
@@ -7931,7 +7931,7 @@ PREFIX(bcmp_translate) (s1, s2, len, translate)
}
return 0;
}
-
+
#else /* not INSIDE_RECURSION */
@@ -7980,7 +7980,7 @@ re_compile_pattern (pattern, length, bufp)
#if defined _LIBC || defined __UCLIBC__
strong_alias(__re_compile_pattern, re_compile_pattern)
#endif
-
+
/* Entry points compatible with 4.2 BSD regex library. We don't define
them unless specifically requested. */
@@ -8056,7 +8056,7 @@ re_exec (s)
}
#endif /* _REGEX_RE_COMP */
-
+
/* POSIX.2 functions. Don't define these for Emacs. */
#ifndef emacs
@@ -8331,7 +8331,7 @@ strong_alias(__regfree, regfree)
#endif /* not INSIDE_RECURSION */
-
+
#undef STORE_NUMBER
#undef STORE_NUMBER_AND_INCR
#undef EXTRACT_NUMBER
diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c
index 5ab7ab7cb..587e6af30 100644
--- a/libc/misc/regex/regexec.c
+++ b/libc/misc/regex/regexec.c
@@ -200,7 +200,7 @@ static int check_node_accept (const re_match_context_t *mctx,
internal_function;
static reg_errcode_t extend_buffers (re_match_context_t *mctx)
internal_function;
-
+
/* Entry point for POSIX code. */
/* regexec searches for a given pattern, specified by PREG, in the
@@ -595,7 +595,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
#if defined _LIBC || defined __UCLIBC__
strong_alias(__re_set_registers, re_set_registers)
#endif
-
+
/* Entry points compatible with 4.2 BSD regex library. We don't define
them unless specifically requested. */
@@ -610,7 +610,7 @@ re_exec (s)
return 0 == regexec (&re_comp_buf, s, 0, NULL, 0);
}
#endif /* _REGEX_RE_COMP */
-
+
/* Internal entry point. */
/* Searches for a compiled pattern PREG in the string STRING, whose
@@ -2236,7 +2236,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
}
#endif /* RE_ENABLE_I18N */
-
+
/* Functions for state transition. */
/* Return the next state to which the current state STATE will transit by
@@ -4117,7 +4117,7 @@ extend_buffers (re_match_context_t *mctx)
return REG_NOERROR;
}
-
+
/* Functions for matching context. */
/* Initialize MCTX. */