Node:C to Scheme, Next:, Up:Converting data between C and Scheme



19.8.1 C to Scheme

SCM gh_bool2scm (int x) Function
Returns #f if x is zero, #t otherwise.

SCM gh_ulong2scm (unsigned long x) Function
SCM gh_long2scm (long x) Function
SCM gh_double2scm (double x) Function
SCM gh_char2scm (char x) Function
Returns a Scheme object with the value of the C quantity x.

SCM gh_str2scm (char *s, int len) Function
Returns a new Scheme string with the (not necessarily null-terminated) C array s data.

SCM gh_str02scm (char *s) Function
Returns a new Scheme string with the null-terminated C string s data.

SCM gh_set_substr (char *src, SCM dst, int start, int len) Function
Copy len characters at src into the existing Scheme string dst, starting at start. start is an index into dst; zero means the beginning of the string.

If start + len is off the end of dst, signal an out-of-range error.

SCM gh_symbol2scm (char *name) Function
Given a null-terminated string name, return the symbol with that name.

SCM gh_ints2scm (int *dptr, int n) Function
SCM gh_doubles2scm (double *dptr, int n) Function
Make a scheme vector containing the n ints or doubles at memory location dptr.

SCM gh_chars2byvect (char *dptr, int n) Function
SCM gh_shorts2svect (short *dptr, int n) Function
SCM gh_longs2ivect (long *dptr, int n) Function
SCM gh_ulongs2uvect (ulong *dptr, int n) Function
SCM gh_floats2fvect (float *dptr, int n) Function
SCM gh_doubles2dvect (double *dptr, int n) Function
Make a scheme uniform vector containing the n chars, shorts, longs, unsigned longs, floats or doubles at memory location dptr.