Browse files

Initial directory structure and the all-important fd->port code.

  • Loading branch information...
1 parent 7671f71 commit deaf9c2cbfcb9456264806e782e9c999b43ec5a8 @KirinDave KirinDave committed Feb 28, 2008
Showing with 20 additions and 0 deletions.
  1. 0 bin/.placeholder
  2. +1 −0 lib/.gitignore
  3. +19 −0 src/erlenmeyer.scm
View
0 bin/.placeholder
No changes.
View
1 lib/.gitignore
@@ -0,0 +1 @@
+*
View
19 src/erlenmeyer.scm
@@ -0,0 +1,19 @@
+(module erlenmeyer mzscheme
+ (require (lib "foreign.ss")) (unsafe!)
+ (provide fd->input-port
+ fd->output-port)
+; The all-important fd->input port code thanks to Matthew Flatt
+ (define (fd->input-port fd name)
+ (scheme_make_fd_input_port fd name 0 0))
+
+ (define (fd->output-port fd name)
+ (scheme_make_fd_output_port fd name 0 0 0))
+
+ (define scheme_make_fd_input_port
+ (get-ffi-obj "scheme_make_fd_input_port" #f
+ (_fun _int _scheme _int _int -> _scheme)))
+
+ (define scheme_make_fd_output_port
+ (get-ffi-obj "scheme_make_fd_output_port"
+ #f
+ (_fun _int _scheme _int _int _int -> _scheme))))

0 comments on commit deaf9c2

Please sign in to comment.