publish pic_eof_object()

This commit is contained in:
Yuichi Nishiwaki 2014-01-13 00:49:25 +09:00
parent 322021e5d5
commit d9911cabc8
2 changed files with 13 additions and 5 deletions

View File

@ -25,4 +25,6 @@ struct pic_port {
#define pic_port_p(v) (pic_type(v) == PIC_TT_PORT)
#define pic_port_ptr(v) ((struct pic_port *)pic_ptr(v))
pic_value pic_eof_object();
#endif

View File

@ -7,6 +7,16 @@
#include "picrin/blob.h"
#include "picrin/macro.h"
pic_value
pic_eof_object()
{
pic_value v;
pic_init_value(v, PIC_VTYPE_EOF);
return v;
}
static void write_pair(pic_state *pic, struct pic_pair *pair);
static void write_str(pic_state *pic, struct pic_string *str);
@ -312,13 +322,9 @@ pic_port_eof_object_p(pic_state *pic)
static pic_value
pic_port_eof_object(pic_state *pic)
{
pic_value v;
pic_get_args(pic, "");
pic_init_value(v, PIC_VTYPE_EOF);
return v;
return pic_eof_object();
}
static pic_value