aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/scheme.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-07-21gpgscm: Make error message more useful.Justus Winter1-1/+1
* tests/gpgscm/scheme.c (opexe_0): Include names of missing function parameters in the error message. Signed-off-by: Justus Winter <[email protected]>
2016-06-30gpgscm: Fix reallocating string ports.Justus Winter1-1/+2
* tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because Scheme strings may contain 0s. Signed-off-by: Justus Winter <[email protected]>
2016-06-30gpgscm: Free memory backing string ports.Justus Winter1-0/+2
* tests/gpgscm/scheme.c (finalize_cell): Free memory backing string ports. Signed-off-by: Justus Winter <[email protected]>
2016-06-28gpgscm: Free file names.Justus Winter1-0/+5
* tests/gpgscm/scheme.c (scheme_load_named_file): Free file name. Signed-off-by: Justus Winter <[email protected]>
2016-06-28gpgscm: Fix buffer overflow.Justus Winter1-1/+2
* tests/gpgscm/scheme.c (store_string): Avoid writing past allocated buffer. Signed-off-by: Justus Winter <[email protected]>
2016-06-23gpgscm: Add types for special objects.Justus Winter1-6/+14
* tests/gpgscm/scheme.c (enum scheme_types): Add types for boolean, nil, eof, and the sink object. (type_to_string): Handle new types. (scheme_init_custom_alloc): Give special objects a type. Signed-off-by: Justus Winter <[email protected]>
2016-06-23gpgscm: Fix Scheme initialization.Justus Winter1-0/+3
This potentially causes a crash if the garbage collector marks an eof object. * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize 'EOF_OBJ'. Signed-off-by: Justus Winter <[email protected]>
2016-06-21gpgscm: Improve error reporting.Justus Winter1-2/+27
* tests/gpgscm/scheme.c (type_to_string): New function. (Eval_Cycle): Include actual type in error message. Signed-off-by: Justus Winter <[email protected]>
2016-06-21gpgscm: Make memory allocation failures fatal.Justus Winter1-1/+1
* tests/gpgscm/scheme.c (Eval_Cycle): Exit if we run out of memory. Signed-off-by: Justus Winter <[email protected]>
2016-06-17gpgscm: Silence compiler warnings.Werner Koch1-7/+12
* tests/gpgscm/scheme.c (mk_integer): Rename arg NUM to N. (fill_vector): Ditto. (mark): Rename var NUM to N. (set_slot_in_env): Mark SC as unused. (is_any): Mark P as unused. -- Signed-off-by: Werner Koch <[email protected]>
2016-06-17tests/gpgscm: Foreign objects support for TinySCHEME.Justus Winter1-1/+27
* 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]>
2016-06-17tests/gpgscm: Dynamically allocate string buffer.Justus Winter1-2/+32
* tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic. * tests/gpgscm/scheme.c (expand_strbuff): New function. (putcharacter): Adapt length test. (readstrexp): Expand buffer if necessary. (scheme_init_custom_alloc): Initialize buffer. (scheme_deinit): Free buffer. Patch from Thomas Munro, https://sourceforge.net/p/tinyscheme/patches/11/ Signed-off-by: Justus Winter <[email protected]>
2016-06-17tests/gpgscm: Expose function to open streams as Scheme ports.Justus Winter1-1/+2
* tests/gpgscm/scheme.c (vtbl): Add 'port_from_file' to the vtable. * tests/gpgscm/scheme.h (struct scheme_interface): New field 'mk_port_from_file'. Signed-off-by: Justus Winter <[email protected]>
2016-06-17tests/gpgscm: Nicer error message.Justus Winter1-1/+1
* tests/gpgscm/scheme.c (opexe_0): Include the value that we tried to evaluate as function-like in the error message. Signed-off-by: Justus Winter <[email protected]>
2016-06-17tests/gpgscm: Handle unhandled enumeration values.Justus Winter1-0/+6
* tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration values in the opcode dispatching code. Signed-off-by: Justus Winter <[email protected]>
2016-06-17tests/gpgscm: Verbatim import of latest TinySCHEME.Justus Winter1-0/+5056
Revision 110 from svn://svn.code.sf.net/p/tinyscheme/code/trunk * tests/gpgscm/COPYING: New file. * tests/gpgscm/Manual.txt: Likewise. * tests/gpgscm/init.scm: Likewise. * tests/gpgscm/opdefines.h: Likewise. * tests/gpgscm/scheme-private.h: Likewise. * tests/gpgscm/scheme.c: Likewise. * tests/gpgscm/scheme.h: Likewise. Signed-off-by: Justus Winter <[email protected]>