This implements miscellaneous functions and macros that make Chicken more compatible with Scheme->C. Some of this comes from from Jeff Siskind's QobiScheme. Much of this functionality is redundant with that offered by other Chicken eggs but is offered with a Scheme->C-compatible API and naming scheme.
- (eleventh x)
- (twelfth x)
- (lines string)
- (unlines l)
- (words string)
- (unwords l)
- (number-of-fields string)
- (field-ref string n)
- (fields string)
- (usleep microseconds)
- (directory-list d)
- (read-object-from-file pathname)
- (write-object-to-file object pathname)
- (read-text-file pathname)
- (write-text-file lines pathname)
- (fclose handle)
- (fopen filename mode)
- (fmemopen buffer size mode)
- popen
- pclose
- (strip-directory pathname)
- (has-extension? pathname)
- (extension pathname)
- (strip-extension pathname)
- (default-extension pathname extension)
- (replace-extension pathname extension)
- (has-directory? pathname)
- (get-directory pathname)
- (c-docolordither pic24 w h rdisp gdisp bdisp idisp maplen)
- (ylookupstring event . opt)
- (xallocnamedcolor3 dpy cmap colorname)
- (xquerypointer2 dpy w)
- getenv
- *tmp*
- (tmp pathname)
- (with-temporary-file prefix f)
- (bit-not n)
- (bit-and n)
- (bit-or n)
- (bit-lsh n offset)
- (bit-rsh n offset)
- c-sizeof-short
- c-sizeof-int
- c-sizeof-long
- c-sizeof-float
- c-sizeof-double
- c-sizeof-tscp
- c-sizeof-s2cuint
- c-sizeof-pointer
- (c-byte-ref ptr off)
- (c-byte-set! ptr off val)
- (c-double-ref ptr off)
- (c-double-set! ptr off val)
- (c-float-ref ptr off)
- (c-float-set! ptr off val)
- (c-int-ref ptr off)
- (c-int-set! ptr off val)
- (c-longint-ref ptr off)
- (c-longint-set! ptr off val)
- (c-longunsigned-ref ptr off)
- (c-longunsigned-set! ptr off val)
- (c-s2cuint-ref ptr off)
- (c-s2cuint-set! ptr off val)
- (c-shortint-ref ptr off)
- (c-shortint-set! ptr off val)
- (c-shortunsigned-ref ptr off)
- (c-shortunsigned-set! ptr off val)
- (c-unsigned-ref ptr off)
- (c-unsigned-set! ptr off val)
- (pointer-pointer-ref ptr-to-ptr)
- (pointer-pointer-set! ptr-to-ptr val)
- (c-string->string buf)
- (c-null-separated-strings->strings c-strings)
- (c-array->list array get-element element-size nr-elements)
- (c-array->vector array get-element element-size nr-elements)
- (c-exact-array->list array element-size nr-elements signed?)
- (c-exact-array->vector array element-size nr-elements signed?)
- (c-inexact-array->list array element-size nr-elements signed?)
- (c-inexact-array->vector array element-size nr-elements signed?)
- (list->c-array array l set-element element-size)
- (list->c-exact-array array l element-size signed?)
- (list->c-inexact-array array l element-size signed?)
- (vector->c-array array v set-element element-size)
- (vector->c-exact-array array v element-size signed?)
- (vector->c-inexact-array array v element-size signed?)
- (c-sized-int-ptr-ref size signed?)
- (c-sized-int-ptr-set! size signed?)
- (c-sized-inexact-ptr-ref size signed?)
- (c-sized-inexact-ptr-set! size signed?)
- (with-alloc x f)
- (with-buffer-stream f buffer size mode)
- (with-c-string str f)
- (with-file-stream f filename mode)
- (with-array elements element-size f)
- (with-c-pointers f v)
- (with-vector->c-array f set-element element-size v)
- (exact-round x)
- (exact-ceiling x)
- (exact-floor x)
- c-value
- c-sizeof
- c-function
- malloc
- memcpy
- bzero
- (unsigned-list->unsigneda l)
- (fuck-up)
- (panic format-string . &rest)
- (xor a b)
- *panic?*
- *program*
- (read-from-string string)
- flush-buffer
with-temporary-file is wrong! It ignores the prefix and more importantly its extension and will lead to breakage.
Copyright 1993-1995 University of Toronto. All rights reserved. Copyright 1996 Technion. All rights reserved. Copyright 1996 and 1997 University of Vermont. All rights reserved. Copyright 1997-2001 NEC Research Institute, Inc. All rights reserved. Copyright 2002-2012 Purdue University. All rights reserved.
Contact Andrei Barbu, andrei@0xab.com.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses.