{
int r;
UChar* name;
- OnigEncoding enc;
OnigEncoding use_encs[1];
- use_encs[0] = enc = ONIG_ENCODING_UTF8;
+ use_encs[0] = ONIG_ENCODING_UTF8;
onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
onig_initialize_builtin_callouts();
name = (UChar* )"FOO";
- r = onig_set_callout_of_name(enc, name, name + strlen(name),
+ r = onig_set_callout_of_name(name, name + strlen(name),
callout_foo, retraction_callout_foo);
if (r != ONIG_NORMAL) {
fprintf(stderr, "ERROR: fail to set callout of name: %s\n", name);
ONIG_EXTERN
int onig_set_retraction_callout_of_code P_((OnigCalloutFunc f));
ONIG_EXTERN
-int onig_set_callout_of_name P_((OnigEncoding enc, UChar* name, UChar* name_end, OnigCalloutFunc callout, OnigCalloutFunc retraction_callout));
+int onig_set_callout_of_name P_((UChar* name, UChar* name_end, OnigCalloutFunc callout, OnigCalloutFunc retraction_callout)); /* name: single-byte string */
ONIG_EXTERN
int onig_get_capture_range_in_callout P_((OnigCalloutArgs* args, int mem_num, int* begin, int* end));
onig_initialize_builtin_callouts(void)
{
#define B1(name, func) do {\
- r = onig_set_callout_of_name(0, (UChar* )#name, (UChar* )(#name + strlen(#name)),\
+ r = onig_set_callout_of_name((UChar* )#name, (UChar* )(#name + strlen(#name)),\
onig_builtin_ ## func, 0);\
if (r != ONIG_NORMAL) return r;\
} while(0)
return 1;
}
-extern int
-onig_set_callout_of_name(OnigEncoding enc, UChar* name, UChar* name_end,
- OnigCalloutFunc callout, OnigCalloutFunc retraction_callout)
+static int
+set_callout_of_name_with_enc(OnigEncoding enc, UChar* name, UChar* name_end,
+ OnigCalloutFunc callout,
+ OnigCalloutFunc retraction_callout)
{
int r;
int id;
return r;
}
+extern int
+onig_set_callout_of_name(UChar* name, UChar* name_end,
+ OnigCalloutFunc callout, OnigCalloutFunc retraction_callout)
+{
+ return set_callout_of_name_with_enc(0, name, name_end, callout, retraction_callout);
+}
+
extern int
onig_get_callout_id_from_name(OnigEncoding enc, UChar* name, UChar* name_end,
int* rid)