Index: sdl-csi.scm
===================================================================
--- sdl-csi.scm	(Revision 16082)
+++ sdl-csi.scm	(Arbeitskopie)
@@ -1,3 +1,5 @@
+(import foreign)
+
 (declare
  (foreign-declare "#include <SDL.h>\n")
  (run-time-macros)
@@ -6,7 +8,6 @@
 
 (require-extension posix)
 (require-extension sdl)
-(require-extension syntax-case)
 
 (handle-exceptions
     exn
Index: test-sdl.scm
===================================================================
--- test-sdl.scm	(Revision 16082)
+++ test-sdl.scm	(Arbeitskopie)
@@ -1,10 +1,10 @@
 (declare (foreign-declare "#include <SDL.h>\n"))
 (foreign-code "SDL_Init(SDL_INIT_EVERYTHING);")
 
-(require 'posix)
-(require 'sdl)
+(use posix)
+(use sdl)
+(sdl-init SDL_INIT_EVERYTHING)
+(include "test-sdl-body.scm")
 
-(load "test-sdl-body.scm")
-
 (sdl-quit)
 (exit 0)
Index: sdl.setup
===================================================================
--- sdl.setup	(Revision 16082)
+++ sdl.setup	(Arbeitskopie)
@@ -1,3 +1,9 @@
-(run (make extension))
-(install-extension 'sdl '("sdl.so") '((version "v0.4.51117.5")))
+(let ((sdl-cflags (with-input-from-pipe "sdl-config --cflags" read-line))
+      (sdl-lflags (string-append (with-input-from-pipe "sdl-config --libs" read-line) " -lSDL_gfx -lSDL_net -lSDL_ttf -lSDL_image")))
+   (compile -s -O2 sdl.scm -j sdl -lsdl ,sdl-cflags ,sdl-lflags)
+   (compile -c -O2 sdl.scm -unit sdl ,sdl-cflags ,sdl-lflags)
+   (compile -s -O2 sdl.import.scm ,sdl-cflags ,sdl-lflags)
+   (compile -O2 sdl-csi.scm ,sdl-cflags ,sdl-lflags))
+
+(install-extension 'sdl '("sdl.so" "sdl.import.so" "sdl.o") '((version "v0.4.51117.5")))
 (install-program 'sdl-csi '("sdl-csi"))
Index: sdl.scm
===================================================================
--- sdl.scm	(Revision 16082)
+++ sdl.scm	(Arbeitskopie)
@@ -1,4 +1,4 @@
-;;; sdl.scm - Simple SDL binding for Chicken
+;;;; sdl.scm - Simple SDL binding for Chicken
 ; Copyright (C) 2002-2004 Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
 ;
 ; This library is free software; you can redistribute it and/or modify
@@ -18,13 +18,353 @@
 
 ; ---------------------------------------------------------------------------
 
-(declare
- (usual-integrations)
+(module sdl
 
- ;; %%% export declaration should go here
+( *sdl-egg-version*
 
- (foreign-declare #<<EOF
+  SDL_BUTTON
+  ; sdl gfx
+  make-sdl-rect
+  sdl-rect?
+  sdl-rect-x
+  sdl-rect-y
+  sdl-rect-w
+  sdl-rect-h
+  make-sdl-pixel-format
+  sdl-pixel-format?
+  sdl-pixel-format-bytes-per-pixel
+  sdl-surface-flags
+  sdl-surface-pixel-format
+  sdl-surface-width
+  sdl-surface-height
+  sdl-surface-pitch
+  sdl-surface-pixels
+  sdl-surface-pixels-length
+  sdl-get-clip-rect!
+  sdl-set-clip-rect!
+  sdl-set-color-key!
+  sdl-set-alpha!
+  sdl-display-format
+  sdl-display-format-alpha
+  sdl-convert-surface
 
+  ; sdl system stuff
+  sdl-init
+  sdl-init-sub-system
+  sdl-quit-sub-system
+  sdl-quit
+  sdl-was-init
+  sdl-get-error
+  sdl-clear-error!
+  sdl-wm-set-caption
+  sdl-wm-get-caption-title
+  sdl-wm-get-caption-icon
+  sdl-wm-get-caption
+  sdl-wm-set-icon
+  sdl-wm-iconify-window
+  sdl-wm-toggle-full-screen
+  sdl-wm-grab-input
+  sdl-get-ticks
+  sdl-delay
+  timer?
+  get-time-of-day
+  get-time-of-day
+  sdl-add-relative-timer!
+  make-sdl-event
+  sdl-event?
+  sdl-event-type
+  sdl-pump-events
+  sdl-poll-event!
+  sdl-wait-event!*
+  sdl-wait-event!
+  sdl-push-event
+  sdl-event-state!
+  sdl-get-mouse-state
+  sdl-enable-unicode
+  sdl-get-video-surface
+  sdl-video-driver-name
+  sdl-set-video-mode
+  sdl-video-mode-ok
+  sdl-show-cursor
+  sdl-map-rgb
+  sdl-map-rgba
+  sdl-fill-rect
+  sdl-flip
+  sdl-surface?
+  sdl-create-rgb-surface
+  sdl-free-surface
+  sdl-blit-surface
+  sdl-with-clip-rect
+  make-sdl-color
+  sdl-color?
+  sdl-color-r
+  sdl-color-g
+  sdl-color-b
+
+  make-sdl-joystick
+  sdl-joystick?
+  sdl-joystick-event-state
+  sdl-joystick-update
+  sdl-num-joysticks
+  sdl-joystick-name
+  sdl-joystick-open
+  sdl-joystick-opened
+  sdl-joystick-index
+  sdl-joystick-num-axes
+  sdl-joystick-num-balls
+  sdl-joystick-num-hats
+  sdl-joystick-num-buttons
+  sdl-joystick-update
+  sdl-joystick-get-axis
+  sdl-joystick-get-hat
+  sdl-joystick-get-button
+  sdl-joystick-close
+  sdl-gl-swap-buffers
+  sdl-gl-set-attribute
+  sdl-gl-get-attribute
+
+  ; SDL ttf
+  ttf-init
+  ttf-was-init
+  ttf-quit
+  ttf-font?
+  ttf-font-pointer
+  ttf-open-font
+  ttf-open-font-index
+  ttf-close-font
+  ttf-get-font-style
+  ttf-set-font-style
+  ttf-font-height
+  ttf-font-ascent
+  ttf-font-descent
+  ttf-font-line-skip
+  ttf-font-faces
+  ttf-font-face-is-fixed-width?
+  ttf-font-face-family-name
+  ttf-font-face-style-name
+  ttf-size-text!
+  ttf-size-utf8!
+  ttf-render-text-solid
+  ttf-render-utf8-solid
+  ttf-render-text-shaded
+  ttf-render-utf8-shaded
+  ttf-render-text-blended
+  ttf-render-utf8-blended
+
+  ; SDL image
+  img-load
+  rotozoom-surface
+  zoom-surface
+
+  ;SDL net
+  make-sdl-ip-address
+  sdl-ip-address?
+  sdl-ip-address-a
+  sdl-ip-address-b
+  sdl-ip-address-c
+  sdl-ip-address-d
+  sdl-ip-address-port
+  sdl-net-init
+  sdl-net-quit
+  sdl-net-resolve-host!
+  sdl-net-resolve-ip
+  sdl-net-resolve-host
+  make-sdl-tcp-socket
+  sdl-tcp-socket?
+  sdl-net-tcp-open
+  sdl-net-tcp-accept
+  sdl-net-tcp-get-peer-address
+  sdl-net-tcp-send
+  sdl-net-tcp-recv
+  sdl-net-tcp-close
+  sdl-net-tcp-send-string
+  sdl-net-tcp-recv-string
+  sdl-net-tcp-add-socket!
+  sdl-net-tcp-del-socket!
+  sdl-net-check-sockets
+  sdl-net-socket-ready?
+  sdl-net-socket-set?
+  sdl-net-socket-set-pointer-set!
+  sdl-net-write-16
+  sdl-net-write-32
+  sdl-net-read-16
+  sdl-net-read-32
+
+  sdl-event?
+  sdl-event-gain
+  set-sdl-event-gain!
+  sdl-event-which
+  set-sdl-event-which!
+  sdl-event-state
+  set-sdl-event-state!
+  sdl-event-scancode
+  set-sdl-event-scancode!
+  sdl-event-sym
+  set-sdl-event-sym!
+  sdl-event-mod
+  set-sdl-event-mod!
+  sdl-event-unicode
+  set-sdl-event-unicode!
+  sdl-event-x
+  set-sdl-event-x!
+  sdl-event-y
+  set-sdl-event-y!
+  sdl-event-xrel
+  set-sdl-event-xrel!
+  sdl-event-yrel
+  set-sdl-event-yrel!
+  sdl-event-axis
+  set-sdl-event-axis!
+  sdl-event-ball
+  set-sdl-event-ball!
+  sdl-event-hat
+  set-sdl-event-hat!
+  sdl-event-value
+  set-sdl-event-value!
+  sdl-event-button
+  set-sdl-event-button!
+  sdl-event-w
+  set-sdl-event-w!
+  sdl-event-h
+  set-sdl-event-h!
+  sdl-event-buffer-set!
+  heap?
+  
+
+  ; constants
+
+  SDL_INIT_TIMER
+  SDL_INIT_AUDIO
+  SDL_INIT_VIDEO
+  SDL_INIT_CDROM
+  SDL_INIT_JOYSTICK
+  SDL_INIT_EVERYTHING
+  SDL_INIT_NOPARACHUTE
+
+  ;; For sdl-creatergbsurface or sdl-setvideomode
+  SDL_SWSURFACE
+  SDL_HWSURFACE
+  SDL_ASYNCBLIT
+  ;; For sdl-setvideomode
+  SDL_ANYFORMAT
+  SDL_HWPALETTE
+  SDL_DOUBLEBUF
+  SDL_FULLSCREEN
+  SDL_OPENGL
+  SDL_OPENGLBLIT
+  SDL_RESIZABLE
+  SDL_NOFRAME
+  ;; Read-only - internal
+  SDL_HWACCEL
+  SDL_SRCCOLORKEY
+  SDL_RLEACCELOK
+  SDL_RLEACCEL
+  SDL_SRCALPHA
+  SDL_PREALLOC
+					; For sdl-wm-grabinput
+  SDL_GRAB_QUERY
+  SDL_GRAB_OFF
+  SDL_GRAB_ON
+
+
+  SDL_NOEVENT			; Unused (do not remove)
+  SDL_ACTIVEEVENT		; Application loses/gains visibility
+  SDL_KEYDOWN			; Keys pressed
+  SDL_KEYUP			; Keys released
+  SDL_MOUSEMOTION		; Mouse moved
+  SDL_MOUSEBUTTONDOWN		; Mouse button pressed
+  SDL_MOUSEBUTTONUP		; Mouse button released
+  SDL_JOYAXISMOTION		; Joystick axis motion
+  SDL_JOYBALLMOTION		; Joystick trackball motion
+  SDL_JOYHATMOTION		; Joystick hat position change
+  SDL_JOYBUTTONDOWN		; Joystick button pressed
+  SDL_JOYBUTTONUP		; Joystick button released
+  SDL_QUIT			; User-requested quit
+  SDL_SYSWMEVENT		; System specific event
+  SDL_EVENT_RESERVEDA		; Reserved for future use..
+  SDL_EVENT_RESERVEDB		; Reserved for future use..
+  SDL_VIDEORESIZE		; User resized video mode
+  SDL_VIDEOEXPOSE		; Screen needs to be redrawn
+  SDL_EVENT_RESERVED2		; Reserved for future use..
+  SDL_EVENT_RESERVED3		; Reserved for future use..
+  SDL_EVENT_RESERVED4		; Reserved for future use..
+  SDL_EVENT_RESERVED5		; Reserved for future use..
+  SDL_EVENT_RESERVED6		; Reserved for future use..
+  SDL_EVENT_RESERVED7		; Reserved for future use..
+  SDL_USEREVENT			; SDL_USEREVENT .. SDL_NUMEVENTS are for client use
+  SDL_NUMEVENTS
+
+  SDL_ACTIVEEVENTMASK
+  SDL_KEYDOWNMASK
+  SDL_KEYUPMASK
+  SDL_MOUSEMOTIONMASK
+  SDL_MOUSEBUTTONDOWNMASK
+  SDL_MOUSEBUTTONUPMASK
+  SDL_MOUSEEVENTMASK
+  SDL_JOYAXISMOTIONMASK
+  SDL_JOYBALLMOTIONMASK
+  SDL_JOYHATMOTIONMASK
+  SDL_JOYBUTTONDOWNMASK
+  SDL_JOYBUTTONUPMASK
+  SDL_JOYEVENTMASK
+  SDL_VIDEORESIZEMASK
+  SDL_VIDEOEXPOSEMASK
+  SDL_QUITMASK
+  SDL_SYSWMEVENTMASK
+  SDL_ALLEVENTS
+					; General button/key states
+  SDL_PRESSED
+  SDL_RELEASED
+					; Mouse button states
+  SDL_BUTTON_LEFT
+  SDL_BUTTON_MIDDLE
+  SDL_BUTTON_RIGHT
+  SDL_BUTTON_WHEELUP
+  SDL_BUTTON_WHEELDOWN
+  SDL_BUTTON_LMASK ; = SDL_BUTTON(SDL_BUTTON_LEFT)
+  SDL_BUTTON_MMASK ; = SDL_BUTTON(SDL_BUTTON_MIDDLE)
+  SDL_BUTTON_RMASK ; = SDL_BUTTON(SDL_BUTTON_RIGHT)
+  SDL_QUERY
+  SDL_IGNORE
+  SDL_DISABLE
+  SDL_ENABLE
+
+  SDL_GL_RED_SIZE
+  SDL_GL_GREEN_SIZE
+  SDL_GL_BLUE_SIZE
+  SDL_GL_ALPHA_SIZE
+  SDL_GL_BUFFER_SIZE
+  SDL_GL_DOUBLEBUFFER
+  SDL_GL_DEPTH_SIZE
+  SDL_GL_STENCIL_SIZE
+  SDL_GL_ACCUM_RED_SIZE
+  SDL_GL_ACCUM_GREEN_SIZE
+  SDL_GL_ACCUM_BLUE_SIZE
+  SDL_GL_ACCUM_ALPHA_SIZE
+  SDL_GL_STEREO
+  SDL_GL_MULTISAMPLEBUFFERS
+  SDL_GL_MULTISAMPLESAMPLES
+  SDL_GL_SWAP_CONTROL
+  SDL_GL_ACCELERATED_VISUAL
+
+  TTF_STYLE_NORMAL
+  TTF_STYLE_BOLD
+  TTF_STYLE_ITALIC
+  TTF_STYLE_UNDERLINE
+
+)
+
+;---------------------------------------------------------------------------
+
+(import chicken scheme foreign)
+(use srfi-1)
+(use srfi-4)
+(use srfi-13)
+(use srfi-18)
+(use lolevel)
+
+(foreign-declare #<<EOF
+
 #ifdef _WIN32
 # if _MSC_VER > 1300
 #  include <winsock2.h>
@@ -47,12 +387,8 @@
 #include "SDL_net.h"
 
 EOF
-))
+)
 
-(use srfi-1)
-(use srfi-13)
-(use lolevel)
-  
 (include "heap.scm")
 (include "timer.scm")
 
@@ -66,14 +402,15 @@
 
 ;---------------------------------------------------------------------------
 
-(define-macro (--sdl-flags . strs)
-  `(begin
+(define-syntax --sdl-flags
+  (lambda (e r c)
+      `(,(r 'begin)
      ,@(append-map (lambda (str)
 		     (let* ((sym (string->symbol str))
-			    (psym (string->symbol (string-append "-" (symbol->string sym)))))
-		       `((define-foreign-variable ,psym unsigned-integer ,str)
-			 (define ,sym ,psym))))
-		   strs)))
+                            (psym (string->symbol (string-append "-" str))))
+		       `((,(r 'define-foreign-variable) ,psym unsigned-integer ,str)
+                         (,(r 'define) ,sym ,psym))))
+		   (cdr e)))))
 
 ; Subsystem definitions, for sdl-init etc.
 (--sdl-flags "SDL_INIT_TIMER"
@@ -202,7 +539,7 @@
 (let ((maker make-sdl-rect))
   (set! make-sdl-rect
 	(lambda (x y w h)
-	  (let ((r (maker (make-byte-vector sizeof-sdl-rect))))
+	  (let ((r (maker (make-blob sizeof-sdl-rect))))
 	    (sdl-rect-x-set! r x)
 	    (sdl-rect-y-set! r y)
 	    (sdl-rect-w-set! r w)
@@ -365,11 +702,11 @@
 		    "return(i);")))
 
 (define (sdl-wm-get-caption)
-  (values (sdl-wm-getcaption-title)
-	  (sdl-wm-getcaption-icon)))
+  (values (sdl-wm-get-caption-title)
+	  (sdl-wm-get-caption-icon)))
 
 (define (sdl-wm-set-icon icon mask)
-  ((foreign-lambda void "SDL_WM_SetIcon" SDL_Surface byte-vector) icon mask))
+  ((foreign-lambda void "SDL_WM_SetIcon" SDL_Surface blob) icon mask))
 
 (define (sdl-wm-iconify-window)
   (not (zero? ((foreign-lambda integer "SDL_WM_IconifyWindow")))))
@@ -412,9 +749,9 @@
 (let ((maker make-sdl-event))
   (set! make-sdl-event
 	(lambda ()
-	  (let ((bv (make-byte-vector sizeof-sdl-event)))
-	    (byte-vector-set! bv 0 SDL_NOEVENT)
-	    (maker bv)))))
+	  (let ((bv (blob->u8vector (make-blob sizeof-sdl-event))))
+	    (u8vector-set! bv 0 SDL_NOEVENT)
+	    (maker (u8vector->blob bv))))))
 
 (define-record-printer (sdl-event s out)
   (for-each (lambda (x) (display x out))
@@ -431,41 +768,44 @@
 (define sdl-event-type (foreign-lambda* unsigned-byte ((SDL_Event e)) "return(e->type);"))
 (define sdl-event-type-set! (foreign-lambda* void ((SDL_Event e) (unsigned-byte t)) "e->type = t;"))
 
-(define-macro (--sdl-event-getter-setter name . rest)
-  (let* ((strapp (lambda s (apply string-append
+(define-syntax --sdl-event-getter-setter
+  (lambda (f r c)
+    (let ((name (cadr f))
+          (rest (cddr f)))
+      (let* ((strapp (lambda s (apply string-append
 				  (map (lambda (x) (cond
 						    ((symbol? x) (symbol->string x))
 						    (else x)))
 				       s))))
 	 (symapp (lambda s (string->symbol (apply strapp s)))))
-  `(begin
-     (define (,(symapp "sdl-event-" name) e)
-       (let ((t (sdl-event-type e)))
-	 (cond
+  `(,(r 'begin)
+     (,(r 'define) (,(symapp "sdl-event-" name) e)
+       (,(r 'let) ((,(r 't) (,(r 'sdl-event-type) e)))
+	 (,(r 'cond)
 	  ,@(map (lambda (clause)
 		   (apply (lambda (etype mem1 kind)
-			    `((= t ,etype) ((foreign-lambda*
+			    `((,(r '=) ,(r 't) ,etype) ((,(r 'foreign-lambda*)
 					     ,kind ((SDL_Event e))
 					     ,(strapp "return(e->"mem1"."name");")) e)))
 			  clause))
 		 rest)
-	  (else (error ,(string-append "sdl-event-" (symbol->string name)
+	  (,(r 'else) (,(r 'error) ,(string-append "sdl-event-" (symbol->string name)
 				       ": cannot extract value from this type of event")
-		       (sdl-event-type e))))))
-     (define (,(symapp "set-sdl-event-" name "!") e v)
-       (let ((t (sdl-event-type e)))
-	 (cond
+		       (,(r 'sdl-event-type) e))))))
+     (,(r 'define) (,(symapp "set-sdl-event-" name "!") e v)
+       (,(r 'let) ((t (,(r 'sdl-event-type) e)))
+	 (,(r 'cond)
 	  ,@(map (lambda (clause)
 		   (apply (lambda (etype mem1 kind)
-			    `((= t ,etype) ((foreign-lambda*
+			    `((,(r '=) t ,etype) ((,(r 'foreign-lambda*)
 					     void ((SDL_Event e)
 						   (,kind v))
 					     ,(strapp "e->"mem1"."name"=v;")) e v)))
 			  clause))
 		 rest)
-	  (else (error ,(string-append "set-sdl-event-" (symbol->string name) "!"
+	  (,(r 'else) (,(r 'error) ,(string-append "set-sdl-event-" (symbol->string name) "!"
 				       ": cannot update value for this type of event")
-		       (sdl-event-type e)))))))))
+		       (,(r 'sdl-event-type) e)))))))))))
 
 (--sdl-event-getter-setter gain		(SDL_ACTIVEEVENT active bool))
 (--sdl-event-getter-setter which	(SDL_KEYDOWN key unsigned-byte)
@@ -584,11 +924,11 @@
 (define sdl-get-video-surface (foreign-lambda SDL_Surface "SDL_GetVideoSurface"))
 
 (define (sdl-video-driver-name)
-  (let ((bv (make-byte-vector 128 0)))
-    (and ((foreign-lambda bool "SDL_VideoDriverName" byte-vector integer)
+  (let ((bv (make-blob 128 0)))
+    (and ((foreign-lambda bool "SDL_VideoDriverName" blob integer)
 	  bv
-	  (byte-vector-length bv))
-	 (string-trim-right (byte-vector->string bv)
+	  (blob-size bv))
+	 (string-trim-right (blob->string bv)
 			    (integer->char 0)))))
 
 (define sdl-set-video-mode (foreign-lambda SDL_Surface "SDL_SetVideoMode"
@@ -674,7 +1014,7 @@
 (let ((maker make-sdl-color))
   (set! make-sdl-color
 	(lambda (r g b)
-	  (let ((bv (make-byte-vector sizeof-sdl-color)))
+	  (let ((bv (make-blob sizeof-sdl-color)))
 	    (fill-sdl-color! (maker bv) r g b)))))
 
 (define-record-printer (sdl-color s out)
@@ -889,9 +1229,9 @@
 (let ((maker make-sdl-ip-address))
   (set! make-sdl-ip-address
 	(lambda (a b c d p)
-	  (let* ((bv (make-byte-vector sizeof-sdl-ip-address))
+	  (let* ((bv (make-blob sizeof-sdl-ip-address))
 		 (addr (maker bv)))
-	    ((foreign-lambda* void ((byte-vector bv)
+	    ((foreign-lambda* void ((blob bv)
 				    (unsigned-integer host)
 				    (unsigned-short port))
 			      "IPaddress *ipa = (IPaddress *) bv;"
@@ -998,10 +1338,10 @@
 	#f)))
 
 (define (sdl-net-tcp-send sock bv)
-  ((foreign-lambda int "SDLNet_TCP_Send" TCPsocket byte-vector integer)
-   sock bv (byte-vector-length bv)))
+  ((foreign-lambda int "SDLNet_TCP_Send" TCPsocket blob integer)
+   sock bv (blob-size bv)))
 
-(define sdl-net-tcp-recv (foreign-lambda int "SDLNet_TCP_Recv" TCPsocket byte-vector integer))
+(define sdl-net-tcp-recv (foreign-lambda int "SDLNet_TCP_Recv" TCPsocket blob integer))
 
 (define (sdl-net-tcp-close sock)
   (if (sdl-tcp-socket-pointer sock)
@@ -1010,13 +1350,13 @@
 	(sdl-tcp-socket-pointer-set! sock #f))))
 
 (define (sdl-net-tcp-send-string sock str)
-  (sdl-net-tcp-send sock (string->byte-vector str)))
+  (sdl-net-tcp-send sock (string->blob str)))
 
 (define (sdl-net-tcp-recv-string sock buflen)
-  (let* ((bv (make-byte-vector buflen))
+  (let* ((bv (make-blob buflen))
 	 (result (sdl-net-tcp-recv sock bv buflen)))
     (if (positive? result)
-	(substring (byte-vector->string bv) 0 result)
+	(substring (blob->string bv) 0 result)
 	result)))
 
 ;---------------------------------------------------------------------------
@@ -1058,25 +1398,25 @@
 ;---------------------------------------------------------------------------
 
 (define sdl-net-write-16
-  (foreign-lambda* void ((byte-vector bv)
+  (foreign-lambda* void ((blob bv)
 			 (int offset)
 			 (unsigned-short value))
 		   "SDLNet_Write16(value, &bv[offset]);"))
 
 (define sdl-net-write-32
-  (foreign-lambda* void ((byte-vector bv)
+  (foreign-lambda* void ((blob bv)
 			 (int offset)
 			 (unsigned-integer value))
 		   "SDLNet_Write32(value, &bv[offset]);"))
 
 (define sdl-net-read-16
-  (foreign-lambda* unsigned-short ((byte-vector bv)
+  (foreign-lambda* unsigned-short ((blob bv)
 				   (int offset))
 		   "return(SDLNet_Read16(&bv[offset]));"))
 
 (define sdl-net-read-32
-  (foreign-lambda* unsigned-integer ((byte-vector bv)
+  (foreign-lambda* unsigned-integer ((blob bv)
 				     (int offset))
 		   "return(SDLNet_Read32(&bv[offset]));"))
 
-
+)
Index: test-net.scm
===================================================================
--- test-net.scm	(Revision 16082)
+++ test-net.scm	(Arbeitskopie)
@@ -1,4 +1,5 @@
-(require 'posix)
+(use posix)
+(use sdl)
 
 (sdl-net-init)
 
Index: sdl.meta
===================================================================
--- sdl.meta	(Revision 16082)
+++ sdl.meta	(Arbeitskopie)
@@ -4,7 +4,6 @@
  (author "Tony Garnock-Jones")
  (synopsis "Basic SDL support")
  (license "LGPL-2.1")
- (needs syntax-case)
  (doc-from-wiki)
  (egg "sdl.egg")
  (files "COPYING"
Index: test-heap.scm
===================================================================
--- test-heap.scm	(Revision 16082)
+++ test-heap.scm	(Arbeitskopie)
@@ -1,5 +1,6 @@
-(require 'srfi-1)
-(require 'heap)
+(use srfi-1)
+(use srfi-9)
+(use sdl)
 
 (define-values (s-heap-insert
 		s-heap-merge
Index: test-sdl-body.scm
===================================================================
--- test-sdl-body.scm	(Revision 16082)
+++ test-sdl-body.scm	(Arbeitskopie)
@@ -1,3 +1,4 @@
+(require-extension sdl)
 (define maxx 640)
 (define maxy 480)
 
@@ -3,8 +4,7 @@
 (if (< (length (argv)) 2)
     (begin (display "Usage: test-sdl path-to-ttf-font")
-	   (newline)
+           (newline)
 	   (exit 1)))
 (define fontname (cadr (argv)))
-
 (ttf-init)
 
