From 6ce8eba9618001e4f8922f6d25cd345a2f7c25f8 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 21 Sep 2009 14:14:12 -0500 Subject: [PATCH] prettyprint CALLBACK: defs --- basis/alien/prettyprint/prettyprint.factor | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/basis/alien/prettyprint/prettyprint.factor b/basis/alien/prettyprint/prettyprint.factor index 69b9f37776..eea3515c8f 100644 --- a/basis/alien/prettyprint/prettyprint.factor +++ b/basis/alien/prettyprint/prettyprint.factor @@ -38,8 +38,8 @@ M: typedef-word synopsis* : pprint-function-arg ( type name -- ) [ pprint-c-type ] [ text ] bi* ; -: pprint-function-args ( word -- ) - [ def>> fourth ] [ stack-effect in>> ] bi zip [ ] [ +: pprint-function-args ( types names -- ) + zip [ ] [ unclip-last [ [ first2 "," append pprint-function-arg ] each ] dip first2 pprint-function-arg @@ -55,6 +55,29 @@ M: alien-function-word synopsis* [ definer. ] [ def>> first pprint-c-type ] [ pprint-word ] - [ ] + [ + > fourth ] [ stack-effect in>> ] bi + pprint-function-args + ")" text block> + ] } cleave ; +M: alien-callback-type-word definer + "callback-abi" word-prop "stdcall" = + \ STDCALL-CALLBACK: \ CALLBACK: ? + f ; +M: alien-callback-type-word definition drop f ; +M: alien-callback-type-word synopsis* + { + [ seeing-word ] + [ definer. ] + [ def>> first pprint-c-type ] + [ pprint-word ] + [ + > second ] [ "callback-effect" word-prop in>> ] bi + pprint-function-args + ")" text block> + ] + } cleave ;