gpgscm: Use native string searching functions.
authorJustus Winter <justus@g10code.com>
Tue, 21 Jun 2016 10:12:56 +0000 (12:12 +0200)
committerJustus Winter <justus@g10code.com>
Tue, 21 Jun 2016 14:18:32 +0000 (16:18 +0200)
commit5fbbc4b334a73150e709a4802cac99abd8ada61d
tree9dd52ac294387f5a182669a491954c6e1c58aa3a
parentd99949fc8cf541018267964629992d55c97ca9ab
gpgscm: Use native string searching functions.

* tests/gpgscm/ffi-private.h: Handle character arguments.
* tests/gpgscm/ffi.c (do_string_index): New function.
(do_string_rindex): Likewise.
(do_string_contains): Likewise.
(ffi_init): Define new functions.
* tests/gpgscm/ffi.scm (ffi-define): New macro.
* tests/gpgscm/lib.scm (string-index): Use native function,
demonstrate behavior.
(string-rindex): Likewise.
(string-contains?): Likewise.
Demonstrate behavior of various other functions.
(read-all): Rework so that it can handle large files.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/ffi-private.h
tests/gpgscm/ffi.c
tests/gpgscm/ffi.scm
tests/gpgscm/lib.scm