Changed module technique from <module_name>- to <module_name>: which

conforms with chicken "egg" standard.  Got rid of ##csi#run for
relinking the Scheme interpreter as no longer needed.  Changed all
documentation to reflect both changes.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4411 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Jonah Beckford 2003-02-27 02:00:15 +00:00
commit cfe7be1eed
20 changed files with 681 additions and 682 deletions

View file

@ -154,9 +154,10 @@
<p> <p>
SWIG CHICKEN does not use the standard CHICKEN module system; SWIG CHICKEN does not use the standard CHICKEN module system
instead, it uses a prefix system. Specifying the module name as (which has been deprecated); instead, it uses a prefix system.
'example' in SWIG CHICKEN can be done using either of: Specifying the module name as 'example' in SWIG CHICKEN can be
done using either of:
<ul> <ul>
<li>Placing <tt>%module example</tt> in the SWIG interface <li>Placing <tt>%module example</tt> in the SWIG interface
file.</li> file.</li>
@ -171,7 +172,7 @@
Normally, for a C declaration <tt>Foo_Bar</tt> with a module Normally, for a C declaration <tt>Foo_Bar</tt> with a module
name of 'example', the corresponding CHICKEN identifier will be name of 'example', the corresponding CHICKEN identifier will be
<tt>example-foo-bar</tt>. <strong>The module name and a dash is <tt>example:foo-bar</tt>. <strong>The module name and a colon is
prefixed to the CHICKEN identifier</strong> (following normal prefixed to the CHICKEN identifier</strong> (following normal
naming conventions). naming conventions).
@ -319,7 +320,6 @@ CHICKEN_HOME=/usr/local/share/chicken</pre>
% cd /usr/local/share/chicken % cd /usr/local/share/chicken
% chicken /usr/local/share/chicken/src/csi.scm -optimize-level 3 -quiet \ % chicken /usr/local/share/chicken/src/csi.scm -optimize-level 3 -quiet \
-include-path /usr/local/share/chicken/src \ -include-path /usr/local/share/chicken/src \
-postlude "(##csi#run)" \
-prologue /usr/local/share/chicken/src/build.scm \ -prologue /usr/local/share/chicken/src/build.scm \
-prelude "(declare (uses posix precsi))" \ -prelude "(declare (uses posix precsi))" \
-output-file /home/jonah/examples/csi-example.c -output-file /home/jonah/examples/csi-example.c

View file

@ -18,20 +18,20 @@
(define nxpoints 60) (define nxpoints 60)
(define nypoints 60) (define nypoints 60)
(define cmap (gifplot-new-ColorMap "cmap")) (define cmap (gifplot:new-ColorMap "cmap"))
(define frame (gifplot-new-FrameBuffer 500 500)) (define frame (gifplot:new-FrameBuffer 500 500))
(gifplot-FrameBuffer-clear frame (gifplot-BLACK)) (gifplot:FrameBuffer-clear frame (gifplot:BLACK))
(define p3 (gifplot-new-Plot3D frame xmin ymin zmin xmax ymax zmax)) (define p3 (gifplot:new-Plot3D frame xmin ymin zmin xmax ymax zmax))
(gifplot-Plot3D-lookat p3 (* 2 (- zmax zmin))) (gifplot:Plot3D-lookat p3 (* 2 (- zmax zmin)))
(gifplot-Plot3D-autoperspective p3 40.0) (gifplot:Plot3D-autoperspective p3 40.0)
(gifplot-Plot3D-rotu p3 60.0) (gifplot:Plot3D-rotu p3 60.0)
(gifplot-Plot3D-rotr p3 30.0) (gifplot:Plot3D-rotr p3 30.0)
(gifplot-Plot3D-rotd p3 10.0) (gifplot:Plot3D-rotd p3 10.0)
(define (drawsolid) (define (drawsolid)
(gifplot-Plot3D-clear p3 (gifplot-BLACK)) (gifplot:Plot3D-clear p3 (gifplot:BLACK))
(gifplot-Plot3D-start p3) (gifplot:Plot3D-start p3)
(let ((dx (/ (- xmax xmin) nxpoints)) (let ((dx (/ (- xmax xmin) nxpoints))
(dy (/ (- ymax ymin) nypoints)) (dy (/ (- ymax ymin) nypoints))
(cscale (/ 240 (- zmax zmin)))) (cscale (/ 240 (- zmax zmin))))
@ -51,14 +51,14 @@
(c4 (* cscale (- z4 zmin))) (c4 (* cscale (- z4 zmin)))
(cc (/ (+ c1 c2 c3 c4) 4)) (cc (/ (+ c1 c2 c3 c4) 4))
(c (inexact->exact (round (max (min cc 239) 0))))) (c (inexact->exact (round (max (min cc 239) 0)))))
(gifplot-Plot3D-solidquad p3 x y z1 (+ x dx) y z2 (+ x dx) (+ y dy) (gifplot:Plot3D-solidquad p3 x y z1 (+ x dx) y z2 (+ x dx) (+ y dy)
z3 x (+ y dy) z4 z3 x (+ y dy) z4
(gifplot-int->Pixel (+ c 16)))) (gifplot:int->Pixel (+ c 16))))
(y-loop (+ y dy) (+ j 1))))) (y-loop (+ y dy) (+ j 1)))))
(x-loop (+ x dx) (+ i 1))))))) (x-loop (+ x dx) (+ i 1)))))))
(display "Making a nice 3D plot...\n") (display "Making a nice 3D plot...\n")
(drawsolid) (drawsolid)
(gifplot-FrameBuffer-writeGIF frame cmap "image.gif") (gifplot:FrameBuffer-writeGIF frame cmap "image.gif")
(display "Wrote image.gif\n") (display "Wrote image.gif\n")

View file

@ -2,26 +2,26 @@
(display "Drawing some basic shapes\n") (display "Drawing some basic shapes\n")
(define cmap (simple-new-ColorMap #f)) (define cmap (simple:new-ColorMap #f))
(define f (simple-new-FrameBuffer 400 400)) (define f (simple:new-FrameBuffer 400 400))
;; Clear the picture ;; Clear the picture
(simple-FrameBuffer-clear f (simple-BLACK)) (simple:FrameBuffer-clear f (simple:BLACK))
;; Make a red box ;; Make a red box
(simple-FrameBuffer-box f 40 40 200 200 (simple-RED)) (simple:FrameBuffer-box f 40 40 200 200 (simple:RED))
;; Make a blue circle ;; Make a blue circle
(simple-FrameBuffer-circle f 200 200 40 (simple-BLUE)) (simple:FrameBuffer-circle f 200 200 40 (simple:BLUE))
;; Make green line ;; Make green line
(simple-FrameBuffer-line f 10 390 390 200 (simple-GREEN)) (simple:FrameBuffer-line f 10 390 390 200 (simple:GREEN))
;; Write an image out to disk ;; Write an image out to disk
(simple-FrameBuffer-writeGIF f cmap "image.gif") (simple:FrameBuffer-writeGIF f cmap "image.gif")
(display "Wrote image.gif\n") (display "Wrote image.gif\n")
(simple-delete-FrameBuffer f) (simple:delete-FrameBuffer f)
(simple-delete-ColorMap cmap) (simple:delete-ColorMap cmap)

View file

@ -773,7 +773,6 @@ chicken_csi:
X=`pwd` && cd @CHICKENHOME@ && \ X=`pwd` && cd @CHICKENHOME@ && \
@CHICKEN@ @CHICKENHOME@/src/csi.scm $(CHICKENOPTS) \ @CHICKEN@ @CHICKENHOME@/src/csi.scm $(CHICKENOPTS) \
-include-path @CHICKENHOME@/src \ -include-path @CHICKENHOME@/src \
-postlude "(##csi#run)" \
-prologue @CHICKENHOME@/src/build.scm \ -prologue @CHICKENHOME@/src/build.scm \
-prelude "(declare (uses posix $(INTERFACE)))" \ -prelude "(declare (uses posix $(INTERFACE)))" \
-output-file $$X/$(TARGET) -output-file $$X/$(TARGET)

View file

@ -53,30 +53,30 @@ public:
(display "CHICKEN Low-Level Procedures\n") (display "CHICKEN Low-Level Procedures\n")
(display "----------------------------\n") (display "----------------------------\n")
(display " (display "
(define A-CIRCLE-SHAPE (example-new-Circle %radius)) (define A-CIRCLE-SHAPE (example:new-Circle %radius))
(example-Circle-area %circle) (example:Circle-area %circle)
(example-Circle-perimeter %circle) (example:Circle-perimeter %circle)
(example-delete-Circle %circle) (example:delete-Circle %circle)
(define A-SQUARE-SHAPE (example-new-Square %width)) (define A-SQUARE-SHAPE (example:new-Square %width))
(example-Square-area %square) (example:Square-area %square)
(example-Square-perimeter %square) (example:Square-perimeter %square)
(example-delete-Square %square) (example:delete-Square %square)
(example-delete-Shape %shape) (example:delete-Shape %shape)
(example-Shape-x-set %shape %x) (example:Shape-x-set %shape %x)
(example-Shape-x-get %shape) (example:Shape-x-get %shape)
(example-Shape-y-set %shape %y) (example:Shape-y-set %shape %y)
(example-Shape-y-get %shape) (example:Shape-y-get %shape)
(example-Shape-move %shape %dx %dy) (example:Shape-move %shape %dx %dy)
(example-Shape-area %shape) (example:Shape-area %shape)
(example-Shape-perimeter %shape) (example:Shape-perimeter %shape)
(example-Shape-nshapes) (example:Shape-nshapes)
(example-Shape-nshapes %nshapes-int) (example:Shape-nshapes %nshapes-int)
(example-Shape-First) (example:Shape-First)
(example-Shape-Second) (example:Shape-Second)
(example-Shape-Third) (example:Shape-Third)
(example-Shape-Last) (example:Shape-Last)
") ")
(display "\n") (display "\n")
@ -89,7 +89,7 @@ public:
;; After generic methods are defined, can include TinyCLOS code ;; After generic methods are defined, can include TinyCLOS code
(include \"example_clos\") (include \"example_clos\")
(define A-CIRCLE-SHAPE (make <example-Circle> %radius)) (define A-CIRCLE-SHAPE (make <example:Circle> %radius))
(-get-x- %shapeObject) (-get-x- %shapeObject)
(-set-x!- %shapeObject %x) (-set-x!- %shapeObject %x)
(-get-y- %shapeObject) (-get-y- %shapeObject)
@ -97,9 +97,9 @@ public:
(-move!- %shapeObject %dx %dy) (-move!- %shapeObject %dx %dy)
(-area- %shapeObject) (-area- %shapeObject)
(-perimeter- %shapeObject) (-perimeter- %shapeObject)
(+example-Shape-nshapes+) (+example:Shape-nshapes+)
(+example-Shape-nshapes+ %nshapes-int) (+example:Shape-nshapes+ %nshapes-int)
;; do not use (example-delete-Shape (slot-ref %shapeObject 'this)) ;; do not use (example:delete-Shape (slot-ref %shapeObject 'this))
;; as %shapeObject is always garbage-collected ;; as %shapeObject is always garbage-collected
") ")
(display "\n"))) (display "\n")))

View file

@ -4,11 +4,11 @@
;; ----- Object creation ----- ;; ----- Object creation -----
(display "Creating some objects:\n") (display "Creating some objects:\n")
(define c (example-new-Circle 10.0)) (define c (example:new-Circle 10.0))
(display " Created circle ") (display " Created circle ")
(display c) (display c)
(display "\n") (display "\n")
(define s (example-new-Square 10.0)) (define s (example:new-Square 10.0))
(display " Created square ") (display " Created square ")
(display s) (display s)
(display "\n") (display "\n")
@ -16,29 +16,29 @@
;; ----- Access a static member ----- ;; ----- Access a static member -----
(display "\nA total of ") (display "\nA total of ")
(display (example-Shape-nshapes)) (display (example:Shape-nshapes))
(display " shapes were created\n") (display " shapes were created\n")
;; ----- Member data access ----- ;; ----- Member data access -----
;; Set the location of the object ;; Set the location of the object
(example-Shape-x-set c 20.0) (example:Shape-x-set c 20.0)
(example-Shape-y-set c 30.0) (example:Shape-y-set c 30.0)
(example-Shape-x-set s -10.0) (example:Shape-x-set s -10.0)
(example-Shape-y-set s 5.0) (example:Shape-y-set s 5.0)
(display "\nHere is their current position:\n") (display "\nHere is their current position:\n")
(display " Circle = (") (display " Circle = (")
(display (example-Shape-x-get c)) (display (example:Shape-x-get c))
(display ", ") (display ", ")
(display (example-Shape-y-get c)) (display (example:Shape-y-get c))
(display ")\n") (display ")\n")
(display " Square = (") (display " Square = (")
(display (example-Shape-x-get s)) (display (example:Shape-x-get s))
(display ", ") (display ", ")
(display (example-Shape-y-get s)) (display (example:Shape-y-get s))
(display ")\n") (display ")\n")
;; ----- Call some methods ----- ;; ----- Call some methods -----
@ -50,10 +50,10 @@
(display o) (display o)
(display "\n") (display "\n")
(display " area = ") (display " area = ")
(display (example-Shape-area o)) (display (example:Shape-area o))
(display "\n") (display "\n")
(display " perimeter = ") (display " perimeter = ")
(display (example-Shape-perimeter o)) (display (example:Shape-perimeter o))
(display "\n")))) (display "\n"))))
(disp c) (disp c)
(disp s)) (disp s))
@ -61,10 +61,10 @@
(display "\nGuess I'll clean up now\n") (display "\nGuess I'll clean up now\n")
;; Note: this invokes the virtual destructor ;; Note: this invokes the virtual destructor
(example-delete-Shape c) (example:delete-Shape c)
(example-delete-Shape s) (example:delete-Shape s)
(set! s 3) (set! s 3)
(display (example-Shape-nshapes)) (display (example:Shape-nshapes))
(display " shapes remain\n") (display " shapes remain\n")
(display "Goodbye\n") (display "Goodbye\n")

View file

@ -10,11 +10,11 @@
;; ----- Object creation ----- ;; ----- Object creation -----
(display "Creating some objects:\n") (display "Creating some objects:\n")
(define c (make <example-Circle> 10.0)) (define c (make <example:Circle> 10.0))
(display " Created circle ") (display " Created circle ")
(display c) (display c)
(display "\n") (display "\n")
(define s (make <example-Square> 10.0)) (define s (make <example:Square> 10.0))
(display " Created square ") (display " Created square ")
(display s) (display s)
(display "\n") (display "\n")
@ -22,7 +22,7 @@
;; ----- Access a static member ----- ;; ----- Access a static member -----
(display "\nA total of ") (display "\nA total of ")
(display (+example-Shape-nshapes+)) (display (+example:Shape-nshapes+))
(display " shapes were created\n") (display " shapes were created\n")
;; ----- Member data access ----- ;; ----- Member data access -----
@ -71,6 +71,6 @@
(set! s 88) (set! s 88)
(gc #t) (gc #t)
(display (+example-Shape-nshapes+)) (display (+example:Shape-nshapes+))
(display " shapes remain\n") (display " shapes remain\n")
(display "Goodbye\n") (display "Goodbye\n")

View file

@ -28,15 +28,15 @@
(display "\n") (display "\n")
(display "Scheme Procedures:\n") (display "Scheme Procedures:\n")
(display " (example-ICONST)\n") (display " (example:ICONST)\n")
(display " (example-FCONST)\n") (display " (example:FCONST)\n")
(display " (example-CCONST)\n") (display " (example:CCONST)\n")
(display " (example-CCONST2)\n") (display " (example:CCONST2)\n")
(display " (example-SCONST)\n") (display " (example:SCONST)\n")
(display " (example-SCONST2)\n") (display " (example:SCONST2)\n")
(display " (example-EXPR)\n") (display " (example:EXPR)\n")
(display " (example-EXTERN)\n") (display " (example:EXTERN)\n")
(display " (example-FOO)\n") (display " (example:FOO)\n")
(display " (example-iconstX)\n") (display " (example:iconstX)\n")
(display " (example-fconstX)\n") (display " (example:fconstX)\n")
(display "\n") (display "\n")

View file

@ -2,14 +2,14 @@
;; feel free to uncomment and comment sections ;; feel free to uncomment and comment sections
(display "starting test ... you will see 'finished' if successful.\n") (display "starting test ... you will see 'finished' if successful.\n")
(or (= (example-ICONST) 42) (exit 1)) (or (= (example:ICONST) 42) (exit 1))
(or (< (abs (- (example-FCONST) 2.1828)) 0.00001) (exit 1)) (or (< (abs (- (example:FCONST) 2.1828)) 0.00001) (exit 1))
(or (char=? (example-CCONST) #\x) (exit 1)) (or (char=? (example:CCONST) #\x) (exit 1))
(or (char=? (example-CCONST2) #\newline) (exit 1)) (or (char=? (example:CCONST2) #\newline) (exit 1))
(or (string=? (example-SCONST) "Hello World") (exit 1)) (or (string=? (example:SCONST) "Hello World") (exit 1))
(or (string=? (example-SCONST2) "\"Hello World\"") (exit 1)) (or (string=? (example:SCONST2) "\"Hello World\"") (exit 1))
(or (< (abs (- (example-EXPR) (+ (example-ICONST) (* 3 (example-FCONST))))) 0.00001) (exit 1)) (or (< (abs (- (example:EXPR) (+ (example:ICONST) (* 3 (example:FCONST))))) 0.00001) (exit 1))
(or (= (example-iconstX) 37) (exit 1)) (or (= (example:iconstX) 37) (exit 1))
(or (< (abs (- (example-fconstX) 3.14)) 0.00001) (exit 1)) (or (< (abs (- (example:fconstX) 3.14)) 0.00001) (exit 1))
(display "finished test.\n") (display "finished test.\n")
(exit 0) (exit 0)

View file

@ -16,9 +16,9 @@
(display "\n") (display "\n")
(display "Scheme Procedures:\n") (display "Scheme Procedures:\n")
(display " (example-gcd %n %m)\n") (display " (example:gcd %n %m)\n")
(display " (example-gcdmain '(%string %string ...))\n") (display " (example:gcdmain '(%string %string ...))\n")
(display " (example-count %string %character)\n") (display " (example:count %string %character)\n")
(display " (example-capitalize %string)\n") (display " (example:capitalize %string)\n")
(display " (example-circle %x %y)\n") (display " (example:circle %x %y)\n")
(display "\n") (display "\n")

View file

@ -1,54 +1,54 @@
;; run with './multimap test-multimap.scm' ;; run with './multimap test-multimap.scm'
;; feel free to uncomment and comment sections ;; feel free to uncomment and comment sections
(display "(example-gcd 90 12): ") (display "(example:gcd 90 12): ")
(display (example-gcd 90 12)) (display (example:gcd 90 12))
(display "\n") (display "\n")
(display "(example-gcd 90 'a): ") (display "(example:gcd 90 'a): ")
;;(display (example-gcd 90 'a)) ;;(display (example:gcd 90 'a))
(display "\n") (display "\n")
(display "(example-gcd 'b 12): ") (display "(example:gcd 'b 12): ")
;;(display (example-gcd 'b 12)) ;;(display (example:gcd 'b 12))
(display "\n") (display "\n")
(display "(example-circle 0.5 0.5): ") (display "(example:circle 0.5 0.5): ")
(example-circle 0.5 0.5) (example:circle 0.5 0.5)
(display "\n") (display "\n")
(display "(example-circle 1.0 1.0): ") (display "(example:circle 1.0 1.0): ")
;;(example-circle 1.0 1.0) ;;(example:circle 1.0 1.0)
(display "\n") (display "\n")
(display "(example-circle 1 1): ") (display "(example:circle 1 1): ")
;;(example-circle 1 1) ;;(example:circle 1 1)
(display "\n") (display "\n")
(display "(example-capitalize \"will this be all capital letters?\"): ") (display "(example:capitalize \"will this be all capital letters?\"): ")
(display (example-capitalize "will this be all capital letters?")) (display (example:capitalize "will this be all capital letters?"))
(display "\n") (display "\n")
(display "(example-capitalize 'a): ") (display "(example:capitalize 'a): ")
;;(display (example-capitalize 'a)) ;;(display (example:capitalize 'a))
(display "\n") (display "\n")
(display "(example-count \"jumpity little spider\" #\\t): ") (display "(example:count \"jumpity little spider\" #\\t): ")
(display (example-count "jumpity little spider" #\t)) (display (example:count "jumpity little spider" #\t))
(display "\n") (display "\n")
(display "(example-gcdmain '#(\"hi\" \"there\")): ") (display "(example:gcdmain '#(\"hi\" \"there\")): ")
(display (example-gcdmain '#("hi" "there"))) (display (example:gcdmain '#("hi" "there")))
(display "\n") (display "\n")
(display "(example-gcdmain '#(\"gcd\" \"9\" \"28\")): ") (display "(example:gcdmain '#(\"gcd\" \"9\" \"28\")): ")
(example-gcdmain '#("gcd" "9" "28")) (example:gcdmain '#("gcd" "9" "28"))
(display "\n") (display "\n")
(display "(example-gcdmain '#(\"gcd\" \"12\" \"90\")): ") (display "(example:gcdmain '#(\"gcd\" \"12\" \"90\")): ")
(example-gcdmain '#("gcd" "12" "90")) (example:gcdmain '#("gcd" "12" "90"))
(display "\n") (display "\n")
(display "(example-squarecubed 3: ") (display "(example:squarecubed 3: ")
(display (example-squarecubed 3)) (display (example:squarecubed 3))
(display "\n") (display "\n")

View file

@ -29,12 +29,12 @@ class Foo {
(display "CHICKEN Low-Level Procedures\n") (display "CHICKEN Low-Level Procedures\n")
(display "----------------------------\n") (display "----------------------------\n")
(display " (display "
(example-foo %x-int) (example:foo %x-int)
(example-foo %x-string) (example:foo %x-string)
(define A-FOO (example-new-Foo)) (define A-FOO (example:new-Foo))
(define ANOTHER-FOO (example-new-Foo %foo)) ;; copy constructor (define ANOTHER-FOO (example:new-Foo %foo)) ;; copy constructor
(example-Foo-bar %foo %x-int) (example:Foo-bar %foo %x-int)
(example-Foo-bar %foo %s-string %y-int) (example:Foo-bar %foo %s-string %y-int)
") ")
(display "\n") (display "\n")
@ -47,10 +47,10 @@ class Foo {
;; After generic methods are defined, can include TinyCLOS code ;; After generic methods are defined, can include TinyCLOS code
(include \"example_clos\") (include \"example_clos\")
(+example-foo+ %x-int) (+example:foo+ %x-int)
(+example-foo+ %x-string) (+example:foo+ %x-string)
(define A-FOO (make <example-Foo>)) (define A-FOO (make <example:Foo>))
(define ANOTHER-FOO (make <example-Foo> %fooObject)) ;; copy constructor (define ANOTHER-FOO (make <example:Foo> %fooObject)) ;; copy constructor
(-bar- %fooObject %x-int) (-bar- %fooObject %x-int)
(-bar- %fooObject %s-string %y-int) (-bar- %fooObject %s-string %y-int)
") ")

View file

@ -5,30 +5,30 @@
(display " (display "
Trying low level code ... Trying low level code ...
(example-foo 1) (example:foo 1)
(example-foo \"some string\") (example:foo \"some string\")
(define A-FOO (example-new-Foo)) (define A-FOO (example:new-Foo))
(define ANOTHER-FOO (example-new-Foo A-FOO)) ;; copy constructor (define ANOTHER-FOO (example:new-Foo A-FOO)) ;; copy constructor
(example-Foo-bar A-FOO 2) (example:Foo-bar A-FOO 2)
(example-Foo-bar ANOTHER-FOO \"another string\" 3) (example:Foo-bar ANOTHER-FOO \"another string\" 3)
") ")
(example-foo 1) (example:foo 1)
(example-foo "some string") (example:foo "some string")
(define A-FOO (example-new-Foo)) (define A-FOO (example:new-Foo))
(define ANOTHER-FOO (example-new-Foo A-FOO)) ;; copy constructor (define ANOTHER-FOO (example:new-Foo A-FOO)) ;; copy constructor
(example-Foo-bar A-FOO 2) (example:Foo-bar A-FOO 2)
(example-Foo-bar ANOTHER-FOO "another string" 3) (example:Foo-bar ANOTHER-FOO "another string" 3)
;; TinyCLOS ;; TinyCLOS
;; -------- ;; --------
(display " (display "
Trying TinyCLOS code ... Trying TinyCLOS code ...
(+example-foo+ 1) (+example:foo+ 1)
(+example-foo+ \"some string\") (+example:foo+ \"some string\")
(define A-FOO (make <example-Foo>)) (define A-FOO (make <example:Foo>))
(define ANOTHER-FOO (make <example-Foo> A-FOO)) ;; copy constructor (define ANOTHER-FOO (make <example:Foo> A-FOO)) ;; copy constructor
(-bar- A-FOO 2) (-bar- A-FOO 2)
(-bar- ANOTHER-FOO \"another string\" 3) (-bar- ANOTHER-FOO \"another string\" 3)
") ")
@ -38,9 +38,9 @@ Trying TinyCLOS code ...
;; After generic methods are defined, can include TinyCLOS code ;; After generic methods are defined, can include TinyCLOS code
(include "example_clos") (include "example_clos")
(+example-foo+ 1) (+example:foo+ 1)
(+example-foo+ "some string") (+example:foo+ "some string")
(define A-FOO (make <example-Foo>)) (define A-FOO (make <example:Foo>))
(define ANOTHER-FOO (make <example-Foo> A-FOO)) ;; copy constructor (define ANOTHER-FOO (make <example:Foo> A-FOO)) ;; copy constructor
(-bar- A-FOO 2) (-bar- A-FOO 2)
(-bar- ANOTHER-FOO "another string" 3) (-bar- ANOTHER-FOO "another string" 3)

View file

@ -17,9 +17,9 @@
(display "\n") (display "\n")
(display "Scheme Procedures:\n") (display "Scheme Procedures:\n")
(display " (example-My-variable) or (example-My-variable %x)\n"); (display " (example:My-variable) or (example:My-variable %x)\n");
(display " (example-fact %n)\n") (display " (example:fact %n)\n")
(display " (example-mod %n %m)\n") (display " (example:mod %n %m)\n")
(display " (example-my-mod %n %m)\n") (display " (example:my-mod %n %m)\n")
(display " (example-get-time)\n") (display " (example:get-time)\n")
(display "\n") (display "\n")

View file

@ -1,43 +1,43 @@
;; run with './simple test-simple.scm' ;; run with './simple test-simple.scm'
;; feel free to uncomment and comment sections ;; feel free to uncomment and comment sections
(display "(example-My-variable): ") (display "(example:My-variable): ")
(display (example-My-variable)) (display (example:My-variable))
(display "\n") (display "\n")
(display "(example-My-variable 3.141259): ") (display "(example:My-variable 3.141259): ")
(display (example-My-variable 3.141259)) (display (example:My-variable 3.141259))
(display "\n") (display "\n")
(display "(example-My-variable): ") (display "(example:My-variable): ")
(display (example-My-variable)) (display (example:My-variable))
(display "\n") (display "\n")
(display "(example-My-variable 'a): ") (display "(example:My-variable 'a): ")
;;(display (example-My-variable 'a)) ;;(display (example:My-variable 'a))
(display "\n") (display "\n")
(display "(example-My-variable 1.5 'b): ") (display "(example:My-variable 1.5 'b): ")
(display (example-My-variable 1.5 'b)) (display (example:My-variable 1.5 'b))
(display "\n") (display "\n")
(display "(example-fact 5): ") (display "(example:fact 5): ")
(display (example-fact 5)) (display (example:fact 5))
(display "\n") (display "\n")
(display "(example-fact 'a): ") (display "(example:fact 'a): ")
;;(display (example-fact 'a)) ;;(display (example:fact 'a))
(display "\n") (display "\n")
(display "(example-mod 75 7): ") (display "(example:mod 75 7): ")
(display (example-mod 75 7)) (display (example:mod 75 7))
(display "\n") (display "\n")
(display "(example-my-mod 75 7): ") (display "(example:my-mod 75 7): ")
(display (example-my-mod 75 7)) (display (example:my-mod 75 7))
(display "\n") (display "\n")
(display "(example-get-time): ") (display "(example:get-time): ")
(display (example-get-time)) (display (example:get-time))
(display "\n") (display "\n")

View file

@ -993,119 +993,119 @@
<pre> <pre>
% grep C_intern example_wrap.c % grep C_intern example_wrap.c
C_word err = C_intern2 (&amp;a, errorhook); C_word err = C_intern2 (&amp;a, errorhook);
sym = C_intern (&amp;a, 21, "example-max-mem-level"); sym = C_intern (&amp;a, 21, "example:max-mem-level");
sym = C_intern (&amp;a, 17, "example-max-wbits"); sym = C_intern (&amp;a, 17, "example:max-wbits");
sym = C_intern (&amp;a, 16, "example-seek-set"); sym = C_intern (&amp;a, 16, "example:seek-set");
sym = C_intern (&amp;a, 16, "example-seek-cur"); sym = C_intern (&amp;a, 16, "example:seek-cur");
sym = C_intern (&amp;a, 16, "example-seek-end"); sym = C_intern (&amp;a, 16, "example:seek-end");
sym = C_intern (&amp;a, 20, "example-zlib-version"); sym = C_intern (&amp;a, 20, "example:zlib-version");
sym = C_intern (&amp;a, 28, "example-z-stream-next-in-set"); sym = C_intern (&amp;a, 28, "example:z-stream-next-in-set");
sym = C_intern (&amp;a, 28, "example-z-stream-next-in-get"); sym = C_intern (&amp;a, 28, "example:z-stream-next-in-get");
sym = C_intern (&amp;a, 29, "example-z-stream-avail-in-set"); sym = C_intern (&amp;a, 29, "example:z-stream-avail-in-set");
sym = C_intern (&amp;a, 29, "example-z-stream-avail-in-get"); sym = C_intern (&amp;a, 29, "example:z-stream-avail-in-get");
sym = C_intern (&amp;a, 29, "example-z-stream-total-in-set"); sym = C_intern (&amp;a, 29, "example:z-stream-total-in-set");
sym = C_intern (&amp;a, 29, "example-z-stream-total-in-get"); sym = C_intern (&amp;a, 29, "example:z-stream-total-in-get");
sym = C_intern (&amp;a, 29, "example-z-stream-next-out-set"); sym = C_intern (&amp;a, 29, "example:z-stream-next-out-set");
sym = C_intern (&amp;a, 29, "example-z-stream-next-out-get"); sym = C_intern (&amp;a, 29, "example:z-stream-next-out-get");
sym = C_intern (&amp;a, 30, "example-z-stream-avail-out-set"); sym = C_intern (&amp;a, 30, "example:z-stream-avail-out-set");
sym = C_intern (&amp;a, 30, "example-z-stream-avail-out-get"); sym = C_intern (&amp;a, 30, "example:z-stream-avail-out-get");
sym = C_intern (&amp;a, 30, "example-z-stream-total-out-set"); sym = C_intern (&amp;a, 30, "example:z-stream-total-out-set");
sym = C_intern (&amp;a, 30, "example-z-stream-total-out-get"); sym = C_intern (&amp;a, 30, "example:z-stream-total-out-get");
sym = C_intern (&amp;a, 24, "example-z-stream-msg-set"); sym = C_intern (&amp;a, 24, "example:z-stream-msg-set");
sym = C_intern (&amp;a, 24, "example-z-stream-msg-get"); sym = C_intern (&amp;a, 24, "example:z-stream-msg-get");
sym = C_intern (&amp;a, 26, "example-z-stream-state-set"); sym = C_intern (&amp;a, 26, "example:z-stream-state-set");
sym = C_intern (&amp;a, 26, "example-z-stream-state-get"); sym = C_intern (&amp;a, 26, "example:z-stream-state-get");
sym = C_intern (&amp;a, 27, "example-z-stream-zalloc-set"); sym = C_intern (&amp;a, 27, "example:z-stream-zalloc-set");
sym = C_intern (&amp;a, 27, "example-z-stream-zalloc-get"); sym = C_intern (&amp;a, 27, "example:z-stream-zalloc-get");
sym = C_intern (&amp;a, 26, "example-z-stream-zfree-set"); sym = C_intern (&amp;a, 26, "example:z-stream-zfree-set");
sym = C_intern (&amp;a, 26, "example-z-stream-zfree-get"); sym = C_intern (&amp;a, 26, "example:z-stream-zfree-get");
sym = C_intern (&amp;a, 27, "example-z-stream-opaque-set"); sym = C_intern (&amp;a, 27, "example:z-stream-opaque-set");
sym = C_intern (&amp;a, 27, "example-z-stream-opaque-get"); sym = C_intern (&amp;a, 27, "example:z-stream-opaque-get");
sym = C_intern (&amp;a, 30, "example-z-stream-data-type-set"); sym = C_intern (&amp;a, 30, "example:z-stream-data-type-set");
sym = C_intern (&amp;a, 30, "example-z-stream-data-type-get"); sym = C_intern (&amp;a, 30, "example:z-stream-data-type-get");
sym = C_intern (&amp;a, 26, "example-z-stream-adler-set"); sym = C_intern (&amp;a, 26, "example:z-stream-adler-set");
sym = C_intern (&amp;a, 26, "example-z-stream-adler-get"); sym = C_intern (&amp;a, 26, "example:z-stream-adler-get");
sym = C_intern (&amp;a, 29, "example-z-stream-reserved-set"); sym = C_intern (&amp;a, 29, "example:z-stream-reserved-set");
sym = C_intern (&amp;a, 29, "example-z-stream-reserved-get"); sym = C_intern (&amp;a, 29, "example:z-stream-reserved-get");
sym = C_intern (&amp;a, 20, "example-new-z-stream"); sym = C_intern (&amp;a, 20, "example:new-z-stream");
sym = C_intern (&amp;a, 23, "example-delete-z-stream"); sym = C_intern (&amp;a, 23, "example:delete-z-stream");
sym = C_intern (&amp;a, 18, "example-z-no-flush"); sym = C_intern (&amp;a, 18, "example:z-no-flush");
sym = C_intern (&amp;a, 23, "example-z-partial-flush"); sym = C_intern (&amp;a, 23, "example:z-partial-flush");
sym = C_intern (&amp;a, 20, "example-z-sync-flush"); sym = C_intern (&amp;a, 20, "example:z-sync-flush");
sym = C_intern (&amp;a, 20, "example-z-full-flush"); sym = C_intern (&amp;a, 20, "example:z-full-flush");
sym = C_intern (&amp;a, 16, "example-z-finish"); sym = C_intern (&amp;a, 16, "example:z-finish");
sym = C_intern (&amp;a, 12, "example-z-ok"); sym = C_intern (&amp;a, 12, "example:z-ok");
sym = C_intern (&amp;a, 20, "example-z-stream-end"); sym = C_intern (&amp;a, 20, "example:z-stream-end");
sym = C_intern (&amp;a, 19, "example-z-need-dict"); sym = C_intern (&amp;a, 19, "example:z-need-dict");
sym = C_intern (&amp;a, 15, "example-z-errno"); sym = C_intern (&amp;a, 15, "example:z-errno");
sym = C_intern (&amp;a, 22, "example-z-stream-error"); sym = C_intern (&amp;a, 22, "example:z-stream-error");
sym = C_intern (&amp;a, 20, "example-z-data-error"); sym = C_intern (&amp;a, 20, "example:z-data-error");
sym = C_intern (&amp;a, 19, "example-z-mem-error"); sym = C_intern (&amp;a, 19, "example:z-mem-error");
sym = C_intern (&amp;a, 19, "example-z-buf-error"); sym = C_intern (&amp;a, 19, "example:z-buf-error");
sym = C_intern (&amp;a, 23, "example-z-version-error"); sym = C_intern (&amp;a, 23, "example:z-version-error");
sym = C_intern (&amp;a, 24, "example-z-no-compression"); sym = C_intern (&amp;a, 24, "example:z-no-compression");
sym = C_intern (&amp;a, 20, "example-z-best-speed"); sym = C_intern (&amp;a, 20, "example:z-best-speed");
sym = C_intern (&amp;a, 26, "example-z-best-compression"); sym = C_intern (&amp;a, 26, "example:z-best-compression");
sym = C_intern (&amp;a, 29, "example-z-default-compression"); sym = C_intern (&amp;a, 29, "example:z-default-compression");
sym = C_intern (&amp;a, 18, "example-z-filtered"); sym = C_intern (&amp;a, 18, "example:z-filtered");
sym = C_intern (&amp;a, 22, "example-z-huffman-only"); sym = C_intern (&amp;a, 22, "example:z-huffman-only");
sym = C_intern (&amp;a, 26, "example-z-default-strategy"); sym = C_intern (&amp;a, 26, "example:z-default-strategy");
sym = C_intern (&amp;a, 16, "example-z-binary"); sym = C_intern (&amp;a, 16, "example:z-binary");
sym = C_intern (&amp;a, 15, "example-z-ascii"); sym = C_intern (&amp;a, 15, "example:z-ascii");
sym = C_intern (&amp;a, 17, "example-z-unknown"); sym = C_intern (&amp;a, 17, "example:z-unknown");
sym = C_intern (&amp;a, 18, "example-z-deflated"); sym = C_intern (&amp;a, 18, "example:z-deflated");
sym = C_intern (&amp;a, 14, "example-z-null"); sym = C_intern (&amp;a, 14, "example:z-null");
sym = C_intern (&amp;a, 19, "example-zlibversion"); sym = C_intern (&amp;a, 19, "example:zlibversion");
sym = C_intern (&amp;a, 15, "example-deflate"); sym = C_intern (&amp;a, 15, "example:deflate");
sym = C_intern (&amp;a, 18, "example-deflateend"); sym = C_intern (&amp;a, 18, "example:deflateend");
sym = C_intern (&amp;a, 15, "example-inflate"); sym = C_intern (&amp;a, 15, "example:inflate");
sym = C_intern (&amp;a, 18, "example-inflateend"); sym = C_intern (&amp;a, 18, "example:inflateend");
sym = C_intern (&amp;a, 28, "example-deflatesetdictionary"); sym = C_intern (&amp;a, 28, "example:deflatesetdictionary");
sym = C_intern (&amp;a, 19, "example-deflatecopy"); sym = C_intern (&amp;a, 19, "example:deflatecopy");
sym = C_intern (&amp;a, 20, "example-deflatereset"); sym = C_intern (&amp;a, 20, "example:deflatereset");
sym = C_intern (&amp;a, 21, "example-deflateparams"); sym = C_intern (&amp;a, 21, "example:deflateparams");
sym = C_intern (&amp;a, 28, "example-inflatesetdictionary"); sym = C_intern (&amp;a, 28, "example:inflatesetdictionary");
sym = C_intern (&amp;a, 19, "example-inflatesync"); sym = C_intern (&amp;a, 19, "example:inflatesync");
sym = C_intern (&amp;a, 20, "example-inflatereset"); sym = C_intern (&amp;a, 20, "example:inflatereset");
sym = C_intern (&amp;a, 16, "example-compress"); sym = C_intern (&amp;a, 16, "example:compress");
sym = C_intern (&amp;a, 17, "example-compress2"); sym = C_intern (&amp;a, 17, "example:compress2");
sym = C_intern (&amp;a, 18, "example-uncompress"); sym = C_intern (&amp;a, 18, "example:uncompress");
sym = C_intern (&amp;a, 14, "example-gzopen"); sym = C_intern (&amp;a, 14, "example:gzopen");
sym = C_intern (&amp;a, 15, "example-gzdopen"); sym = C_intern (&amp;a, 15, "example:gzdopen");
sym = C_intern (&amp;a, 19, "example-gzsetparams"); sym = C_intern (&amp;a, 19, "example:gzsetparams");
sym = C_intern (&amp;a, 14, "example-gzread"); sym = C_intern (&amp;a, 14, "example:gzread");
sym = C_intern (&amp;a, 15, "example-gzwrite"); sym = C_intern (&amp;a, 15, "example:gzwrite");
sym = C_intern (&amp;a, 16, "example-gzprintf"); sym = C_intern (&amp;a, 16, "example:gzprintf");
sym = C_intern (&amp;a, 14, "example-gzputs"); sym = C_intern (&amp;a, 14, "example:gzputs");
sym = C_intern (&amp;a, 14, "example-gzgets"); sym = C_intern (&amp;a, 14, "example:gzgets");
sym = C_intern (&amp;a, 14, "example-gzputc"); sym = C_intern (&amp;a, 14, "example:gzputc");
sym = C_intern (&amp;a, 14, "example-gzgetc"); sym = C_intern (&amp;a, 14, "example:gzgetc");
sym = C_intern (&amp;a, 15, "example-gzflush"); sym = C_intern (&amp;a, 15, "example:gzflush");
sym = C_intern (&amp;a, 14, "example-gzseek"); sym = C_intern (&amp;a, 14, "example:gzseek");
sym = C_intern (&amp;a, 16, "example-gzrewind"); sym = C_intern (&amp;a, 16, "example:gzrewind");
sym = C_intern (&amp;a, 14, "example-gztell"); sym = C_intern (&amp;a, 14, "example:gztell");
sym = C_intern (&amp;a, 13, "example-gzeof"); sym = C_intern (&amp;a, 13, "example:gzeof");
sym = C_intern (&amp;a, 15, "example-gzclose"); sym = C_intern (&amp;a, 15, "example:gzclose");
sym = C_intern (&amp;a, 15, "example-gzerror"); sym = C_intern (&amp;a, 15, "example:gzerror");
sym = C_intern (&amp;a, 15, "example-adler32"); sym = C_intern (&amp;a, 15, "example:adler32");
sym = C_intern (&amp;a, 13, "example-crc32"); sym = C_intern (&amp;a, 13, "example:crc32");
sym = C_intern (&amp;a, 20, "example-deflateinit-"); sym = C_intern (&amp;a, 20, "example:deflateinit-");
sym = C_intern (&amp;a, 20, "example-inflateinit-"); sym = C_intern (&amp;a, 20, "example:inflateinit-");
sym = C_intern (&amp;a, 21, "example-deflateinit2-"); sym = C_intern (&amp;a, 21, "example:deflateinit2-");
sym = C_intern (&amp;a, 21, "example-inflateinit2-"); sym = C_intern (&amp;a, 21, "example:inflateinit2-");
sym = C_intern (&amp;a, 32, "example-internal-state-dummy-set"); sym = C_intern (&amp;a, 32, "example:internal-state-dummy-set");
sym = C_intern (&amp;a, 32, "example-internal-state-dummy-get"); sym = C_intern (&amp;a, 32, "example:internal-state-dummy-get");
sym = C_intern (&amp;a, 26, "example-new-internal-state"); sym = C_intern (&amp;a, 26, "example:new-internal-state");
sym = C_intern (&amp;a, 29, "example-delete-internal-state"); sym = C_intern (&amp;a, 29, "example:delete-internal-state");
sym = C_intern (&amp;a, 14, "example-zerror"); sym = C_intern (&amp;a, 14, "example:zerror");
sym = C_intern (&amp;a, 24, "example-inflatesyncpoint"); sym = C_intern (&amp;a, 24, "example:inflatesyncpoint");
sym = C_intern (&amp;a, 21, "example-get-crc-table"); sym = C_intern (&amp;a, 21, "example:get-crc-table");
</pre> </pre>
</blockquote> </blockquote>
In fact, we want the Scheme procedure names to begin with In fact, we want the Scheme procedure names to begin with
<code>zlib</code> instead of <code>example</code>. For <code>zlib</code> instead of <code>example</code>. For
<code>example-zlib-version</code>, we want <code>example:zlib-version</code>, we want
<code>zlib-version</code>. And we want dashes when the case <code>zlib-version</code>. And we want dashes when the case
switches to/from upper/lowercase; ex. the function switches to/from upper/lowercase; ex. the function
<code>deflateEnd()</code> should be the Scheme procedure <code>deflateEnd()</code> should be the Scheme procedure
@ -1142,119 +1142,119 @@
% swig -chicken <font color="red">-prefix zlib -mixed</font> -I/usr/include example.i % swig -chicken <font color="red">-prefix zlib -mixed</font> -I/usr/include example.i
% grep C_intern example_wrap.c % grep C_intern example_wrap.c
C_word err = C_intern2 (&amp;a, errorhook); C_word err = C_intern2 (&amp;a, errorhook);
sym = C_intern (&amp;a, 18, "zlib-max-mem-level"); sym = C_intern (&amp;a, 18, "zlib:max-mem-level");
sym = C_intern (&amp;a, 14, "zlib-max-wbits"); sym = C_intern (&amp;a, 14, "zlib:max-wbits");
sym = C_intern (&amp;a, 13, "zlib-seek-set"); sym = C_intern (&amp;a, 13, "zlib:seek-set");
sym = C_intern (&amp;a, 13, "zlib-seek-cur"); sym = C_intern (&amp;a, 13, "zlib:seek-cur");
sym = C_intern (&amp;a, 13, "zlib-seek-end"); sym = C_intern (&amp;a, 13, "zlib:seek-end");
sym = C_intern (&amp;a, 12, "zlib-version"); sym = C_intern (&amp;a, 12, "zlib:version");
sym = C_intern (&amp;a, 25, "zlib-z-stream-next-in-set"); sym = C_intern (&amp;a, 25, "zlib:z-stream-next-in-set");
sym = C_intern (&amp;a, 25, "zlib-z-stream-next-in-get"); sym = C_intern (&amp;a, 25, "zlib:z-stream-next-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-avail-in-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-avail-in-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-avail-in-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-avail-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-total-in-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-total-in-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-total-in-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-total-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-next-out-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-next-out-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-next-out-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-next-out-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-avail-out-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-avail-out-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-avail-out-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-avail-out-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-total-out-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-total-out-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-total-out-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-total-out-get");
sym = C_intern (&amp;a, 21, "zlib-z-stream-msg-set"); sym = C_intern (&amp;a, 21, "zlib:z-stream-msg-set");
sym = C_intern (&amp;a, 21, "zlib-z-stream-msg-get"); sym = C_intern (&amp;a, 21, "zlib:z-stream-msg-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-state-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-state-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-state-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-state-get");
sym = C_intern (&amp;a, 24, "zlib-z-stream-zalloc-set"); sym = C_intern (&amp;a, 24, "zlib:z-stream-zalloc-set");
sym = C_intern (&amp;a, 24, "zlib-z-stream-zalloc-get"); sym = C_intern (&amp;a, 24, "zlib:z-stream-zalloc-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-zfree-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-zfree-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-zfree-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-zfree-get");
sym = C_intern (&amp;a, 24, "zlib-z-stream-opaque-set"); sym = C_intern (&amp;a, 24, "zlib:z-stream-opaque-set");
sym = C_intern (&amp;a, 24, "zlib-z-stream-opaque-get"); sym = C_intern (&amp;a, 24, "zlib:z-stream-opaque-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-data-type-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-data-type-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-data-type-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-data-type-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-adler-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-adler-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-adler-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-adler-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-reserved-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-reserved-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-reserved-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-reserved-get");
sym = C_intern (&amp;a, 17, "zlib-new-z-stream"); sym = C_intern (&amp;a, 17, "zlib:new-z-stream");
sym = C_intern (&amp;a, 20, "zlib-delete-z-stream"); sym = C_intern (&amp;a, 20, "zlib:delete-z-stream");
sym = C_intern (&amp;a, 15, "zlib-z-no-flush"); sym = C_intern (&amp;a, 15, "zlib:z-no-flush");
sym = C_intern (&amp;a, 20, "zlib-z-partial-flush"); sym = C_intern (&amp;a, 20, "zlib:z-partial-flush");
sym = C_intern (&amp;a, 17, "zlib-z-sync-flush"); sym = C_intern (&amp;a, 17, "zlib:z-sync-flush");
sym = C_intern (&amp;a, 17, "zlib-z-full-flush"); sym = C_intern (&amp;a, 17, "zlib:z-full-flush");
sym = C_intern (&amp;a, 13, "zlib-z-finish"); sym = C_intern (&amp;a, 13, "zlib:z-finish");
sym = C_intern (&amp;a, 9, "zlib-z-ok"); sym = C_intern (&amp;a, 9, "zlib:z-ok");
sym = C_intern (&amp;a, 17, "zlib-z-stream-end"); sym = C_intern (&amp;a, 17, "zlib:z-stream-end");
sym = C_intern (&amp;a, 16, "zlib-z-need-dict"); sym = C_intern (&amp;a, 16, "zlib:z-need-dict");
sym = C_intern (&amp;a, 12, "zlib-z-errno"); sym = C_intern (&amp;a, 12, "zlib:z-errno");
sym = C_intern (&amp;a, 19, "zlib-z-stream-error"); sym = C_intern (&amp;a, 19, "zlib:z-stream-error");
sym = C_intern (&amp;a, 17, "zlib-z-data-error"); sym = C_intern (&amp;a, 17, "zlib:z-data-error");
sym = C_intern (&amp;a, 16, "zlib-z-mem-error"); sym = C_intern (&amp;a, 16, "zlib:z-mem-error");
sym = C_intern (&amp;a, 16, "zlib-z-buf-error"); sym = C_intern (&amp;a, 16, "zlib:z-buf-error");
sym = C_intern (&amp;a, 20, "zlib-z-version-error"); sym = C_intern (&amp;a, 20, "zlib:z-version-error");
sym = C_intern (&amp;a, 21, "zlib-z-no-compression"); sym = C_intern (&amp;a, 21, "zlib:z-no-compression");
sym = C_intern (&amp;a, 17, "zlib-z-best-speed"); sym = C_intern (&amp;a, 17, "zlib:z-best-speed");
sym = C_intern (&amp;a, 23, "zlib-z-best-compression"); sym = C_intern (&amp;a, 23, "zlib:z-best-compression");
sym = C_intern (&amp;a, 26, "zlib-z-default-compression"); sym = C_intern (&amp;a, 26, "zlib:z-default-compression");
sym = C_intern (&amp;a, 15, "zlib-z-filtered"); sym = C_intern (&amp;a, 15, "zlib:z-filtered");
sym = C_intern (&amp;a, 19, "zlib-z-huffman-only"); sym = C_intern (&amp;a, 19, "zlib:z-huffman-only");
sym = C_intern (&amp;a, 23, "zlib-z-default-strategy"); sym = C_intern (&amp;a, 23, "zlib:z-default-strategy");
sym = C_intern (&amp;a, 13, "zlib-z-binary"); sym = C_intern (&amp;a, 13, "zlib:z-binary");
sym = C_intern (&amp;a, 12, "zlib-z-ascii"); sym = C_intern (&amp;a, 12, "zlib:z-ascii");
sym = C_intern (&amp;a, 14, "zlib-z-unknown"); sym = C_intern (&amp;a, 14, "zlib:z-unknown");
sym = C_intern (&amp;a, 15, "zlib-z-deflated"); sym = C_intern (&amp;a, 15, "zlib:z-deflated");
sym = C_intern (&amp;a, 11, "zlib-z-null"); sym = C_intern (&amp;a, 11, "zlib:z-null");
sym = C_intern (&amp;a, 17, "zlib-zlib-version"); sym = C_intern (&amp;a, 17, "zlib:zlib-version");
sym = C_intern (&amp;a, 12, "zlib-deflate"); sym = C_intern (&amp;a, 12, "zlib:deflate");
sym = C_intern (&amp;a, 16, "zlib-deflate-end"); sym = C_intern (&amp;a, 16, "zlib:deflate-end");
sym = C_intern (&amp;a, 12, "zlib-inflate"); sym = C_intern (&amp;a, 12, "zlib:inflate");
sym = C_intern (&amp;a, 16, "zlib-inflate-end"); sym = C_intern (&amp;a, 16, "zlib:inflate-end");
sym = C_intern (&amp;a, 27, "zlib-deflate-set-dictionary"); sym = C_intern (&amp;a, 27, "zlib:deflate-set-dictionary");
sym = C_intern (&amp;a, 17, "zlib-deflate-copy"); sym = C_intern (&amp;a, 17, "zlib:deflate-copy");
sym = C_intern (&amp;a, 18, "zlib-deflate-reset"); sym = C_intern (&amp;a, 18, "zlib:deflate-reset");
sym = C_intern (&amp;a, 19, "zlib-deflate-params"); sym = C_intern (&amp;a, 19, "zlib:deflate-params");
sym = C_intern (&amp;a, 27, "zlib-inflate-set-dictionary"); sym = C_intern (&amp;a, 27, "zlib:inflate-set-dictionary");
sym = C_intern (&amp;a, 17, "zlib-inflate-sync"); sym = C_intern (&amp;a, 17, "zlib:inflate-sync");
sym = C_intern (&amp;a, 18, "zlib-inflate-reset"); sym = C_intern (&amp;a, 18, "zlib:inflate-reset");
sym = C_intern (&amp;a, 13, "zlib-compress"); sym = C_intern (&amp;a, 13, "zlib:compress");
sym = C_intern (&amp;a, 14, "zlib-compress2"); sym = C_intern (&amp;a, 14, "zlib:compress2");
sym = C_intern (&amp;a, 15, "zlib-uncompress"); sym = C_intern (&amp;a, 15, "zlib:uncompress");
sym = C_intern (&amp;a, 11, "zlib-gzopen"); sym = C_intern (&amp;a, 11, "zlib:gzopen");
sym = C_intern (&amp;a, 12, "zlib-gzdopen"); sym = C_intern (&amp;a, 12, "zlib:gzdopen");
sym = C_intern (&amp;a, 16, "zlib-gzsetparams"); sym = C_intern (&amp;a, 16, "zlib:gzsetparams");
sym = C_intern (&amp;a, 11, "zlib-gzread"); sym = C_intern (&amp;a, 11, "zlib:gzread");
sym = C_intern (&amp;a, 12, "zlib-gzwrite"); sym = C_intern (&amp;a, 12, "zlib:gzwrite");
sym = C_intern (&amp;a, 13, "zlib-gzprintf"); sym = C_intern (&amp;a, 13, "zlib:gzprintf");
sym = C_intern (&amp;a, 11, "zlib-gzputs"); sym = C_intern (&amp;a, 11, "zlib:gzputs");
sym = C_intern (&amp;a, 11, "zlib-gzgets"); sym = C_intern (&amp;a, 11, "zlib:gzgets");
sym = C_intern (&amp;a, 11, "zlib-gzputc"); sym = C_intern (&amp;a, 11, "zlib:gzputc");
sym = C_intern (&amp;a, 11, "zlib-gzgetc"); sym = C_intern (&amp;a, 11, "zlib:gzgetc");
sym = C_intern (&amp;a, 12, "zlib-gzflush"); sym = C_intern (&amp;a, 12, "zlib:gzflush");
sym = C_intern (&amp;a, 11, "zlib-gzseek"); sym = C_intern (&amp;a, 11, "zlib:gzseek");
sym = C_intern (&amp;a, 13, "zlib-gzrewind"); sym = C_intern (&amp;a, 13, "zlib:gzrewind");
sym = C_intern (&amp;a, 11, "zlib-gztell"); sym = C_intern (&amp;a, 11, "zlib:gztell");
sym = C_intern (&amp;a, 10, "zlib-gzeof"); sym = C_intern (&amp;a, 10, "zlib:gzeof");
sym = C_intern (&amp;a, 12, "zlib-gzclose"); sym = C_intern (&amp;a, 12, "zlib:gzclose");
sym = C_intern (&amp;a, 12, "zlib-gzerror"); sym = C_intern (&amp;a, 12, "zlib:gzerror");
sym = C_intern (&amp;a, 12, "zlib-adler32"); sym = C_intern (&amp;a, 12, "zlib:adler32");
sym = C_intern (&amp;a, 10, "zlib-crc32"); sym = C_intern (&amp;a, 10, "zlib:crc32");
sym = C_intern (&amp;a, 18, "zlib-deflate-init-"); sym = C_intern (&amp;a, 18, "zlib:deflate-init-");
sym = C_intern (&amp;a, 18, "zlib-inflate-init-"); sym = C_intern (&amp;a, 18, "zlib:inflate-init-");
sym = C_intern (&amp;a, 19, "zlib-deflate-init2-"); sym = C_intern (&amp;a, 19, "zlib:deflate-init2-");
sym = C_intern (&amp;a, 19, "zlib-inflate-init2-"); sym = C_intern (&amp;a, 19, "zlib:inflate-init2-");
sym = C_intern (&amp;a, 29, "zlib-internal-state-dummy-set"); sym = C_intern (&amp;a, 29, "zlib:internal-state-dummy-set");
sym = C_intern (&amp;a, 29, "zlib-internal-state-dummy-get"); sym = C_intern (&amp;a, 29, "zlib:internal-state-dummy-get");
sym = C_intern (&amp;a, 23, "zlib-new-internal-state"); sym = C_intern (&amp;a, 23, "zlib:new-internal-state");
sym = C_intern (&amp;a, 26, "zlib-delete-internal-state"); sym = C_intern (&amp;a, 26, "zlib:delete-internal-state");
sym = C_intern (&amp;a, 12, "zlib-ze-rror"); sym = C_intern (&amp;a, 12, "zlib:ze-rror");
sym = C_intern (&amp;a, 23, "zlib-inflate-sync-point"); sym = C_intern (&amp;a, 23, "zlib:inflate-sync-point");
sym = C_intern (&amp;a, 18, "zlib-get-crc-table"); sym = C_intern (&amp;a, 18, "zlib:get-crc-table");
</pre> </pre>
</blockquote> </blockquote>
Much better. The only problem is the identifier Much better. The only problem is the identifier
<code>zlib-ze-rror</code>, and we are missing <code>zlib:ze-rror</code>, and we are missing
<code>zlib-deflate-init</code> and <code>zlib-inflate-init</code> <code>zlib:deflate-init</code> and <code>zlib:inflate-init</code>
because they are defined as macros (see <a because they are defined as macros (see <a
href="#initmacros">macro definitions</a>). href="#initmacros">macro definitions</a>).
@ -1262,7 +1262,7 @@
We make sure to rename <code>zError</code> to We make sure to rename <code>zError</code> to
<code>z_error</code>, and we inline some helper functions for the <code>z_error</code>, and we inline some helper functions for the
<code>zlib-...-init</code> macros. We try again. <code>zlib:...-init</code> macros. We try again.
<blockquote> <blockquote>
<pre> <pre>
@ -1304,115 +1304,115 @@ int inflate_init(z_streamp strm) {
% swig -chicken -prefix zlib -mixed -I/usr/include example.i % swig -chicken -prefix zlib -mixed -I/usr/include example.i
% grep C_intern example_wrap.c % grep C_intern example_wrap.c
C_word err = C_intern2 (&amp;a, errorhook); C_word err = C_intern2 (&amp;a, errorhook);
sym = C_intern (&amp;a, 18, "zlib-max-mem-level"); sym = C_intern (&amp;a, 18, "zlib:max-mem-level");
sym = C_intern (&amp;a, 14, "zlib-max-wbits"); sym = C_intern (&amp;a, 14, "zlib:max-wbits");
sym = C_intern (&amp;a, 13, "zlib-seek-set"); sym = C_intern (&amp;a, 13, "zlib:seek-set");
sym = C_intern (&amp;a, 13, "zlib-seek-cur"); sym = C_intern (&amp;a, 13, "zlib:seek-cur");
sym = C_intern (&amp;a, 13, "zlib-seek-end"); sym = C_intern (&amp;a, 13, "zlib:seek-end");
sym = C_intern (&amp;a, 12, "zlib-version"); sym = C_intern (&amp;a, 12, "zlib:version");
sym = C_intern (&amp;a, 25, "zlib-z-stream-next-in-set"); sym = C_intern (&amp;a, 25, "zlib:z-stream-next-in-set");
sym = C_intern (&amp;a, 25, "zlib-z-stream-next-in-get"); sym = C_intern (&amp;a, 25, "zlib:z-stream-next-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-avail-in-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-avail-in-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-avail-in-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-avail-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-total-in-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-total-in-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-total-in-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-total-in-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-next-out-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-next-out-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-next-out-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-next-out-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-avail-out-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-avail-out-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-avail-out-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-avail-out-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-total-out-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-total-out-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-total-out-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-total-out-get");
sym = C_intern (&amp;a, 21, "zlib-z-stream-msg-set"); sym = C_intern (&amp;a, 21, "zlib:z-stream-msg-set");
sym = C_intern (&amp;a, 21, "zlib-z-stream-msg-get"); sym = C_intern (&amp;a, 21, "zlib:z-stream-msg-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-state-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-state-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-state-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-state-get");
sym = C_intern (&amp;a, 24, "zlib-z-stream-zalloc-set"); sym = C_intern (&amp;a, 24, "zlib:z-stream-zalloc-set");
sym = C_intern (&amp;a, 24, "zlib-z-stream-zalloc-get"); sym = C_intern (&amp;a, 24, "zlib:z-stream-zalloc-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-zfree-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-zfree-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-zfree-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-zfree-get");
sym = C_intern (&amp;a, 24, "zlib-z-stream-opaque-set"); sym = C_intern (&amp;a, 24, "zlib:z-stream-opaque-set");
sym = C_intern (&amp;a, 24, "zlib-z-stream-opaque-get"); sym = C_intern (&amp;a, 24, "zlib:z-stream-opaque-get");
sym = C_intern (&amp;a, 27, "zlib-z-stream-data-type-set"); sym = C_intern (&amp;a, 27, "zlib:z-stream-data-type-set");
sym = C_intern (&amp;a, 27, "zlib-z-stream-data-type-get"); sym = C_intern (&amp;a, 27, "zlib:z-stream-data-type-get");
sym = C_intern (&amp;a, 23, "zlib-z-stream-adler-set"); sym = C_intern (&amp;a, 23, "zlib:z-stream-adler-set");
sym = C_intern (&amp;a, 23, "zlib-z-stream-adler-get"); sym = C_intern (&amp;a, 23, "zlib:z-stream-adler-get");
sym = C_intern (&amp;a, 26, "zlib-z-stream-reserved-set"); sym = C_intern (&amp;a, 26, "zlib:z-stream-reserved-set");
sym = C_intern (&amp;a, 26, "zlib-z-stream-reserved-get"); sym = C_intern (&amp;a, 26, "zlib:z-stream-reserved-get");
sym = C_intern (&amp;a, 17, "zlib-new-z-stream"); sym = C_intern (&amp;a, 17, "zlib:new-z-stream");
sym = C_intern (&amp;a, 20, "zlib-delete-z-stream"); sym = C_intern (&amp;a, 20, "zlib:delete-z-stream");
sym = C_intern (&amp;a, 15, "zlib-z-no-flush"); sym = C_intern (&amp;a, 15, "zlib:z-no-flush");
sym = C_intern (&amp;a, 20, "zlib-z-partial-flush"); sym = C_intern (&amp;a, 20, "zlib:z-partial-flush");
sym = C_intern (&amp;a, 17, "zlib-z-sync-flush"); sym = C_intern (&amp;a, 17, "zlib:z-sync-flush");
sym = C_intern (&amp;a, 17, "zlib-z-full-flush"); sym = C_intern (&amp;a, 17, "zlib:z-full-flush");
sym = C_intern (&amp;a, 13, "zlib-z-finish"); sym = C_intern (&amp;a, 13, "zlib:z-finish");
sym = C_intern (&amp;a, 9, "zlib-z-ok"); sym = C_intern (&amp;a, 9, "zlib:z-ok");
sym = C_intern (&amp;a, 17, "zlib-z-stream-end"); sym = C_intern (&amp;a, 17, "zlib:z-stream-end");
sym = C_intern (&amp;a, 16, "zlib-z-need-dict"); sym = C_intern (&amp;a, 16, "zlib:z-need-dict");
sym = C_intern (&amp;a, 12, "zlib-z-errno"); sym = C_intern (&amp;a, 12, "zlib:z-errno");
sym = C_intern (&amp;a, 19, "zlib-z-stream-error"); sym = C_intern (&amp;a, 19, "zlib:z-stream-error");
sym = C_intern (&amp;a, 17, "zlib-z-data-error"); sym = C_intern (&amp;a, 17, "zlib:z-data-error");
sym = C_intern (&amp;a, 16, "zlib-z-mem-error"); sym = C_intern (&amp;a, 16, "zlib:z-mem-error");
sym = C_intern (&amp;a, 16, "zlib-z-buf-error"); sym = C_intern (&amp;a, 16, "zlib:z-buf-error");
sym = C_intern (&amp;a, 20, "zlib-z-version-error"); sym = C_intern (&amp;a, 20, "zlib:z-version-error");
sym = C_intern (&amp;a, 21, "zlib-z-no-compression"); sym = C_intern (&amp;a, 21, "zlib:z-no-compression");
sym = C_intern (&amp;a, 17, "zlib-z-best-speed"); sym = C_intern (&amp;a, 17, "zlib:z-best-speed");
sym = C_intern (&amp;a, 23, "zlib-z-best-compression"); sym = C_intern (&amp;a, 23, "zlib:z-best-compression");
sym = C_intern (&amp;a, 26, "zlib-z-default-compression"); sym = C_intern (&amp;a, 26, "zlib:z-default-compression");
sym = C_intern (&amp;a, 15, "zlib-z-filtered"); sym = C_intern (&amp;a, 15, "zlib:z-filtered");
sym = C_intern (&amp;a, 19, "zlib-z-huffman-only"); sym = C_intern (&amp;a, 19, "zlib:z-huffman-only");
sym = C_intern (&amp;a, 23, "zlib-z-default-strategy"); sym = C_intern (&amp;a, 23, "zlib:z-default-strategy");
sym = C_intern (&amp;a, 13, "zlib-z-binary"); sym = C_intern (&amp;a, 13, "zlib:z-binary");
sym = C_intern (&amp;a, 12, "zlib-z-ascii"); sym = C_intern (&amp;a, 12, "zlib:z-ascii");
sym = C_intern (&amp;a, 14, "zlib-z-unknown"); sym = C_intern (&amp;a, 14, "zlib:z-unknown");
sym = C_intern (&amp;a, 15, "zlib-z-deflated"); sym = C_intern (&amp;a, 15, "zlib:z-deflated");
sym = C_intern (&amp;a, 11, "zlib-z-null"); sym = C_intern (&amp;a, 11, "zlib:z-null");
sym = C_intern (&amp;a, 17, "zlib-zlib-version"); sym = C_intern (&amp;a, 17, "zlib:zlib-version");
sym = C_intern (&amp;a, 12, "zlib-deflate"); sym = C_intern (&amp;a, 12, "zlib:deflate");
sym = C_intern (&amp;a, 16, "zlib-deflate-end"); sym = C_intern (&amp;a, 16, "zlib:deflate-end");
sym = C_intern (&amp;a, 12, "zlib-inflate"); sym = C_intern (&amp;a, 12, "zlib:inflate");
sym = C_intern (&amp;a, 16, "zlib-inflate-end"); sym = C_intern (&amp;a, 16, "zlib:inflate-end");
sym = C_intern (&amp;a, 27, "zlib-deflate-set-dictionary"); sym = C_intern (&amp;a, 27, "zlib:deflate-set-dictionary");
sym = C_intern (&amp;a, 17, "zlib-deflate-copy"); sym = C_intern (&amp;a, 17, "zlib:deflate-copy");
sym = C_intern (&amp;a, 18, "zlib-deflate-reset"); sym = C_intern (&amp;a, 18, "zlib:deflate-reset");
sym = C_intern (&amp;a, 19, "zlib-deflate-params"); sym = C_intern (&amp;a, 19, "zlib:deflate-params");
sym = C_intern (&amp;a, 27, "zlib-inflate-set-dictionary"); sym = C_intern (&amp;a, 27, "zlib:inflate-set-dictionary");
sym = C_intern (&amp;a, 17, "zlib-inflate-sync"); sym = C_intern (&amp;a, 17, "zlib:inflate-sync");
sym = C_intern (&amp;a, 18, "zlib-inflate-reset"); sym = C_intern (&amp;a, 18, "zlib:inflate-reset");
sym = C_intern (&amp;a, 13, "zlib-compress"); sym = C_intern (&amp;a, 13, "zlib:compress");
sym = C_intern (&amp;a, 14, "zlib-compress2"); sym = C_intern (&amp;a, 14, "zlib:compress2");
sym = C_intern (&amp;a, 15, "zlib-uncompress"); sym = C_intern (&amp;a, 15, "zlib:uncompress");
sym = C_intern (&amp;a, 11, "zlib-gzopen"); sym = C_intern (&amp;a, 11, "zlib:gzopen");
sym = C_intern (&amp;a, 12, "zlib-gzdopen"); sym = C_intern (&amp;a, 12, "zlib:gzdopen");
sym = C_intern (&amp;a, 16, "zlib-gzsetparams"); sym = C_intern (&amp;a, 16, "zlib:gzsetparams");
sym = C_intern (&amp;a, 11, "zlib-gzread"); sym = C_intern (&amp;a, 11, "zlib:gzread");
sym = C_intern (&amp;a, 12, "zlib-gzwrite"); sym = C_intern (&amp;a, 12, "zlib:gzwrite");
sym = C_intern (&amp;a, 13, "zlib-gzprintf"); sym = C_intern (&amp;a, 13, "zlib:gzprintf");
sym = C_intern (&amp;a, 11, "zlib-gzputs"); sym = C_intern (&amp;a, 11, "zlib:gzputs");
sym = C_intern (&amp;a, 11, "zlib-gzgets"); sym = C_intern (&amp;a, 11, "zlib:gzgets");
sym = C_intern (&amp;a, 11, "zlib-gzputc"); sym = C_intern (&amp;a, 11, "zlib:gzputc");
sym = C_intern (&amp;a, 11, "zlib-gzgetc"); sym = C_intern (&amp;a, 11, "zlib:gzgetc");
sym = C_intern (&amp;a, 12, "zlib-gzflush"); sym = C_intern (&amp;a, 12, "zlib:gzflush");
sym = C_intern (&amp;a, 11, "zlib-gzseek"); sym = C_intern (&amp;a, 11, "zlib:gzseek");
sym = C_intern (&amp;a, 13, "zlib-gzrewind"); sym = C_intern (&amp;a, 13, "zlib:gzrewind");
sym = C_intern (&amp;a, 11, "zlib-gztell"); sym = C_intern (&amp;a, 11, "zlib:gztell");
sym = C_intern (&amp;a, 10, "zlib-gzeof"); sym = C_intern (&amp;a, 10, "zlib:gzeof");
sym = C_intern (&amp;a, 12, "zlib-gzclose"); sym = C_intern (&amp;a, 12, "zlib:gzclose");
sym = C_intern (&amp;a, 12, "zlib-gzerror"); sym = C_intern (&amp;a, 12, "zlib:gzerror");
sym = C_intern (&amp;a, 12, "zlib-adler32"); sym = C_intern (&amp;a, 12, "zlib:adler32");
sym = C_intern (&amp;a, 10, "zlib-crc32"); sym = C_intern (&amp;a, 10, "zlib:crc32");
sym = C_intern (&amp;a, 18, "zlib-deflate-init-"); sym = C_intern (&amp;a, 18, "zlib:deflate-init-");
sym = C_intern (&amp;a, 18, "zlib-inflate-init-"); sym = C_intern (&amp;a, 18, "zlib:inflate-init-");
sym = C_intern (&amp;a, 19, "zlib-deflate-init2-"); sym = C_intern (&amp;a, 19, "zlib:deflate-init2-");
sym = C_intern (&amp;a, 19, "zlib-inflate-init2-"); sym = C_intern (&amp;a, 19, "zlib:inflate-init2-");
sym = C_intern (&amp;a, 29, "zlib-internal-state-dummy-set"); sym = C_intern (&amp;a, 29, "zlib:internal-state-dummy-set");
sym = C_intern (&amp;a, 29, "zlib-internal-state-dummy-get"); sym = C_intern (&amp;a, 29, "zlib:internal-state-dummy-get");
sym = C_intern (&amp;a, 23, "zlib-new-internal-state"); sym = C_intern (&amp;a, 23, "zlib:new-internal-state");
sym = C_intern (&amp;a, 26, "zlib-delete-internal-state"); sym = C_intern (&amp;a, 26, "zlib:delete-internal-state");
sym = C_intern (&amp;a, 12, "zlib-z-error"); sym = C_intern (&amp;a, 12, "zlib:z-error");
sym = C_intern (&amp;a, 23, "zlib-inflate-sync-point"); sym = C_intern (&amp;a, 23, "zlib:inflate-sync-point");
sym = C_intern (&amp;a, 18, "zlib-get-crc-table"); sym = C_intern (&amp;a, 18, "zlib:get-crc-table");
sym = C_intern (&amp;a, 17, "zlib-deflate-init"); sym = C_intern (&amp;a, 17, "zlib:deflate-init");
sym = C_intern (&amp;a, 17, "zlib-inflate-init"); sym = C_intern (&amp;a, 17, "zlib:inflate-init");
</pre> </pre>
</blockquote> </blockquote>
@ -1440,27 +1440,27 @@ zlib
Scheme Procedures: Scheme Procedures:
zlib-max-mem-level zlib:max-mem-level
zlib-max-wbits zlib:max-wbits
zlib-seek-set zlib:seek-set
zlib-seek-cur zlib:seek-cur
zlib-seek-end zlib:seek-end
zlib-version zlib:version
zlib-z-stream-next-in-set zlib:z-stream-next-in-set
zlib-z-stream-next-in-get zlib:z-stream-next-in-get
zlib-z-stream-avail-in-set zlib:z-stream-avail-in-set
... ...
zlib-get-crc-table zlib:get-crc-table
zlib-deflate-init zlib:deflate-init
zlib-inflate-init zlib:inflate-init
; This is the CHICKEN interpreter - Version 0, Build 1095 - windows-cygwin-x86 ; This is the CHICKEN interpreter - Version 0, Build 1095 - windows-cygwin-x86
; (c)2000-2003 Felix L. Winkelmann ; (c)2000-2003 Felix L. Winkelmann
&gt;&gt;&gt; (define s (zlib-new-z-stream)) &gt;&gt;&gt; (define s (zlib:new-z-stream))
&gt;&gt;&gt; s &gt;&gt;&gt; s
#&lt;tagged pointer #&lt;c++ "z_stream *"&gt;(#&lt;pointer 6d9290&gt;)&gt; #&lt;tagged pointer #&lt;c++ "z_stream *"&gt;(#&lt;pointer 6d9290&gt;)&gt;
&gt;&gt;&gt; (zlib-z-stream-next-in-get s) &gt;&gt;&gt; (zlib:z-stream-next-in-get s)
#f #f
&gt;&gt;&gt; (zlib-z-stream-next-in-set s "some dummy stream data") &gt;&gt;&gt; (zlib:z-stream-next-in-set s "some dummy stream data")
Error: Type error. Expected _p_Bytef: "bad argument type" Error: Type error. Expected _p_Bytef: "bad argument type"
&gt;&gt;&gt; (exit) &gt;&gt;&gt; (exit)
</pre> </pre>
@ -1524,38 +1524,38 @@ zlib
Scheme Procedures: Scheme Procedures:
zlib-max-mem-level zlib:max-mem-level
zlib-max-wbits zlib:max-wbits
zlib-seek-set zlib:seek-set
zlib-seek-cur zlib:seek-cur
zlib-seek-end zlib:seek-end
zlib-version zlib:version
zlib-z-stream-next-in-set zlib:z-stream-next-in-set
zlib-z-stream-next-in-get zlib:z-stream-next-in-get
zlib-z-stream-avail-in-set zlib:z-stream-avail-in-set
... ...
zlib-get-crc-table zlib:get-crc-table
zlib-deflate-init zlib:deflate-init
zlib-inflate-init zlib:inflate-init
; This is the CHICKEN interpreter - Version 0, Build 1095 - windows-cygwin-x86 ; This is the CHICKEN interpreter - Version 0, Build 1095 - windows-cygwin-x86
; (c)2000-2003 Felix L. Winkelmann ; (c)2000-2003 Felix L. Winkelmann
&gt;&gt;&gt; (define s (zlib-new-z-stream)) &gt;&gt;&gt; (define s (zlib:new-z-stream))
<em>Init zstream</em> <em>Init zstream</em>
&gt;&gt;&gt; (zlib-z-stream-zalloc-set s #f) &gt;&gt;&gt; (zlib:z-stream-zalloc-set s #f)
&gt;&gt;&gt; (zlib-z-stream-zfree-set s #f) &gt;&gt;&gt; (zlib:z-stream-zfree-set s #f)
&gt;&gt;&gt; (zlib-z-stream-opaque-set s #f) &gt;&gt;&gt; (zlib:z-stream-opaque-set s #f)
&gt;&gt;&gt; (zlib-deflate-init s (zlib-z-default-compression)) &gt;&gt;&gt; (zlib:deflate-init s (zlib:z-default-compression))
0 0
<em>Deflate something small so we don't need to loop/stream data</em> <em>Deflate something small so we don't need to loop/stream data</em>
&gt;&gt;&gt; (define in "some dummy data") &gt;&gt;&gt; (define in "some dummy data")
&gt;&gt;&gt; (define out (make-string 1000)) &gt;&gt;&gt; (define out (make-string 1000))
&gt;&gt;&gt; (zlib-z-stream-next-in-set s in) &gt;&gt;&gt; (zlib:z-stream-next-in-set s in)
&gt;&gt;&gt; (zlib-z-stream-avail-in-set s (string-length in)) &gt;&gt;&gt; (zlib:z-stream-avail-in-set s (string-length in))
&gt;&gt;&gt; (zlib-z-stream-next-out-set s out) &gt;&gt;&gt; (zlib:z-stream-next-out-set s out)
&gt;&gt;&gt; (zlib-z-stream-avail-out-set s (string-length out)) &gt;&gt;&gt; (zlib:z-stream-avail-out-set s (string-length out))
&gt;&gt;&gt; (zlib-deflate s (zlib-z-finish)) &gt;&gt;&gt; (zlib:deflate s (zlib:z-finish))
1 <em>;; (zlib-z-stream-end) == 1, which is good</em> 1 <em>;; (zlib:z-stream-end) == 1, which is good</em>
&gt;&gt;&gt; (zlib-z-stream-total-out-get s) &gt;&gt;&gt; (zlib:z-stream-total-out-get s)
23. 23.
&gt;&gt;&gt; out &gt;&gt;&gt; out
" " " "
@ -1567,7 +1567,7 @@ zlib-inflate-init
when SWIG CHICKEN passes a Scheme string to a C function, it when SWIG CHICKEN passes a Scheme string to a C function, it
duplicates the string before calling the C function. We want to duplicates the string before calling the C function. We want to
save the memory address that save the memory address that
<code>zlib-z-stream-next-out-set</code> is using, so we can <code>zlib:z-stream-next-out-set</code> is using, so we can
display this later. While we are at it, we can foresee that display this later. While we are at it, we can foresee that
<code>compress</code>, <code>compress2</code> and <code>compress</code>, <code>compress2</code> and
<code>uncompress</code> will all need some finessing to work with <code>uncompress</code> will all need some finessing to work with

View file

@ -9,115 +9,115 @@
(display "Scheme Procedures:\n") (display "Scheme Procedures:\n")
(display " (display "
zlib-max-mem-level zlib:max-mem-level
zlib-max-wbits zlib:max-wbits
zlib-seek-set zlib:seek-set
zlib-seek-cur zlib:seek-cur
zlib-seek-end zlib:seek-end
zlib-version zlib:version
zlib-z-stream-next-in-set zlib:z-stream-next-in-set
zlib-z-stream-next-in-get zlib:z-stream-next-in-get
zlib-z-stream-avail-in-set zlib:z-stream-avail-in-set
zlib-z-stream-avail-in-get zlib:z-stream-avail-in-get
zlib-z-stream-total-in-set zlib:z-stream-total-in-set
zlib-z-stream-total-in-get zlib:z-stream-total-in-get
zlib-z-stream-next-out-set zlib:z-stream-next-out-set
zlib-z-stream-next-out-get zlib:z-stream-next-out-get
zlib-z-stream-avail-out-set zlib:z-stream-avail-out-set
zlib-z-stream-avail-out-get zlib:z-stream-avail-out-get
zlib-z-stream-total-out-set zlib:z-stream-total-out-set
zlib-z-stream-total-out-get zlib:z-stream-total-out-get
zlib-z-stream-msg-set zlib:z-stream-msg-set
zlib-z-stream-msg-get zlib:z-stream-msg-get
zlib-z-stream-state-set zlib:z-stream-state-set
zlib-z-stream-state-get zlib:z-stream-state-get
zlib-z-stream-zalloc-set zlib:z-stream-zalloc-set
zlib-z-stream-zalloc-get zlib:z-stream-zalloc-get
zlib-z-stream-zfree-set zlib:z-stream-zfree-set
zlib-z-stream-zfree-get zlib:z-stream-zfree-get
zlib-z-stream-opaque-set zlib:z-stream-opaque-set
zlib-z-stream-opaque-get zlib:z-stream-opaque-get
zlib-z-stream-data-type-set zlib:z-stream-data-type-set
zlib-z-stream-data-type-get zlib:z-stream-data-type-get
zlib-z-stream-adler-set zlib:z-stream-adler-set
zlib-z-stream-adler-get zlib:z-stream-adler-get
zlib-z-stream-reserved-set zlib:z-stream-reserved-set
zlib-z-stream-reserved-get zlib:z-stream-reserved-get
zlib-new-z-stream zlib:new-z-stream
zlib-delete-z-stream zlib:delete-z-stream
zlib-z-no-flush zlib:z-no-flush
zlib-z-partial-flush zlib:z-partial-flush
zlib-z-sync-flush zlib:z-sync-flush
zlib-z-full-flush zlib:z-full-flush
zlib-z-finish zlib:z-finish
zlib-z-ok zlib:z-ok
zlib-z-stream-end zlib:z-stream-end
zlib-z-need-dict zlib:z-need-dict
zlib-z-errno zlib:z-errno
zlib-z-stream-error zlib:z-stream-error
zlib-z-data-error zlib:z-data-error
zlib-z-mem-error zlib:z-mem-error
zlib-z-buf-error zlib:z-buf-error
zlib-z-version-error zlib:z-version-error
zlib-z-no-compression zlib:z-no-compression
zlib-z-best-speed zlib:z-best-speed
zlib-z-best-compression zlib:z-best-compression
zlib-z-default-compression zlib:z-default-compression
zlib-z-filtered zlib:z-filtered
zlib-z-huffman-only zlib:z-huffman-only
zlib-z-default-strategy zlib:z-default-strategy
zlib-z-binary zlib:z-binary
zlib-z-ascii zlib:z-ascii
zlib-z-unknown zlib:z-unknown
zlib-z-deflated zlib:z-deflated
zlib-z-null zlib:z-null
zlib-version zlib:version
zlib-deflate zlib:deflate
zlib-deflate-end zlib:deflate-end
zlib-inflate zlib:inflate
zlib-inflate-end zlib:inflate-end
zlib-deflate-set-dictionary zlib:deflate-set-dictionary
zlib-deflate-copy zlib:deflate-copy
zlib-deflate-reset zlib:deflate-reset
zlib-deflate-params zlib:deflate-params
zlib-inflate-set-dictionary zlib:inflate-set-dictionary
zlib-inflate-sync zlib:inflate-sync
zlib-inflate-reset zlib:inflate-reset
zlib-compress zlib:compress
zlib-compress2 zlib:compress2
zlib-uncompress zlib:uncompress
zlib-gzopen zlib:gzopen
zlib-gzdopen zlib:gzdopen
zlib-gzsetparams zlib:gzsetparams
zlib-gzread zlib:gzread
zlib-gzwrite zlib:gzwrite
zlib-gzprintf zlib:gzprintf
zlib-gzputs zlib:gzputs
zlib-gzgets zlib:gzgets
zlib-gzputc zlib:gzputc
zlib-gzgetc zlib:gzgetc
zlib-gzflush zlib:gzflush
zlib-gzseek zlib:gzseek
zlib-gzrewind zlib:gzrewind
zlib-gztell zlib:gztell
zlib-gzeof zlib:gzeof
zlib-gzclose zlib:gzclose
zlib-gzerror zlib:gzerror
zlib-adler32 zlib:adler32
zlib-crc32 zlib:crc32
zlib-deflate-init- zlib:deflate-init-
zlib-inflate-init- zlib:inflate-init-
zlib-deflate-init2- zlib:deflate-init2-
zlib-inflate-init2- zlib:inflate-init2-
zlib-internal-state-dummy-set zlib:internal-state-dummy-set
zlib-internal-state-dummy-get zlib:internal-state-dummy-get
zlib-new-internal-state zlib:new-internal-state
zlib-delete-internal-state zlib:delete-internal-state
zlib-z-error zlib:z-error
zlib-inflate-sync-point zlib:inflate-sync-point
zlib-get-crc-table zlib:get-crc-table
zlib-deflate-init zlib:deflate-init
zlib-inflate-init zlib:inflate-init
zlib-z-stream-save-next-out zlib:z-stream-save-next-out
zlib-z-stream-get-next-chunk zlib:z-stream-get-next-chunk
") ")

View file

@ -1,42 +1,42 @@
;; run with './zlib test-zlib.scm' ;; run with './zlib test-zlib.scm'
;; Init zstream ;; Init zstream
(define s (zlib-new-z-stream)) (define s (zlib:new-z-stream))
(zlib-z-stream-zalloc-set s #f) (zlib:z-stream-zalloc-set s #f)
(zlib-z-stream-zfree-set s #f) (zlib:z-stream-zfree-set s #f)
(zlib-z-stream-opaque-set s #f) (zlib:z-stream-opaque-set s #f)
(zlib-deflate-init s (zlib-z-default-compression)) (zlib:deflate-init s (zlib:z-default-compression))
;; Deflate something small so we don't need to loop/stream data ;; Deflate something small so we don't need to loop/stream data
(define in "some pony et jumping et jack et flash et had a jack pony") (define in "some pony et jumping et jack et flash et had a jack pony")
(define out (make-string 1000)) (define out (make-string 1000))
(format #t "to be compressed: ~A~%to be compressed bytes: ~D~%~%" in (string-length in)) (format #t "to be compressed: ~A~%to be compressed bytes: ~D~%~%" in (string-length in))
(zlib-z-stream-next-in-set s in) (zlib:z-stream-next-in-set s in)
(zlib-z-stream-avail-in-set s (string-length in)) (zlib:z-stream-avail-in-set s (string-length in))
(zlib-z-stream-next-out-set s out) (zlib:z-stream-next-out-set s out)
(zlib-z-stream-avail-out-set s (string-length out)) (zlib:z-stream-avail-out-set s (string-length out))
(let* (let*
((saved-out (zlib-z-stream-save-next-out s)) ((saved-out (zlib:z-stream-save-next-out s))
(ret (zlib-deflate s (zlib-z-finish)))) (ret (zlib:deflate s (zlib:z-finish))))
(cond (cond
((= ret (zlib-z-stream-end)) ((= ret (zlib:z-stream-end))
(format #t "deflated properly!~%compressed bytes: ~D~%compressed stream: ~S~%" (format #t "deflated properly!~%compressed bytes: ~D~%compressed stream: ~S~%"
(zlib-z-stream-total-out-get s) (zlib-z-stream-get-next-chunk s saved-out))) (zlib:z-stream-total-out-get s) (zlib:z-stream-get-next-chunk s saved-out)))
((= ret (zlib-z-ok)) ((= ret (zlib:z-ok))
(display "only partial deflation ... not enough output space\n")) (display "only partial deflation ... not enough output space\n"))
(else (else
(format #t "deflate error(~D): ~A ~%" ret (zlib-z-stream-msg-get s))))) (format #t "deflate error(~D): ~A ~%" ret (zlib:z-stream-msg-get s)))))
;; Use simple compress routine, and set max output size to 100 ;; Use simple compress routine, and set max output size to 100
(define c (zlib-compress 100 in)) (define c (zlib:compress 100 in))
(newline) (newline)
(let (let
((ret (car c)) ((ret (car c))
(compressed (cadr c))) (compressed (cadr c)))
(cond (cond
((= ret (zlib-z-ok)) ((= ret (zlib:z-ok))
(format #t "compressed properly!~%compressed bytes: ~D~%compressed stream: ~S~%" (format #t "compressed properly!~%compressed bytes: ~D~%compressed stream: ~S~%"
(string-length compressed) compressed)) (string-length compressed) compressed))
(else (else
(format #t "compress error(~D): ~A ~%" ret (zlib-z-error ret))))) (format #t "compress error(~D): ~A ~%" ret (zlib:z-error ret)))))

View file

@ -236,7 +236,7 @@ $1 = *argp; ";
%typemap(out,chicken_words="SWIG_ALLOCSZ_PACKED_OBJ(sizeof($1_type),$typename)") SWIGTYPE (CLASS::*) "$result = swig_new_packed_obj((void *) &$1, &known_space, sizeof($1_type), $1_descriptor);"; %typemap(out,chicken_words="SWIG_ALLOCSZ_PACKED_OBJ(sizeof($1_type),$typename)") SWIGTYPE (CLASS::*) "$result = swig_new_packed_obj((void *) &$1, &known_space, sizeof($1_type), $1_descriptor);";
/* Void */ /* Void */
%typemap(out,chicken_words="VOID") void %typemap(out,chicken_words="void") void
%{ %{
/*if ONE*/ /*if ONE*/
$result = C_SCHEME_UNDEFINED; $result = C_SCHEME_UNDEFINED;

View file

@ -250,8 +250,8 @@ CHICKEN::top(Node *n)
if (!prefix) { if (!prefix) {
prefix = Copy(module); prefix = Copy(module);
} }
if (Len(prefix) && ((Char(prefix)) [Len(prefix) - 1] != '-')) { if (Len(prefix) && ((Char(prefix)) [Len(prefix) - 1] != ':')) {
Append(prefix, "-"); Append(prefix, ":");
} }
} }
@ -538,7 +538,7 @@ CHICKEN::functionWrapper(Node *n)
for (p = l; p;) { for (p = l; p;) {
if (tm = Getattr(p,"tmap:argout:chicken_words")) { if (tm = Getattr(p,"tmap:argout:chicken_words")) {
Replaceall(tm,"$typename", mangle); Replaceall(tm,"$typename", mangle);
if (strcasecmp(Char(tm), "VOID") == 0) continue; if (strcmp(Char(tm), "void") == 0) continue;
if (strcmp(Char(tm), "0") != 0) will_alloca = 1; if (strcmp(Char(tm), "0") != 0) will_alloca = 1;
if (result_list_len) { if (result_list_len) {
Printf(known_alloca_plus, " + "); Printf(known_alloca_plus, " + ");
@ -555,7 +555,7 @@ CHICKEN::functionWrapper(Node *n)
if ((tm = Swig_typemap_lookup_new("out",n,"result",0))) { if ((tm = Swig_typemap_lookup_new("out",n,"result",0))) {
if (am = Getattr(n,"tmap:out:chicken_words")) { if (am = Getattr(n,"tmap:out:chicken_words")) {
Replaceall(am,"$typename", mangle); Replaceall(am,"$typename", mangle);
if (strcasecmp(Char(am), "VOID") == 0) { if (strcmp(Char(am), "void") == 0) {
has_void_return = 1; has_void_return = 1;
} }
else { else {