remove typedefs of struct pic_string and struct pic_blob
This commit is contained in:
@@ -47,7 +47,7 @@ typedef void *(*pic_allocf)(void *, void *, size_t);
|
||||
#include "picrin/read.h"
|
||||
#include "picrin/gc.h"
|
||||
|
||||
KHASH_DECLARE(s, pic_str *, pic_sym *)
|
||||
KHASH_DECLARE(s, struct pic_string *, pic_sym *)
|
||||
|
||||
typedef struct pic_checkpoint {
|
||||
PIC_OBJECT_HEADER
|
||||
@@ -247,19 +247,19 @@ void pic_weak_del(pic_state *, struct pic_weak *, void *);
|
||||
bool pic_weak_has(pic_state *, struct pic_weak *, void *);
|
||||
|
||||
/* symbol */
|
||||
pic_sym *pic_intern(pic_state *, pic_str *);
|
||||
pic_sym *pic_intern(pic_state *, struct pic_string *);
|
||||
#define pic_intern_str(pic,s,i) pic_intern(pic, pic_make_str(pic, (s), (i)))
|
||||
#define pic_intern_cstr(pic,s) pic_intern(pic, pic_make_cstr(pic, (s)))
|
||||
#define pic_intern_lit(pic,lit) pic_intern(pic, pic_make_lit(pic, lit))
|
||||
const char *pic_symbol_name(pic_state *, pic_sym *);
|
||||
|
||||
/* string */
|
||||
int pic_str_len(pic_str *);
|
||||
char pic_str_ref(pic_state *, pic_str *, int);
|
||||
pic_str *pic_str_cat(pic_state *, pic_str *, pic_str *);
|
||||
pic_str *pic_str_sub(pic_state *, pic_str *, int, int);
|
||||
int pic_str_cmp(pic_state *, pic_str *, pic_str *);
|
||||
int pic_str_hash(pic_state *, pic_str *);
|
||||
int pic_str_len(struct pic_string *);
|
||||
char pic_str_ref(pic_state *, struct pic_string *, int);
|
||||
struct pic_string *pic_str_cat(pic_state *, struct pic_string *, struct pic_string *);
|
||||
struct pic_string *pic_str_sub(pic_state *, struct pic_string *, int, int);
|
||||
int pic_str_cmp(pic_state *, struct pic_string *, struct pic_string *);
|
||||
int pic_str_hash(pic_state *, struct pic_string *);
|
||||
|
||||
#include "picrin/blob.h"
|
||||
#include "picrin/cont.h"
|
||||
@@ -313,7 +313,7 @@ struct pic_proc *pic_make_var(pic_state *, pic_value, struct pic_proc *);
|
||||
(pic->prev_lib = NULL)))
|
||||
|
||||
void pic_warnf(pic_state *, const char *, ...);
|
||||
pic_str *pic_get_backtrace(pic_state *);
|
||||
struct pic_string *pic_get_backtrace(pic_state *);
|
||||
void pic_print_backtrace(pic_state *, xFILE *);
|
||||
|
||||
struct pic_port *pic_stdin(pic_state *);
|
||||
|
||||
@@ -12,9 +12,9 @@ extern "C" {
|
||||
struct pic_error {
|
||||
PIC_OBJECT_HEADER
|
||||
pic_sym *type;
|
||||
pic_str *msg;
|
||||
struct pic_string *msg;
|
||||
pic_value irrs;
|
||||
pic_str *stack;
|
||||
struct pic_string *stack;
|
||||
};
|
||||
|
||||
#define pic_error_p(v) (pic_type(v) == PIC_TT_ERROR)
|
||||
|
||||
@@ -15,13 +15,13 @@ struct pic_env {
|
||||
PIC_OBJECT_HEADER
|
||||
khash_t(env) map;
|
||||
struct pic_env *up;
|
||||
pic_str *prefix;
|
||||
struct pic_string *prefix;
|
||||
};
|
||||
|
||||
#define pic_env_p(v) (pic_type(v) == PIC_TT_ENV)
|
||||
#define pic_env_ptr(v) ((struct pic_env *)pic_ptr(v))
|
||||
|
||||
struct pic_env *pic_make_topenv(pic_state *, pic_str *);
|
||||
struct pic_env *pic_make_topenv(pic_state *, struct pic_string *);
|
||||
struct pic_env *pic_make_env(pic_state *, struct pic_env *);
|
||||
|
||||
pic_sym *pic_add_identifier(pic_state *, pic_id *, struct pic_env *);
|
||||
|
||||
@@ -19,14 +19,14 @@ void pic_rope_decref(pic_state *, struct pic_rope *);
|
||||
|
||||
#define pic_str_ptr(o) ((struct pic_string *)pic_ptr(o))
|
||||
|
||||
pic_str *pic_make_str(pic_state *, const char *, int);
|
||||
struct pic_string *pic_make_str(pic_state *, const char *, int);
|
||||
#define pic_make_cstr(pic, cstr) pic_make_str(pic, (cstr), strlen(cstr))
|
||||
#define pic_make_lit(pic, lit) pic_make_str(pic, "" lit, -((int)sizeof lit - 1))
|
||||
|
||||
const char *pic_str_cstr(pic_state *, pic_str *);
|
||||
const char *pic_str_cstr(pic_state *, struct pic_string *);
|
||||
|
||||
pic_str *pic_format(pic_state *, const char *, ...);
|
||||
pic_str *pic_vformat(pic_state *, const char *, va_list);
|
||||
struct pic_string *pic_format(pic_state *, const char *, ...);
|
||||
struct pic_string *pic_vformat(pic_state *, const char *, va_list);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct pic_id {
|
||||
union {
|
||||
struct pic_symbol {
|
||||
PIC_OBJECT_HEADER
|
||||
pic_str *str;
|
||||
struct pic_string *str;
|
||||
} sym;
|
||||
struct {
|
||||
PIC_OBJECT_HEADER
|
||||
|
||||
@@ -202,9 +202,7 @@ struct pic_env;
|
||||
typedef struct pic_symbol pic_sym;
|
||||
typedef struct pic_id pic_id;
|
||||
typedef struct pic_pair pic_pair;
|
||||
typedef struct pic_string pic_str;
|
||||
typedef struct pic_vector pic_vec;
|
||||
typedef struct pic_blob pic_blob;
|
||||
|
||||
#define pic_obj_p(v) (pic_vtype(v) == PIC_VTYPE_HEAP)
|
||||
#define pic_obj_ptr(v) ((struct pic_object *)pic_ptr(v))
|
||||
|
||||
Reference in New Issue
Block a user