ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

regex.c File Reference
#include <sys/types.h>
#include <strings.h>
#include "regex.h"
#include <ctype.h>

Go to the source code of this file.

Data Structures

union  fail_stack_elt_t
struct  fail_stack_type
union  register_info_type
struct  compile_stack_elt_t
struct  compile_stack_type

Defines

#define JS   1
#define _GNU_SOURCE
#define PARAMS(args)   ()
#define WIDE_CHAR_SUPPORT   (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
#define gettext(msgid)   (msgid)
#define gettext_noop(String)   String
#define bzero(d, l)   memset(d,0,l)
#define Sword   1
#define SWITCH_ENUM_CAST(x)   (x)
#define CHAR_SET_SIZE   256
#define SYNTAX(c)   re_syntax_table[c]
#define ISASCII(c)   1
#define ISBLANK(c)   ((c) == ' ' || (c) == '\t')
#define ISGRAPH(c)   (ISASCII (c) && isprint (c) && !isspace (c))
#define ISPRINT(c)   (ISASCII (c) && isprint (c))
#define ISDIGIT(c)   (ISASCII (c) && isdigit (c))
#define ISALNUM(c)   (ISASCII (c) && isalnum (c))
#define ISALPHA(c)   (ISASCII (c) && isalpha (c))
#define ISCNTRL(c)   (ISASCII (c) && iscntrl (c))
#define ISLOWER(c)   (ISASCII (c) && islower (c))
#define ISPUNCT(c)   (ISASCII (c) && ispunct (c))
#define ISSPACE(c)   (ISASCII (c) && isspace (c))
#define ISUPPER(c)   (ISASCII (c) && isupper (c))
#define ISXDIGIT(c)   (ISASCII (c) && isxdigit (c))
#define NULL   (void *)0
#define SIGN_EXTEND_CHAR(c)   ((((unsigned char) (c)) ^ 128) - 128)
#define REGEX_ALLOCATE   alloca
#define REGEX_REALLOCATE(source, osize, nsize)
#define REGEX_FREE(arg)   ((void)0) /* Do nothing! But inhibit gcc warning. */
#define REGEX_ALLOCATE_STACK   alloca
#define REGEX_REALLOCATE_STACK(source, osize, nsize)   REGEX_REALLOCATE (source, osize, nsize)
#define REGEX_FREE_STACK(arg)
#define FIRST_STRING_P(ptr)   (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
#define TALLOC(n, t)   ((t *) malloc ((n) * sizeof (t)))
#define RETALLOC(addr, n, t)   ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
#define RETALLOC_IF(addr, n, t)   if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
#define REGEX_TALLOC(n, t)   ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
#define BYTEWIDTH   8 /* In bits. */
#define STREQ(s1, s2)   ((strcmp (s1, s2) == 0))
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define false   0
#define true   1
#define STORE_NUMBER(destination, number)
#define STORE_NUMBER_AND_INCR(destination, number)
#define EXTRACT_NUMBER(destination, source)
#define EXTRACT_NUMBER_AND_INCR(destination, source)
#define assert(e)
#define DEBUG_STATEMENT(e)
#define DEBUG_PRINT1(x)
#define DEBUG_PRINT2(x1, x2)
#define DEBUG_PRINT3(x1, x2, x3)
#define DEBUG_PRINT4(x1, x2, x3, x4)
#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
#define MATCH_MAY_ALLOCATE
#define INIT_FAILURE_ALLOC   5
#define FAIL_STACK_EMPTY()   (fail_stack.avail == 0)
#define FAIL_STACK_PTR_EMPTY()   (fail_stack_ptr->avail == 0)
#define FAIL_STACK_FULL()   (fail_stack.avail == fail_stack.size)
#define INIT_FAIL_STACK()
#define RESET_FAIL_STACK()   REGEX_FREE_STACK (fail_stack.stack)
#define DOUBLE_FAIL_STACK(fail_stack)
#define PUSH_PATTERN_OP(POINTER, FAIL_STACK)
#define PUSH_FAILURE_POINTER(item)   fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item)
#define PUSH_FAILURE_INT(item)   fail_stack.stack[fail_stack.avail++].integer = (item)
#define PUSH_FAILURE_ELT(item)   fail_stack.stack[fail_stack.avail++] = (item)
#define POP_FAILURE_POINTER()   fail_stack.stack[--fail_stack.avail].pointer
#define POP_FAILURE_INT()   fail_stack.stack[--fail_stack.avail].integer
#define POP_FAILURE_ELT()   fail_stack.stack[--fail_stack.avail]
#define DEBUG_PUSH(item)
#define DEBUG_POP(item_addr)
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)
#define NUM_REG_ITEMS   3
#define NUM_NONREG_ITEMS   4
#define MAX_FAILURE_ITEMS   (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
#define NUM_FAILURE_ITEMS
#define REMAINING_AVAIL_SLOTS   ((fail_stack).size - (fail_stack).avail)
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)
#define MATCH_NULL_UNSET_VALUE   3
#define REG_MATCH_NULL_STRING_P(R)   ((R).bits.match_null_string_p)
#define IS_ACTIVE(R)   ((R).bits.is_active)
#define MATCHED_SOMETHING(R)   ((R).bits.matched_something)
#define EVER_MATCHED_SOMETHING(R)   ((R).bits.ever_matched_something)
#define SET_REGS_MATCHED()
#define REG_UNSET_VALUE   (&reg_unset_dummy)
#define REG_UNSET(e)   ((e) == REG_UNSET_VALUE)
#define PATFETCH(c)
#define PATFETCH_RAW(c)
#define PATUNFETCH   p--
#define TRANSLATE(d)   (translate ? (char) translate[(unsigned char) (d)] : (d))
#define INIT_BUF_SIZE   32
#define GET_BUFFER_SPACE(n)
#define BUF_PUSH(c)
#define BUF_PUSH_2(c1, c2)
#define BUF_PUSH_3(c1, c2, c3)
#define STORE_JUMP(op, loc, to)   store_op1 (op, loc, (int) ((to) - (loc) - 3))
#define STORE_JUMP2(op, loc, to, arg)   store_op2 (op, loc, (int) ((to) - (loc) - 3), arg)
#define INSERT_JUMP(op, loc, to)   insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
#define INSERT_JUMP2(op, loc, to, arg)   insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
#define MAX_BUF_SIZE   (1L << 16)
#define REALLOC(p, s)   realloc ((p), (s))
#define EXTEND_BUFFER()
#define MAX_REGNUM   255
#define INIT_COMPILE_STACK_SIZE   32
#define COMPILE_STACK_EMPTY   (compile_stack.avail == 0)
#define COMPILE_STACK_FULL   (compile_stack.avail == compile_stack.size)
#define COMPILE_STACK_TOP   (compile_stack.stack[compile_stack.avail])
#define SET_LIST_BIT(c)
#define GET_UNSIGNED_NUMBER(num)
#define CHAR_CLASS_MAX_LENGTH   6 /* Namely, `xdigit'. */
#define IS_CHAR_CLASS(string)
#define FREE_STACK_RETURN(value)   return (free (compile_stack.stack), value)
#define POINTER_TO_OFFSET(ptr)
#define MATCHING_IN_FIRST_STRING   (dend == end_match_1)
#define PREFETCH()
#define AT_STRINGS_BEG(d)   ((d) == (size1 ? string1 : string2) || !size2)
#define AT_STRINGS_END(d)   ((d) == end2)
#define WORDCHAR_P(d)
#define FREE_VAR(var)   if (var) REGEX_FREE (var); var = NULL
#define FREE_VARIABLES()
#define NO_HIGHEST_ACTIVE_REG   (1 << BYTEWIDTH)
#define NO_LOWEST_ACTIVE_REG   (NO_HIGHEST_ACTIVE_REG + 1)

Typedefs

typedef char boolean
typedef unsigned regnum_t
typedef long pattern_offset_t

Enumerations

enum  re_opcode_t {
  no_op = 0, succeed, exactn, anychar,
  charset, charset_not, start_memory, stop_memory,
  duplicate, begline, endline, begbuf,
  endbuf, jump, jump_past_alt, on_failure_jump,
  on_failure_keep_string_jump, pop_failure_jump, maybe_pop_jump, dummy_failure_jump,
  push_dummy_failure, succeed_n, jump_n, set_number_at,
  wordchar, notwordchar, wordbeg, wordend,
  wordbound, notwordbound
}

Functions

charmalloc ()
charrealloc ()
static void init_syntax_once ()
static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop))
reg_syntax_t re_set_syntax (reg_syntax_t syntax)
static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp))
static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg))
static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2))
static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg, unsigned char *end))
static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end))
static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p, reg_syntax_t syntax))
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax))
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b))
static boolean
group_in_compile_stack 
_RE_ARGS ((compile_stack_typecompile_stack, regnum_t regnum))
static reg_errcode_t regex_compile (char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) const
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 (char *pattern, char *p, reg_syntax_t syntax) const
static boolean at_endline_loc_p (char *p, char *pend, reg_syntax_t syntax) const
static boolean group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum)
static reg_errcode_t compile_range (char **p_ptr, char *pend, RE_TRANSLATE_TYPE translate, reg_syntax_t syntax, unsigned char *b) const
int re_compile_fastmap (struct re_pattern_buffer *bufp)
void re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)
int re_search (struct re_pattern_buffer *bufp, const char *string, int size, int startpos, int range, struct re_registers *regs)
int re_search_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop)
int re_match (struct re_pattern_buffer *bufp, const char *string, int size, int pos, struct re_registers *regs)
static boolean
group_match_null_string_p 
_RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info))
static boolean
alt_match_null_string_p 
_RE_ARGS ((unsigned char *p, unsigned char *end, register_info_type *reg_info))
static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2, int len, char *translate))
int re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)
static int re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)
static boolean group_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info)
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 (char *s1, char *s2, int len, RE_TRANSLATE_TYPE translate) const
const charre_compile_pattern (char *pattern, size_t length, struct re_pattern_buffer *bufp) const
int regcomp (regex_t *preg, const char *pattern, int cflags)
int regexec (regex_t *preg, const char *string, size_t nmatch, pmatch, int eflags) const
size_t regerror (int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
void regfree (regex_t *preg)

Variables

static char re_syntax_table [CHAR_SET_SIZE]
reg_syntax_t re_syntax_options = RE_SYNTAX_GNU_AWK
static const charre_error_msgid []
int re_max_failures = 20000
static char reg_unset_dummy

Generated on Sat May 26 2012 05:07:21 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.