This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
/
ANNOUNCE
196 lines (135 loc) · 4.85 KB
/
ANNOUNCE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Subject: [announce] Vicare/Expat revision 0.4d1
Vicare/Expat
============
This package is a distribution of C and Scheme libraries for Vicare
Scheme, an R6RS compliant Scheme implementation in the form of a native
compiler for x86 architectures, officially supporting GNU+Linux systems;
it provides bindings for the Expat C language library, an XML parser
library.
This package makes use of the GNU Autotools.
Vicare Scheme needs to be compiled with FFI support enabled, because
Expat heavily relies on C callbacks.
The latest version of this package can be downloaded from Github:
<https://bitbucket.org/marcomaggi/vicare-expat/downloads>
the home page of the Vicare project is at:
<http://marcomaggi.github.io/vicare.html>
development takes place at:
<http://github.com/marcomaggi/vicare-expat/>
and as backup at:
<https://bitbucket.org/marcomaggi/vicare-expat/>
The last time the author bothered to update this paragraph, he had
tested Expat version 2.2.0; the Expat library is available at:
<http://expat.sourceforge.net/>
notice that unofficial Expat documentation in Texinfo format is
available in the Nimby-Doc project at:
<http://github.com/marcomaggi/nimby-doc>
and also online:
<http://marcomaggi.github.io/docs/expat.html>
Expat must be compiled to handle UTF-8 strings.
Notes for revision 0.4d1
------------------------
* Ensure compatibility with Vicare Scheme 0.4d1.
Notes for revision 0.4d0
------------------------
* Ugly step down of the major.minor version numbers to match the version
numbers of the Vicare Scheme package that must be used with
Vicare/Expat.
* Support for Nausicaa is on hold: the libraries are not installed.
Notes for revision 2.0d0
------------------------
* Updated to and dependent on Vicare Scheme 0.3.
Notes for revision 1.0b4
------------------------
* No new code.
* The GNU Autotools infrastructure has been revised to use Automake's
parallel test harness and adjust the installation path of Scheme
libraries to:
$(libdir)/vicare-scheme
Notes for revision 1.0b3
------------------------
* Fixed Autotools infrastructure.
* Code fixes to make it work under recent Vicare releases.
Notes for revision 1.0b2
------------------------
* Changed installation directory for Scheme libraries from
$(libdir)/vicare to $(libdir)/scheme.
Notes for revision 1.0b1
------------------------
* Bug fix release. The garbage collection hook to automatically free
XML parsers was not registered.
Notes for revision 1.0b0
------------------------
* Here is an example program:
#!r6rs
(import (vicare)
(vicare expat)
(vicare expat constants)
(prefix (vicare ffi) ffi.))
(define xml-utf8
(string->utf8
"<!-- this is a test document -->\
<stuff>\
<thing colour=\"yellow\">\
<alpha>one</alpha>\
<beta>two</beta>\
</thing>\
<thing>\
<alpha>123</alpha>\
<beta>456</beta>\
</thing>\
</stuff>"))
(define (start-callback data element attributes)
(let ((element (ffi.cstring->string element))
(attributes (ffi.argv->strings attributes)))
(pretty-print (list 'start element attributes))))
(define (end-callback data element)
(let ((element (ffi.cstring->string element)))
(pretty-print (list 'end element))))
(define (cdata-callback data buf.ptr buf.len)
(let ((text (ffi.cstring->string buf.ptr buf.len)))
(pretty-print (list 'cdata text))))
(define (comment-callback data cstr)
(let ((text (ffi.cstring->string cstr)))
(pretty-print (list 'comment text))))
(let ((parser (XML_ParserCreate))
(start (XML_StartElementHandler start-callback))
(end (XML_EndElementHandler end-callback))
(cdata (XML_CharacterDataHandler cdata-callback))
(comment (XML_CommentHandler comment-callback)))
(XML_SetElementHandler parser start end)
(XML_SetCharacterDataHandler parser cdata)
(XML_SetCommentHandler parser comment)
(XML_Parse parser xml-utf8 #f #t)
(ffi.free-c-callback start)
(ffi.free-c-callback end)
(ffi.free-c-callback cdata)
(ffi.free-c-callback comment))
(flush-output-port (current-output-port))
which prints:
(comment " this is a test document ")
(start "stuff" ())
(start "thing" ("colour" "yellow"))
(start "alpha" ())
(cdata "one")
(end "alpha")
(start "beta" ())
(cdata "two")
(end "beta")
(end "thing")
(start "thing" ())
(start "alpha" ())
(cdata "123")
(end "alpha")
(start "beta" ())
(cdata "456")
(end "beta")
(end "thing")
(end "stuff")
* The documentation mentions the Nausicaa/Expat package, which has been
not yet released to support this backend.
### end of file
# Local Variables:
# mode: text
# fill-column: 72
# paragraph-start: "*"
# End: