mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Devolve smob snarfers
* libguile/snarf.h: * libguile/smob.h (SCM_SMOB, SCM_GLOBAL_SMOB) (SCM_SMOB_MARK, SCM_GLOBAL_SMOB_MARK) (SCM_SMOB_FREE, SCM_GLOBAL_SMOB_FREE) (SCM_SMOB_PRINT, SCM_GLOBAL_SMOB_PRINT) (SCM_SMOB_EQUALP, SCM_GLOBAL_SMOB_EQUALP) (SCM_SMOB_APPLY, SCM_GLOBAL_SMOB_APPLY): Move these definitions here.
This commit is contained in:
parent
1d77492e86
commit
ad4fbebe85
2 changed files with 52 additions and 48 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <libguile/error.h>
|
||||
#include <libguile/gc.h>
|
||||
#include "libguile/print.h"
|
||||
#include <libguile/snarf.h>
|
||||
|
||||
|
||||
|
||||
|
@ -69,6 +70,57 @@ SCM_API long scm_numsmob;
|
|||
SCM_API scm_smob_descriptor scm_smobs[];
|
||||
|
||||
|
||||
|
||||
|
||||
#define SCM_SMOB(tag, scheme_name, size) \
|
||||
SCM_SNARF_HERE(static scm_t_bits tag) \
|
||||
SCM_SNARF_INIT((tag)=scm_make_smob_type((scheme_name), (size));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB(tag, scheme_name, size) \
|
||||
SCM_SNARF_HERE(scm_t_bits tag) \
|
||||
SCM_SNARF_INIT((tag)=scm_make_smob_type((scheme_name), (size));)
|
||||
|
||||
#define SCM_SMOB_MARK(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(static SCM c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_mark((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_MARK(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(SCM c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_mark((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_FREE(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(static size_t c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_free((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_FREE(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(size_t c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_free((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_PRINT(tag, c_name, obj, port, pstate) \
|
||||
SCM_SNARF_HERE(static int c_name(SCM obj, SCM port, scm_print_state* pstate)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_print((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_PRINT(tag, c_name, obj, port, pstate) \
|
||||
SCM_SNARF_HERE(int c_name(SCM obj, SCM port, scm_print_state* pstate)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_print((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_EQUALP(tag, c_name, obj1, obj2) \
|
||||
SCM_SNARF_HERE(static SCM c_name(SCM obj1, SCM obj2)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_equalp((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_EQUALP(tag, c_name, obj1, obj2) \
|
||||
SCM_SNARF_HERE(SCM c_name(SCM obj1, SCM obj2)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_equalp((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_APPLY(tag, c_name, req, opt, rest, arglist) \
|
||||
SCM_SNARF_HERE(static SCM c_name arglist) \
|
||||
SCM_SNARF_INIT(scm_set_smob_apply((tag), (c_name), (req), (opt), (rest));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_APPLY(tag, c_name, req, opt, rest, arglist) \
|
||||
SCM_SNARF_HERE(SCM c_name arglist) \
|
||||
SCM_SNARF_INIT(scm_set_smob_apply((tag), (c_name), (req), (opt), (rest));)
|
||||
|
||||
|
||||
|
||||
|
||||
SCM_API SCM scm_i_new_smob (scm_t_bits tc, scm_t_bits);
|
||||
|
|
|
@ -85,54 +85,6 @@ DOCSTRING ^^ }
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#define SCM_SMOB(tag, scheme_name, size) \
|
||||
SCM_SNARF_HERE(static scm_t_bits tag) \
|
||||
SCM_SNARF_INIT((tag)=scm_make_smob_type((scheme_name), (size));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB(tag, scheme_name, size) \
|
||||
SCM_SNARF_HERE(scm_t_bits tag) \
|
||||
SCM_SNARF_INIT((tag)=scm_make_smob_type((scheme_name), (size));)
|
||||
|
||||
#define SCM_SMOB_MARK(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(static SCM c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_mark((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_MARK(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(SCM c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_mark((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_FREE(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(static size_t c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_free((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_FREE(tag, c_name, arg) \
|
||||
SCM_SNARF_HERE(size_t c_name(SCM arg)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_free((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_PRINT(tag, c_name, obj, port, pstate) \
|
||||
SCM_SNARF_HERE(static int c_name(SCM obj, SCM port, scm_print_state* pstate)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_print((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_PRINT(tag, c_name, obj, port, pstate) \
|
||||
SCM_SNARF_HERE(int c_name(SCM obj, SCM port, scm_print_state* pstate)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_print((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_EQUALP(tag, c_name, obj1, obj2) \
|
||||
SCM_SNARF_HERE(static SCM c_name(SCM obj1, SCM obj2)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_equalp((tag), (c_name));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_EQUALP(tag, c_name, obj1, obj2) \
|
||||
SCM_SNARF_HERE(SCM c_name(SCM obj1, SCM obj2)) \
|
||||
SCM_SNARF_INIT(scm_set_smob_equalp((tag), (c_name));)
|
||||
|
||||
#define SCM_SMOB_APPLY(tag, c_name, req, opt, rest, arglist) \
|
||||
SCM_SNARF_HERE(static SCM c_name arglist) \
|
||||
SCM_SNARF_INIT(scm_set_smob_apply((tag), (c_name), (req), (opt), (rest));)
|
||||
|
||||
#define SCM_GLOBAL_SMOB_APPLY(tag, c_name, req, opt, rest, arglist) \
|
||||
SCM_SNARF_HERE(SCM c_name arglist) \
|
||||
SCM_SNARF_INIT(scm_set_smob_apply((tag), (c_name), (req), (opt), (rest));)
|
||||
|
||||
|
||||
/* Low-level snarfing for static memory allocation. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue