Add FFI support for `short' and `unsigned short'.
authorLudovic Courtès <ludo@gnu.org>
Thu, 11 Nov 2010 15:26:50 +0000 (16:26 +0100)
committerLudovic Courtès <ludo@gnu.org>
Thu, 11 Nov 2010 15:41:15 +0000 (16:41 +0100)
commit42f7c01e0a1d1c139ec8b835429a80ab15ac4007
treea40821781a02c8cb5c1a23cc31f3e19f34faa6a8
parentfb636a1cce4444928ab313574fa150a06baae54b
Add FFI support for `short' and `unsigned short'.

* libguile/foreign.c (sym_short, sym_unsigned_short): New variables.
  (scm_init_foreign): Define Scheme variables SYM_SHORT and
  SYM_UNSIGNED_SHORT.

* module/system/foreign.scm (short, unsigned-short): New exports.
  (integer-ref, integer-set): Support (= (sizeof TYPE) 2).
  (%read-short, %write-short!, %read-unsigned-short,
  %write-unsigned-short!): New variables.
  (*writers*): Add support for `short' and `unsigned-short'.
  (*readers*): Likewise.

* test-suite/tests/foreign.test ("structs")["int8, pointer, short,
  double"]: New test.
libguile/foreign.c
module/system/foreign.scm
test-suite/tests/foreign.test