From b404f30a501589837aea79f05c2d510b5bfee6c9 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 11 Feb 2014 13:38:42 +0900 Subject: [PATCH] pic_debug family return obj --- include/picrin.h | 4 ++-- src/write.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/picrin.h b/include/picrin.h index 7f029fcf..e2d938e1 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -212,8 +212,8 @@ void pic_warn(pic_state *, const char *); const char *pic_errmsg(pic_state *); -void pic_debug(pic_state *, pic_value); -void pic_fdebug(pic_state *, pic_value, XFILE *); +pic_value pic_debug(pic_state *, pic_value); +pic_value pic_fdebug(pic_state *, pic_value, XFILE *); #if defined(__cplusplus) } diff --git a/src/write.c b/src/write.c index 4925d52a..e96cf706 100644 --- a/src/write.c +++ b/src/write.c @@ -154,17 +154,18 @@ write(pic_state *pic, pic_value obj, XFILE *file) } } -void +pic_value pic_debug(pic_state *pic, pic_value obj) { - pic_fdebug(pic, obj, xstdout); + return pic_fdebug(pic, obj, xstdout); } -void +pic_value pic_fdebug(pic_state *pic, pic_value obj, XFILE *file) { write(pic, obj, file); xfflush(file); + return obj; } static pic_value