From 6f8e5d079094edc7f69a0fe0f8e31ee3d29177ac Mon Sep 17 00:00:00 2001 From: ketmar Date: Sat, 17 Aug 2013 03:11:24 +0300 Subject: [PATCH] some details are hidden now --- src/libre9/re9.c | 8 ++++++++ src/libre9/re9.h | 32 ++++++++++++-------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/libre9/re9.c b/src/libre9/re9.c index 5e9a0ef..e6f7719 100644 --- a/src/libre9/re9.c +++ b/src/libre9/re9.c @@ -35,6 +35,14 @@ /******************************************************************************/ +struct re9_prog_s { + re9_inst_t *startinst; /* start pc */ + re9_class_t class[RE9_PROG_CLASS_MAX]; /* .data */ + re9_inst_t firstinst[RE9_PROG_FINST_MAX]; /* .text */ +}; + + +/******************************************************************************/ /* re9_compile.h */ /* substitution list */ diff --git a/src/libre9/re9.h b/src/libre9/re9.h index d7a334a..11be8b1 100644 --- a/src/libre9/re9.h +++ b/src/libre9/re9.h @@ -70,43 +70,39 @@ extern "C" { typedef uint32_t re9_rune; -typedef struct re9_sub_s re9_sub_t; -typedef struct re9_class_s re9_class_t; -typedef struct re9_inst_s re9_inst_t; -typedef struct re9_prog_s re9_prog_t; - enum { RE9_SUBEXP_MAX = 16 }; /* subexpression matches */ -struct re9_sub_s { +typedef struct { const char *sp; const char *ep; -}; +} re9_sub_t; /* character class, each pair of rune's defines a range */ -struct re9_class_s { +typedef struct { re9_rune *end; re9_rune spans[64]; -}; +} re9_class_t; /* machine instructions */ -struct re9_inst_s { +typedef struct re9_inst_s { int type; /* bit 8 set(0x100): inverse 'or' operator */ union { re9_class_t *cp; /* class pointer */ re9_rune r; /* character */ int subid; /* sub-expression id for RBRA and LBRA */ - re9_inst_t *right; /* right child of OR */ + struct re9_inst_s *right; /* right child of OR */ } u1; - union { /* regexp relies on these two being in the same union */ - re9_inst_t *left; /* left child of OR */ - re9_inst_t *next; /* next instruction for CAT & LBRA */ + union { + /* regexp relies on these two being in the same union */ + struct re9_inst_s *left; /* left child of OR */ + struct re9_inst_s *next; /* next instruction for CAT & LBRA */ } u2; -}; +} re9_inst_t; enum { @@ -116,11 +112,7 @@ enum { /* program definition */ -struct re9_prog_s { - re9_inst_t *startinst; /* start pc */ - re9_class_t class[RE9_PROG_CLASS_MAX]; /* .data */ - re9_inst_t firstinst[RE9_PROG_FINST_MAX]; /* .text */ -}; +typedef struct re9_prog_s re9_prog_t; enum { -- 2.11.4.GIT