1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00
freebsd-ports/lang/qscheme/files/patch-s.scm
Kirill Ponomarev a398059305 - Trim newlines at the end of patches
- portlint

PR:		ports/67805
Submitted by:	maintainer
2004-06-10 18:30:09 +00:00

30 lines
722 B
Scheme

--- s.scm.orig Thu Dec 6 04:56:07 2001
+++ s.scm Thu Dec 6 04:56:26 2001
@@ -252,7 +252,26 @@
(define hset! hash-set!)
; General purpose functions
-(load "sgtk/defextern.scm")
+;(load "sgtk/defextern.scm")
+
+(define *lib* "")
+
+(define-macro (extern type name . args)
+ `(make-extfunc *lib* ,type ,(symbol->string name) (quote ,@args)))
+
+; simplified exteral declarator:
+;
+; (define-extern :RETURN-TYPE CFUNC-NAME :ARG1 :ARG2... [. :ANY])
+;
+(define (cname->scheme x)
+ (string->symbol (string-translate (symbol->string x) "_" "-")))
+
+(define-macro (define-extern t n . a)
+; (write
+ `(define ,(cname->scheme n)
+ (make-extfunc *lib* ,t ,(symbol->string n) (quote ,a))))
+; )
+
;; (load "repl.scm")