int onig_set_callout_of_name P_((OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, OnigType arg_types[], int optional_arg_num, OnigValue opt_defaults[])); /* name: single-byte string */
ONIG_EXTERN
OnigUChar* onig_get_callout_name_from_name_id P_((int id));
+ONIG_EXTERN
+int onig_get_callout_num_from_tag_name P_((OnigRegex reg, const UChar* name, const UChar* name_end));
/* used in callout functions */
ONIG_EXTERN
return 0;
}
+extern int
+onig_get_callout_num_from_tag_name(regex_t* reg,
+ const UChar* name, const UChar* name_end)
+{
+ int r;
+ RegexExt* ext;
+ CalloutTagVal e;
+
+ ext = REG_EXTP(reg);
+ if (IS_NULL(ext) || IS_NULL(ext->tag_table)) return -1;
+
+ r = onig_st_lookup_strend(ext->tag_table, name, name_end,
+ (HashDataType* )((void* )(&e)));
+ if (r == 0) return -1;
+ return (int )e;
+}
+
static CalloutTagVal
callout_tag_find(CalloutTagTable* t, const UChar* name, const UChar* name_end)
{