chiark / gitweb /
src/: Abolish the special `va-*' instructions.
[sod] / src / c-types-proto.lisp
index 713496211a154010d3c24c3ecc04d299678c1881..55f2f3105953af203c3294cb0cd99c0e39d09cb7 100644 (file)
@@ -7,7 +7,7 @@
 
 ;;;----- Licensing notice ---------------------------------------------------
 ;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sensible Object Design, an object system for C.
 ;;;
 ;;; SOD is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -197,7 +197,7 @@ (defmacro c-type-alias (original &rest aliases)
        ',aliases)))
 
 (export 'defctype)
-(defmacro defctype (names value)
+(defmacro defctype (names value &key export)
   "Define NAMES all to describe the C-type VALUE.
 
    NAMES can be a symbol (treated as a singleton list), or a list of symbols.
@@ -207,6 +207,8 @@ (defmacro defctype (names value)
         (namevar (gensym "NAME"))
         (typevar (symbolicate 'c-type- (car names))))
     `(progn
+       ,@(and export
+             `((export '(,typevar ,@names))))
        (defparameter ,typevar ,(expand-c-type-spec value))
        (eval-when (:compile-toplevel :load-toplevel :execute)
         ,@(mapcar (lambda (name)
@@ -243,9 +245,9 @@ (defstruct (argument (:constructor make-argument (name type
                                                  &aux (%type type)))
                     (:predicate argumentp))
   "Simple structure representing a function argument."
-  name
-  %type)
-(define-access-wrapper argument-type argument-%type)
+  (name nil :type t :read-only t)
+  (%type nil :type c-type :read-only t))
+(define-access-wrapper argument-type argument-%type :read-only t)
 
 (export 'commentify-argument-name)
 (defgeneric commentify-argument-name (name)