From b84004770a99ba120b23996009a589888e29acf8 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 12 Sep 2014 20:02:41 +0900 Subject: [PATCH] update benz (new->make) --- contrib/10.readline/src/readline.c | 14 +++++++------- contrib/10.regexp/src/regexp.c | 14 +++++++------- extlib/benz | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/10.readline/src/readline.c b/contrib/10.readline/src/readline.c index ac0f6160..b516cb6c 100644 --- a/contrib/10.readline/src/readline.c +++ b/contrib/10.readline/src/readline.c @@ -28,7 +28,7 @@ pic_rl_readline(pic_state *pic) result = readline(prompt); if(result) - return pic_obj_value(pic_str_new_cstr(pic, result)); + return pic_obj_value(pic_make_str_cstr(pic, result)); else return pic_eof_object(); } @@ -96,7 +96,7 @@ pic_rl_current_history(pic_state *pic) { pic_get_args(pic, ""); - return pic_obj_value(pic_str_new_cstr(pic, current_history()->line)); + return pic_obj_value(pic_make_str_cstr(pic, current_history()->line)); } static pic_value @@ -109,7 +109,7 @@ pic_rl_history_get(pic_state *pic) e = history_get(i); - return e ? pic_obj_value(pic_str_new_cstr(pic, e->line)) + return e ? pic_obj_value(pic_make_str_cstr(pic, e->line)) : pic_false_value(); } @@ -123,7 +123,7 @@ pic_rl_remove_history(pic_state *pic) e = remove_history(i); - return e ? pic_obj_value(pic_str_new_cstr(pic, e->line)) + return e ? pic_obj_value(pic_make_str_cstr(pic, e->line)) : pic_false_value(); } @@ -157,7 +157,7 @@ pic_rl_previous_history(pic_state *pic) e = previous_history(); - return e ? pic_obj_value(pic_str_new_cstr(pic, e->line)) + return e ? pic_obj_value(pic_make_str_cstr(pic, e->line)) : pic_false_value(); } @@ -170,7 +170,7 @@ pic_rl_next_history(pic_state *pic) e = next_history(); - return e ? pic_obj_value(pic_str_new_cstr(pic, e->line)) + return e ? pic_obj_value(pic_make_str_cstr(pic, e->line)) : pic_false_value(); } @@ -249,7 +249,7 @@ pic_rl_history_expand(pic_state *pic) if(status == -1 || status == 2) pic_errorf(pic, "%s\n", result); - return pic_obj_value(pic_str_new_cstr(pic, result)); + return pic_obj_value(pic_make_str_cstr(pic, result)); } void diff --git a/contrib/10.regexp/src/regexp.c b/contrib/10.regexp/src/regexp.c index 1f4dcec9..ab77fbbb 100644 --- a/contrib/10.regexp/src/regexp.c +++ b/contrib/10.regexp/src/regexp.c @@ -101,7 +101,7 @@ pic_regexp_regexp_match(pic_state *pic) offset = 0; while (regexec(&pic_regexp_data_ptr(reg)->reg, input, 1, match, 0) != REG_NOMATCH) { - pic_push(pic, pic_obj_value(pic_str_new(pic, input, match[0].rm_eo - match[0].rm_so)), matches); + pic_push(pic, pic_obj_value(pic_make_str(pic, input, match[0].rm_eo - match[0].rm_so)), matches); pic_push(pic, pic_int_value(offset), positions); offset += match[0].rm_eo; @@ -115,7 +115,7 @@ pic_regexp_regexp_match(pic_state *pic) if (match[i].rm_so == -1) { break; } - str = pic_str_new(pic, input + match[i].rm_so, match[i].rm_eo - match[i].rm_so); + str = pic_make_str(pic, input + match[i].rm_so, match[i].rm_eo - match[i].rm_so); pic_push(pic, pic_obj_value(str), matches); pic_push(pic, pic_int_value(match[i].rm_so), positions); } @@ -145,12 +145,12 @@ pic_regexp_regexp_split(pic_state *pic) pic_assert_type(pic, reg, regexp); while (regexec(&pic_regexp_data_ptr(reg)->reg, input, 1, &match, 0) != REG_NOMATCH) { - pic_push(pic, pic_obj_value(pic_str_new(pic, input, match.rm_so)), output); + pic_push(pic, pic_obj_value(pic_make_str(pic, input, match.rm_so)), output); input += match.rm_eo; } - pic_push(pic, pic_obj_value(pic_str_new_cstr(pic, input)), output); + pic_push(pic, pic_obj_value(pic_make_str_cstr(pic, input)), output); return pic_reverse(pic, output); } @@ -161,20 +161,20 @@ pic_regexp_regexp_replace(pic_state *pic) pic_value reg; const char *input; regmatch_t match; - pic_str *txt, *output = pic_str_new(pic, NULL, 0); + pic_str *txt, *output = pic_make_str(pic, NULL, 0); pic_get_args(pic, "ozs", ®, &input, &txt); pic_assert_type(pic, reg, regexp); while (regexec(&pic_regexp_data_ptr(reg)->reg, input, 1, &match, 0) != REG_NOMATCH) { - output = pic_strcat(pic, output, pic_str_new(pic, input, match.rm_so)); + output = pic_strcat(pic, output, pic_make_str(pic, input, match.rm_so)); output = pic_strcat(pic, output, txt); input += match.rm_eo; } - output = pic_strcat(pic, output, pic_str_new(pic, input, strlen(input))); + output = pic_strcat(pic, output, pic_make_str(pic, input, strlen(input))); return pic_obj_value(output); } diff --git a/extlib/benz b/extlib/benz index e58f216b..a2f0d7f7 160000 --- a/extlib/benz +++ b/extlib/benz @@ -1 +1 @@ -Subproject commit e58f216b2da6f4a14a35825f2878728872484e30 +Subproject commit a2f0d7f7ac4647e3ffbe488169300abb5fedbf16