I'd mentioned earlier on this list my attempt to define a basic FFI to
libxml2. I've gone a tiny bit further. Now, I can use the FFI to do
the first example in the libxml2 tutorial at
http://www.xmlsoft.org/tutorial/
[see the sections `Parsing the file', `Retrieving Element Content', and
`Appendix C. Code for Keyword Example']
I've put the FFI files at
http://www.retrotexts.net/tmp/libxml-clisp/
The entire set of files is available at
http://www.retrotexts.net/tmp/libxml-clisp.tar.gz
The Lisp code for the above example is at
http://www.retrotexts.net/tmp/libxml-clisp/examples/keyword.lisp
I'd appreciate any suggestions or comments on my attempt. At the moment
many of the Lisp functions have C pointers as arguments. I have to
Lispify the FFI in some way, so that the parameters are Lisp objects
rather than foreign addresses. I think this is vaguely put, and will
get back when I can formulate it more coherently. Meanwhile, this is an
interim report.
Regards,
Raghavendra.
PS: The keyword example above defines a function which takes an XML
filename as argument. The document in the file must have root element
`story'. The function finds nodes in the document of the form
storyinfo/keyword (where / denotes child), and returns their content as
a list of strings.
--
N. Raghavendra <·····@mri.ernet.in> | http://www.retrotexts.net/
Harish-Chandra Research Institute | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.
On Jul 18, 1:08 pm, "N. Raghavendra" <·····@mri.ernet.in> wrote:
> I'd mentioned earlier on this list my attempt to define a basic FFI to
> libxml2. I've gone a tiny bit further. Now, I can use the FFI to do
> the first example in the libxml2 tutorial at
>
> http://www.xmlsoft.org/tutorial/
>
> [see the sections `Parsing the file', `Retrieving Element Content', and
> `Appendix C. Code for Keyword Example']
>
> I've put the FFI files at
>
> http://www.retrotexts.net/tmp/libxml-clisp/
>
> The entire set of files is available at
>
> http://www.retrotexts.net/tmp/libxml-clisp.tar.gz
>
> The Lisp code for the above example is at
>
> http://www.retrotexts.net/tmp/libxml-clisp/examples/keyword.lisp
>
> I'd appreciate any suggestions or comments on my attempt. At the moment
> many of the Lisp functions have C pointers as arguments. I have to
> Lispify the FFI in some way, so that the parameters are Lisp objects
> rather than foreign addresses. I think this is vaguely put, and will
> get back when I can formulate it more coherently. Meanwhile, this is an
> interim report.
>
> Regards,
> Raghavendra.
>
> PS: The keyword example above defines a function which takes an XML
> filename as argument. The document in the file must have root element
> `story'. The function finds nodes in the document of the form
> storyinfo/keyword (where / denotes child), and returns their content as
> a list of strings.
>
> --
> N. Raghavendra <·····@mri.ernet.in> |http://www.retrotexts.net/
> Harish-Chandra Research Institute |http://www.mri.ernet.in/
> See message headers for contact and OpenPGP information.
btw, there's cl-libxml2
Cheers
At 2009-07-18T03:23:08-07:00, Vsevolod Dyomkin wrote:
> btw, there's cl-libxml2
Yes, I know. However, I don't use CFFI, and hence started working on a
CLISP FFI to the library.
Regards,
Raghavendra.
--
N. Raghavendra <·····@mri.ernet.in> | http://www.retrotexts.net/
Harish-Chandra Research Institute | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.
At 2009-07-18T15:38:50+05:30, N. Raghavendra wrote:
> I'd mentioned earlier on this list my attempt to define a basic FFI to
> libxml2.
I sent the above message to the wrong newsgroup by mistake. I am sorry
about that.
Raghavendra.
--
N. Raghavendra <·····@mri.ernet.in> | http://www.retrotexts.net/
Harish-Chandra Research Institute | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.
"N. Raghavendra" <·····@mri.ernet.in> writes:
> At 2009-07-18T15:38:50+05:30, N. Raghavendra wrote:
>
>> I'd mentioned earlier on this list my attempt to define a basic FFI to
>> libxml2.
>
> I sent the above message to the wrong newsgroup by mistake. I am sorry
> about that.
I think comp.lang.lisp is a great place to discuss this sort of thing!
--
Robert A. Uhl
Did you ever notice that everyone in favor of birth control has already
been born? --Benny Hill
At 2009-07-18T15:25:41-06:00, Robert Uhl wrote:
> I think comp.lang.lisp is a great place to discuss this sort of thing!
Thanks, I said it because the FFI is specific to CLISP. However,
comments and suggestions are welcome.
Regards,
Raghavendra.
--
N. Raghavendra <·····@mri.ernet.in> | http://www.retrotexts.net/
Harish-Chandra Research Institute | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.