X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fwrapped.h;fp=src%2Fwrapped.h;h=0000000000000000000000000000000000000000;hp=daaaa25404d07c95e32fd71f7e6d7a927e100353;hb=6343b5b67dfe68e1e7270ba6c100603f157d1b31;hpb=ba89d42068aa7ee7535946ff61d9bbebdb153f28 diff --git a/src/wrapped.h b/src/wrapped.h deleted file mode 100644 index daaaa25..0000000 --- a/src/wrapped.h +++ /dev/null @@ -1,77 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - This file is part of guile-irrlicht. - - guile-irrlicht is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the - License, or (at your option) any later version. - - guile-irrlicht is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with guile-irrlicht. If not, see - . -*/ - -#ifndef __GUILE_IRRLICHT_WRAPPED_H_INCLUDED__ -#define __GUILE_IRRLICHT_WRAPPED_H_INCLUDED__ - -#include - -#define DECLARE_WRAPPED_TYPE(TYPE, INIT, PRED, WRAP, UNWRAP) \ - void \ - INIT (void); \ - \ - SCM \ - WRAP (TYPE foreign_obj); \ - \ - TYPE \ - UNWRAP (SCM wrapped_obj); \ - \ - bool \ - PRED (SCM wrapped_obj); - - -#define DEFINE_WRAPPED_TYPE(TYPE, PRINT_NAME, INIT, PRED, WRAP, UNWRAP) \ - static SCM wrapped_##INIT; \ - \ - void \ - INIT (void) \ - { \ - SCM name, slots; \ - scm_t_struct_finalize finalizer; \ - \ - name = scm_from_utf8_symbol (PRINT_NAME); \ - slots = scm_list_1 (scm_from_utf8_symbol ("data")); \ - finalizer = NULL; \ - \ - wrapped_##INIT = \ - scm_make_foreign_object_type (name, slots, finalizer); \ - } \ - \ - SCM \ - WRAP (TYPE foreign_obj) \ - { \ - return scm_make_foreign_object_1 (wrapped_##INIT, foreign_obj); \ - } \ - \ - TYPE \ - UNWRAP (SCM wrapped_obj) \ - { \ - scm_assert_foreign_object_type (wrapped_##INIT, wrapped_obj); \ - return (TYPE)scm_foreign_object_ref (wrapped_obj, 0); \ - } \ - \ - bool \ - PRED (SCM wrapped_obj) \ - { \ - return SCM_IS_A_P (wrapped_obj, wrapped_##INIT); \ - } - -#endif