From 468e1b4d1f1bab64e019bfd3ef753a99bc734969 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 11 Feb 2014 00:47:57 +0900 Subject: [PATCH] add pic_fdebug --- include/picrin.h | 1 + src/write.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/picrin.h b/include/picrin.h index 0120d3cd..fd4c8f56 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -211,6 +211,7 @@ NORETURN void pic_errorf(pic_state *, const char *, size_t, ...); void pic_warn(pic_state *, const char *); void pic_debug(pic_state *, pic_value); +void pic_fdebug(pic_state *, pic_value, XFILE *); #if defined(__cplusplus) } diff --git a/src/write.c b/src/write.c index f8629881..4925d52a 100644 --- a/src/write.c +++ b/src/write.c @@ -157,8 +157,14 @@ write(pic_state *pic, pic_value obj, XFILE *file) void pic_debug(pic_state *pic, pic_value obj) { - write(pic, obj, xstdout); - xfflush(xstdout); + pic_fdebug(pic, obj, xstdout); +} + +void +pic_fdebug(pic_state *pic, pic_value obj, XFILE *file) +{ + write(pic, obj, file); + xfflush(file); } static pic_value