~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/c-types-{proto,impl}.lisp: Add `:export' parameter to `defctype'.
[sod]
/
src
/
c-types-proto.lisp
diff --git
a/src/c-types-proto.lisp
b/src/c-types-proto.lisp
index
b9b61bf
..
55f2f31
100644
(file)
--- a/
src/c-types-proto.lisp
+++ b/
src/c-types-proto.lisp
@@
-7,7
+7,7
@@
;;;----- Licensing notice ---------------------------------------------------
;;;
;;;----- Licensing notice ---------------------------------------------------
;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sens
i
ble 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
;;;
;;; SOD is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@@
-181,7
+181,7
@@
,@doc
(destructuring-bind ,bvl ,tail
,@decls
,@doc
(destructuring-bind ,bvl ,tail
,@decls
-
,@body
))
+
(block ,name ,@body)
))
',name))))
(export 'c-type-alias)
',name))))
(export 'c-type-alias)
@@
-197,7
+197,7
@@
',aliases)))
(export 'defctype)
',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.
"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
@@
(namevar (gensym "NAME"))
(typevar (symbolicate 'c-type- (car names))))
`(progn
(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)
(defparameter ,typevar ,(expand-c-type-spec value))
(eval-when (:compile-toplevel :load-toplevel :execute)
,@(mapcar (lambda (name)
@@
-243,9
+245,9
@@
&aux (%type type)))
(:predicate argumentp))
"Simple structure representing a function argument."
&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)
(export 'commentify-argument-name)
(defgeneric commentify-argument-name (name)
@@
-253,7
+255,7
@@
"Produce a `commentified' version of the argument.
The default behaviour is that temporary argument names are simply omitted
"Produce a `commentified' version of the argument.
The default behaviour is that temporary argument names are simply omitted
- (
NIL
is returned); otherwise, `/*...*/' markers are wrapped around the
+ (
nil
is returned); otherwise, `/*...*/' markers are wrapped around the
printable representation of the argument.")
(:method ((name null)) nil)
(:method ((name t)) (format nil "/*~A*/" name)))
printable representation of the argument.")
(:method ((name null)) nil)
(:method ((name t)) (format nil "/*~A*/" name)))