add picrin/proc.h
This commit is contained in:
parent
5874b7a350
commit
6a10162c2c
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef PROC_H__
|
||||||
|
#define PROC_H__
|
||||||
|
|
||||||
|
struct pic_proc {
|
||||||
|
PIC_OBJECT_HEADER
|
||||||
|
union {
|
||||||
|
pic_value (*cfunc)(pic_state *);
|
||||||
|
struct pic_irep *irep;
|
||||||
|
} u;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define pic_proc_ptr(o) ((struct pic_proc *)o.u.data)
|
||||||
|
|
||||||
|
#endif
|
|
@ -45,17 +45,11 @@ struct pic_symbol {
|
||||||
char *name;
|
char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pic_proc {
|
struct pic_proc;
|
||||||
PIC_OBJECT_HEADER
|
|
||||||
union {
|
|
||||||
struct pic_irep *irep;
|
|
||||||
} u;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define pic_object_ptr(o) ((struct pic_object *)o.u.data)
|
#define pic_object_ptr(o) ((struct pic_object *)o.u.data)
|
||||||
#define pic_pair_ptr(o) ((struct pic_pair *)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_symbol_ptr(o) ((struct pic_symbol *)o.u.data)
|
||||||
#define pic_proc_ptr(o) ((struct pic_proc *)o.u.data)
|
|
||||||
|
|
||||||
enum pic_tt pic_type(pic_value);
|
enum pic_tt pic_type(pic_value);
|
||||||
|
|
||||||
|
|
1
src/gc.c
1
src/gc.c
|
@ -3,6 +3,7 @@
|
||||||
#include "picrin.h"
|
#include "picrin.h"
|
||||||
#include "picrin/gc.h"
|
#include "picrin/gc.h"
|
||||||
#include "picrin/irep.h"
|
#include "picrin/irep.h"
|
||||||
|
#include "picrin/proc.h"
|
||||||
|
|
||||||
#if GC_DEBUG
|
#if GC_DEBUG
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "picrin.h"
|
#include "picrin.h"
|
||||||
|
#include "picrin/proc.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
pic_debug(pic_state *pic, pic_value obj)
|
pic_debug(pic_state *pic, pic_value obj)
|
||||||
|
|
Loading…
Reference in New Issue