typedef struct {
int left_anchor;
int right_anchor;
-} OptAncInfo;
+} OptAnc;
typedef struct {
MinMaxLen mmd; /* info position */
- OptAncInfo anc;
+ OptAnc anc;
int reach_end;
int ignore_case;
int len;
UChar s[OPT_EXACT_MAXLEN];
-} OptExactInfo;
+} OptExact;
typedef struct {
MinMaxLen mmd; /* info position */
- OptAncInfo anc;
+ OptAnc anc;
int value; /* weighted value */
UChar map[ONIG_CHAR_TABLE_SIZE];
-} OptMapInfo;
+} OptMap;
typedef struct {
MinMaxLen len;
- OptAncInfo anc;
- OptExactInfo exb; /* boundary */
- OptExactInfo exm; /* middle */
- OptExactInfo expr; /* prec read (?=...) */
+ OptAnc anc;
+ OptExact exb; /* boundary */
+ OptExact exm; /* middle */
+ OptExact expr; /* prec read (?=...) */
- OptMapInfo map; /* boundary */
+ OptMap map; /* boundary */
} NodeOptInfo;
}
static void
-clear_opt_anc_info(OptAncInfo* anc)
+clear_opt_anc_info(OptAnc* anc)
{
anc->left_anchor = 0;
anc->right_anchor = 0;
}
static void
-copy_opt_anc_info(OptAncInfo* to, OptAncInfo* from)
+copy_opt_anc_info(OptAnc* to, OptAnc* from)
{
*to = *from;
}
static void
-concat_opt_anc_info(OptAncInfo* to, OptAncInfo* left, OptAncInfo* right,
+concat_opt_anc_info(OptAnc* to, OptAnc* left, OptAnc* right,
OnigLen left_len, OnigLen right_len)
{
clear_opt_anc_info(to);
}
static int
-is_set_opt_anc_info(OptAncInfo* to, int anc)
+is_set_opt_anc_info(OptAnc* to, int anc)
{
if ((to->left_anchor & anc) != 0) return 1;
}
static void
-add_opt_anc_info(OptAncInfo* to, int anc)
+add_opt_anc_info(OptAnc* to, int anc)
{
if (is_left_anchor(anc))
to->left_anchor |= anc;
}
static void
-remove_opt_anc_info(OptAncInfo* to, int anc)
+remove_opt_anc_info(OptAnc* to, int anc)
{
if (is_left_anchor(anc))
to->left_anchor &= ~anc;
}
static void
-alt_merge_opt_anc_info(OptAncInfo* to, OptAncInfo* add)
+alt_merge_opt_anc_info(OptAnc* to, OptAnc* add)
{
to->left_anchor &= add->left_anchor;
to->right_anchor &= add->right_anchor;
}
static int
-is_full_opt_exact_info(OptExactInfo* ex)
+is_full_opt_exact_info(OptExact* ex)
{
return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0);
}
static void
-clear_opt_exact_info(OptExactInfo* ex)
+clear_opt_exact_info(OptExact* ex)
{
clear_mml(&ex->mmd);
clear_opt_anc_info(&ex->anc);
}
static void
-copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from)
+copy_opt_exact_info(OptExact* to, OptExact* from)
{
*to = *from;
}
static void
-concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OnigEncoding enc)
+concat_opt_exact_info(OptExact* to, OptExact* add, OnigEncoding enc)
{
int i, j, len;
UChar *p, *end;
- OptAncInfo tanc;
+ OptAnc tanc;
if (! to->ignore_case && add->ignore_case) {
if (to->len >= add->len) return ; /* avoid */
}
static void
-concat_opt_exact_info_str(OptExactInfo* to, UChar* s, UChar* end,
+concat_opt_exact_info_str(OptExact* to, UChar* s, UChar* end,
int raw ARG_UNUSED, OnigEncoding enc)
{
int i, j, len;
}
static void
-alt_merge_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OptEnv* env)
+alt_merge_opt_exact_info(OptExact* to, OptExact* add, OptEnv* env)
{
int i, j, len;
}
static void
-select_opt_exact_info(OnigEncoding enc, OptExactInfo* now, OptExactInfo* alt)
+select_opt_exact_info(OnigEncoding enc, OptExact* now, OptExact* alt)
{
int v1, v2;
}
static void
-clear_opt_map_info(OptMapInfo* map)
+clear_opt_map_info(OptMap* map)
{
- static const OptMapInfo clean_info = {
+ static const OptMap clean_info = {
{0, 0}, {0, 0}, 0,
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
};
- xmemcpy(map, &clean_info, sizeof(OptMapInfo));
+ xmemcpy(map, &clean_info, sizeof(OptMap));
}
static void
-copy_opt_map_info(OptMapInfo* to, OptMapInfo* from)
+copy_opt_map_info(OptMap* to, OptMap* from)
{
*to = *from;
}
static void
-add_char_opt_map_info(OptMapInfo* map, UChar c, OnigEncoding enc)
+add_char_opt_map_info(OptMap* map, UChar c, OnigEncoding enc)
{
if (map->map[c] == 0) {
map->map[c] = 1;
}
static int
-add_char_amb_opt_map_info(OptMapInfo* map, UChar* p, UChar* end,
+add_char_amb_opt_map_info(OptMap* map, UChar* p, UChar* end,
OnigEncoding enc, OnigCaseFoldType case_fold_flag)
{
OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM];
}
static void
-select_opt_map_info(OptMapInfo* now, OptMapInfo* alt)
+select_opt_map_info(OptMap* now, OptMap* alt)
{
static int z = 1<<15; /* 32768: something big value */
}
static int
-comp_opt_exact_or_map_info(OptExactInfo* e, OptMapInfo* m)
+comp_opt_exact_or_map_info(OptExact* e, OptMap* m)
{
#define COMP_EM_BASE 20
int ve, vm;
}
static void
-alt_merge_opt_map_info(OnigEncoding enc, OptMapInfo* to, OptMapInfo* add)
+alt_merge_opt_map_info(OnigEncoding enc, OptMap* to, OptMap* add)
{
int i, val;
concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add)
{
int exb_reach, exm_reach;
- OptAncInfo tanc;
+ OptAnc tanc;
concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max);
copy_opt_anc_info(&to->anc, &tanc);
}
static int
-set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
+set_optimize_exact_info(regex_t* reg, OptExact* e)
{
int r;
}
static void
-set_optimize_map_info(regex_t* reg, OptMapInfo* m)
+set_optimize_map_info(regex_t* reg, OptMap* m)
{
int i;
}
static void
-set_sub_anchor(regex_t* reg, OptAncInfo* anc)
+set_sub_anchor(regex_t* reg, OptAnc* anc)
{
reg->sub_anchor |= anc->left_anchor & ANCHOR_BEGIN_LINE;
reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE;