diff options
author | Justus Winter <[email protected]> | 2016-03-31 11:49:56 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-06-17 09:38:00 +0000 |
commit | 56c36f2932fe2baf8e46efdea4315cf33f3c0338 (patch) | |
tree | 4d7bbf6ad0c7660c836b94aded9cc1af7e366a69 /tests/gpgscm/scheme-private.h | |
parent | tests/gpgscm: Dynamically allocate string buffer. (diff) | |
download | gnupg-56c36f2932fe2baf8e46efdea4315cf33f3c0338.tar.gz gnupg-56c36f2932fe2baf8e46efdea4315cf33f3c0338.zip |
tests/gpgscm: Foreign objects support for TinySCHEME.
* tests/gpgscm/scheme-private.h (struct cell): Add 'foreign_object'.
(is_foreign_object): New prototype.
(get_foreign_object_{vtable,data}): Likewise.
* tests/gpgscm/scheme.c (enum scheme_types): New type.
(is_foreign_object): New function.
(get_foreign_object_{vtable,data}): Likewise.
(mk_foreign_object): Likewise.
(finalize_cell): Free foreign objects.
(atom2str): Pretty-print foreign objects.
(vtbl): Add new functions.
* tests/gpgscm/scheme.h (struct foreign_object_vtable): New type.
(mk_foreign_object): New prototype.
(struct scheme_interface): Add new functions.
Patch from Thomas Munro,
https://sourceforge.net/p/tinyscheme/patches/13/
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgscm/scheme-private.h')
-rw-r--r-- | tests/gpgscm/scheme-private.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gpgscm/scheme-private.h b/tests/gpgscm/scheme-private.h index 0ddfdbcc5..9eafe766d 100644 --- a/tests/gpgscm/scheme-private.h +++ b/tests/gpgscm/scheme-private.h @@ -55,6 +55,10 @@ struct cell { struct cell *_car; struct cell *_cdr; } _cons; + struct { + char *_data; + const foreign_object_vtable *_vtable; + } _foreign_object; } _object; }; @@ -207,6 +211,10 @@ int is_environment(pointer p); int is_immutable(pointer p); void setimmutable(pointer p); +int is_foreign_object(pointer p); +const foreign_object_vtable *get_foreign_object_vtable(pointer p); +void *get_foreign_object_data(pointer p); + #ifdef __cplusplus } #endif |