;;; -*- Mode: Scheme; scheme48-package: (config) -*- ;;;; C Stub Generator for Scheme ;;;; Scheme48 Interface Definitions ;;; Copyright (c) 2009, Taylor R. Campbell ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; ;;; * Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in ;;; the documentation and/or other materials provided with the ;;; distribution. ;;; ;;; * Neither the names of the authors nor the names of contributors ;;; may be used to endorse or promote products derived from this ;;; software without specific prior written permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (define-interface stubber-syntax-interface (export (begin-c-stub :syntax) (c-alien :syntax) (c-alien-handle :syntax) (c-alien-pointer :syntax) (c-array-elements->list :syntax) (c-array-elements->vector :syntax) (c-array-pointers->list :syntax) (c-array-pointers->vector :syntax) (c-begin :syntax) (c-boolean :syntax) (c-char :syntax) (c-cond :syntax) (c-cons :syntax) (c-copied-asciz-string :syntax) (c-copied-asciz-utf-8-string :syntax) (c-copied-byte-vector :syntax) (c-copied&freed-asciz-string :syntax) (c-copied&freed-asciz-utf-8-string :syntax) (c-copied&freed-byte-vector :syntax) (c-declare :syntax) (c-false :syntax) (c-floating-point :syntax) (c-handle :syntax) (c-if :syntax) (c-immutable-asciz-string :syntax) (c-immutable-asciz-utf-8-string :syntax) (c-immutable-byte-vector :syntax) (c-include :syntax) (c-initialize :syntax) (c-integral :syntax) (c-if-false :syntax) (c-shared-asciz-string :syntax) (c-shared-asciz-utf-8-string :syntax) (c-shared-byte-vector :syntax) (c-signed :syntax) (c-system-include :syntax) (c-true :syntax) (c-unsigned :syntax) (c-unspecific :syntax) (c-vector :syntax) (c-void :syntax) (define-c :syntax) (define-c-alien-conversion :syntax) (define-c-integral-conversion :syntax) (define-c-procedure :syntax) (define-c-simple-conversion :syntax) (define-c-simple-expression :syntax) (define-c-simple-parameter :syntax) (define-c-unsigned-conversion :syntax) (define-c-variable :syntax) (define-c-wrapped-alien-parameter :syntax) (define-syntactic-invoker :syntax) ;++ This is a mistake. (end-c-stub :syntax) (process-command :syntax) (process-commands :syntax) (process-parameters :syntax) (process-parameter :syntax) (process-expression :syntax) (process-expressions :syntax) (process-result :syntax) (simple-expression :syntax) (simple-parameter :syntax) (syntactic-continue :syntax) ;??? (syntactic-map :syntax) )) (define-interface stubber-unix-syntax-interface (export (c-unix-syscall-failure :syntax) (define-unix-syscall :syntax) (define-unix-syscall-procedure :syntax) (define-unix-uint-syscall :syntax) (define-unix-uint-syscall* :syntax) (define-unix-void-syscall :syntax) ;; (define-unix-void-syscall* :syntax) )) (define-interface stubber-callback-syntax-interface (export (c-dynamic-callback :syntax) (c-global-callback :syntax) (c-local-callback :syntax) ;; (define-c-...-callback :syntax) ;++ Not sure what to call this. (define-c-callback :syntax) (define-c-global-callback :syntax) (define-c-with-callbacks :syntax) )) (define-interface stubber-enumerations-syntax-interface (export (define-c-constant-enumeration :syntax) )) (define-interface stubber-records-syntax-interface (export (define-c-record :syntax) )) (define-interface finalization-interface (export allocate-handle clean-the-finalizers finalizer? finalizer/add-handle! finalizer/add-object! finalizer/clean finalizer/clear! finalizer/find-object finalizer/remove-object! handle? handle.broken? handle.descriptor handle.object make-default-finalizer make-finalizer make-handle make-list-finalizer (with-finalized-objects :syntax) with-object-referenced )) (define-interface stubber-code-generation-interface (export ;; c-command/register-fd-read ;; c-command/register-fd-write ;; c-command/set-fd-handle c-expression/alien c-expression/alien-pointer c-expression/array-elements->list c-expression/array-elements->vector c-expression/array-pointers->list c-expression/array-pointers->vector c-expression/boolean c-expression/char c-expression/conditional c-expression/cons c-expression/constant-enumerand c-expression/constant-enumerand-available? c-expression/copied-asciz-string c-expression/copied-asciz-utf-8-string c-expression/copied-asciz-substring c-expression/copied-asciz-utf-8-substring c-expression/copied-byte-vector c-expression/copied&freed-byte-vector c-expression/copied&freed-asciz-string c-expression/copied&freed-asciz-utf-8-string c-expression/copied&freed-asciz-substring c-expression/copied&freed-asciz-utf-8-substring c-expression/false c-expression/floating-point c-expression/integral c-expression/null c-expression/out-of-memory-error c-expression/sequence c-expression/signed c-expression/true c-expression/unsigned c-expression/unspecific c-expression/vector c-parameter/alien c-parameter/alien-handle c-parameter/alien-pointer c-parameter/boolean c-parameter/char c-parameter/constant-enumerand c-parameter/copied-asciz-string c-parameter/copied-asciz-utf-8-string c-parameter/copied-byte-vector c-parameter/copied&freed-asciz-string c-parameter/copied&freed-asciz-utf-8-string c-parameter/copied&freed-byte-vector c-parameter/handle c-parameter/if-false c-parameter/floating-point c-parameter/immutable-asciz-string c-parameter/immutable-asciz-utf-8-string c-parameter/immutable-byte-vector c-parameter/integral c-parameter/scheme c-parameter/shared-asciz-string c-parameter/shared-asciz-utf-8-string c-parameter/shared-byte-vector c-parameter/signed c-parameter/unsigned c-stub.name c-stub-emit c-stub/constant-enumeration c-stub/declare c-stub/include c-stub/initialize c-stub/procedure c-stub/system-include c-stub/variable close-c-stub compile-c-stub link-c-stub mangle-name maybe-mangle-name open-c-stub stub-format:available-enumerand stub-format:conditional-enumerand stub-format:constant-enumerand stub-format:unavailable-enumerand ;; Callbacks c-parameter/local-callback c-parameter/dynamic-callback c-parameter/global-callback c-stub/callback c-stub/global-callback ;; Records c-expression/record c-parameter/record c-stub/record-type )) (define-interface stubber-unix-code-generation-interface (export c-command/unix-uint-syscall c-command/unix-void-syscall c-expression/unix-syscall-failure c-expression/unix-uint-syscall c-expression/unix-void-syscall )) ;; (define-interface stubber-callback-code-generation-interface ;; (export ;; c-parameter/local-callback ;; c-stub/local-callback ;; local-callback-name ;; )) ;; (define-interface stubber-record-code-generation-interface ;; (export ;; c-expression/record ;; c-parameter/record ;; c-stub/record-type ;; )) (define-interface stubber-c-format-interface (export c-format:address-of c-format:and c-format:and:list c-format:array c-format:array-ref c-format:assign c-format:assign-statement c-format:block c-format:block* c-format:call c-format:call-with-temporary-name c-format:call-statement c-format:cast c-format:comment c-format:const c-format:declaration c-format:declare c-format:declare:list c-format:dereference c-format:do/while c-format:else c-format:else-if c-format:field c-format:for c-format:function c-format:if c-format:initialize c-format:label c-format:not c-format:or c-format:or:list c-format:parameter c-format:parenthesis c-format:pointer-field c-format:pointer-type c-format:return c-format:statement c-format:static c-format:sizeof c-format:struct-pointer-type c-format:struct-type c-format:with-keyword c-format:while )) (define-interface stubber-cpp-format-interface (export cpp-format:and cpp-format:call cpp-format:call-prototype cpp-format:comment cpp-format:concatenate cpp-format:condition cpp-format:define cpp-format:defined? cpp-format:error cpp-format:elif cpp-format:else cpp-format:== cpp-format:ifdef cpp-format:if cpp-format:include cpp-format:line-prefix cpp-format:local-header cpp-format:nesting cpp-format:not cpp-format:or cpp-format:parenthesis cpp-format:stringify cpp-format:system-header cpp-format:with-backslash-line-breaks cpp-format:with-condition cpp-format:with-keyword cpp-format:with-nesting cpp-format:with-no-line-breaks )) (define-interface meta-names-interface (export (meta :syntax))) (define-interface syntactic-module-locals-interface (export (define-module-local :syntax) (module-local :syntax) (set-module-local! :syntax) ))