diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-07-07 09:41:38 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-07-07 09:41:38 +0000 |
commit | 8ac40ce8871ccfa5e8c0a4fe3a1d55dfb69f839c (patch) | |
tree | 83cdfdba753cb9c21cd3c789f39daf12258a8d5e | |
parent | 5bdab01690b130bcce79d40e93aa9c43fde83124 (diff) | |
download | guile-8ac40ce8871ccfa5e8c0a4fe3a1d55dfb69f839c.tar.gz |
* image-type.c: Updated example to use scm_make_smob_type_mfpe,
SCM_RETURN_NEWSMOB, SCM_NEWSMOB function and macros.
-rw-r--r-- | doc/example-smob/image-type.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/doc/example-smob/image-type.c b/doc/example-smob/image-type.c index e3e222206..abf4fe570 100644 --- a/doc/example-smob/image-type.c +++ b/doc/example-smob/image-type.c @@ -40,7 +40,6 @@ static SCM make_image (SCM name, SCM s_width, SCM s_height) { struct image *image; - SCM image_smob; int width, height; SCM_ASSERT (SCM_NIMP (name) && SCM_STRINGP (name), name, @@ -58,11 +57,7 @@ make_image (SCM name, SCM s_width, SCM s_height) image->name = name; image->update_func = SCM_BOOL_F; - SCM_NEWCELL (image_smob); - SCM_SETCDR (image_smob, image); - SCM_SETCAR (image_smob, image_tag); - - return image_smob; + SCM_RETURN_NEWSMOB (image_tag, image); } static SCM @@ -127,7 +122,8 @@ static scm_smobfuns image_funs = { void init_image_type () { - image_tag = scm_newsmob (&image_funs); + image_tag = scm_make_smob_type_mfpe ("image", sizeof (struct image), + mark_image, free_image, print_image, NULL); scm_make_gsubr ("clear-image", 1, 0, 0, clear_image); scm_make_gsubr ("make-image", 3, 0, 0, make_image); |