since pic_string is a first-class value, move it to value.h
This commit is contained in:
parent
f5154625ba
commit
114d6b708b
|
@ -1,12 +0,0 @@
|
|||
#ifndef STRING_H__
|
||||
#define STRING_H__
|
||||
|
||||
struct pic_string {
|
||||
PIC_OBJECT_HEADER
|
||||
char *str;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
#define pic_str_ptr(v) ((struct pic_string *)v.u.data)
|
||||
|
||||
#endif
|
|
@ -50,12 +50,19 @@ struct pic_symbol {
|
|||
char *name;
|
||||
};
|
||||
|
||||
struct pic_string {
|
||||
PIC_OBJECT_HEADER
|
||||
char *str;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
struct pic_proc;
|
||||
struct pic_port;
|
||||
|
||||
#define pic_obj_ptr(o) ((struct pic_object *)o.u.data)
|
||||
#define pic_pair_ptr(o) ((struct pic_pair *)o.u.data)
|
||||
#define pic_symbol_ptr(o) ((struct pic_symbol *)o.u.data)
|
||||
#define pic_str_ptr(v) ((struct pic_string *)v.u.data)
|
||||
|
||||
enum pic_tt pic_type(pic_value);
|
||||
|
||||
|
|
1
src/gc.c
1
src/gc.c
|
@ -4,7 +4,6 @@
|
|||
#include "picrin/gc.h"
|
||||
#include "picrin/irep.h"
|
||||
#include "picrin/proc.h"
|
||||
#include "picrin/string.h"
|
||||
#include "picrin/symbol.h"
|
||||
|
||||
#if GC_DEBUG
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "picrin.h"
|
||||
#include "picrin/proc.h"
|
||||
#include "picrin/port.h"
|
||||
#include "picrin/string.h"
|
||||
|
||||
static void write_pair(pic_state *pic, struct pic_pair *pair);
|
||||
static void write_str(pic_state *pic, struct pic_string *str);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "picrin.h"
|
||||
#include "picrin/string.h"
|
||||
|
||||
pic_value
|
||||
pic_str_new(pic_state *pic, const char *cstr, size_t len)
|
||||
|
|
Loading…
Reference in New Issue