add string type
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef PORT_H__
|
||||
#define PORT_H__
|
||||
|
||||
#include "picrin.h"
|
||||
|
||||
enum pic_port_flag {
|
||||
PIC_PORT_IN,
|
||||
PIC_PORT_OUT,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef STRING_H__
|
||||
#define STRING_H__
|
||||
|
||||
struct pic_string {
|
||||
PIC_OBJECT_HEADER
|
||||
const char *str;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
#define pic_str_ptr(v) ((struct pic_string *)v.u.data)
|
||||
|
||||
pic_value pic_str_new_cstr(pic_state *, const char *);
|
||||
|
||||
#endif
|
||||
@@ -28,7 +28,8 @@ enum pic_tt {
|
||||
PIC_TT_PAIR,
|
||||
PIC_TT_SYMBOL,
|
||||
PIC_TT_PROC,
|
||||
PIC_TT_PORT
|
||||
PIC_TT_PORT,
|
||||
PIC_TT_STRING
|
||||
};
|
||||
|
||||
#define PIC_OBJECT_HEADER \
|
||||
|
||||
Reference in New Issue
Block a user