From: N. Raghavendra
Subject: FFI to libxml2: first steps
Date: 
Message-ID: <86prby1ex9.fsf@griffin.campus.hri>
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.

From: Vsevolod Dyomkin
Subject: Re: FFI to libxml2: first steps
Date: 
Message-ID: <974d0b72-f841-4715-90cb-1ea929771660@k19g2000yqn.googlegroups.com>
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
From: N. Raghavendra
Subject: Re: FFI to libxml2: first steps
Date: 
Message-ID: <86hbx7lsat.fsf@griffin.campus.hri>
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.
From: N. Raghavendra
Subject: Re: FFI to libxml2: first steps
Date: 
Message-ID: <86fxcu1eje.fsf@griffin.campus.hri>
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.
From: Robert Uhl
Subject: Re: FFI to libxml2: first steps
Date: 
Message-ID: <m37hy5n0oa.fsf@latakia.octopodial-chrome.com>
"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
From: N. Raghavendra
Subject: Re: FFI to libxml2: first steps
Date: 
Message-ID: <86d47vls7e.fsf@griffin.campus.hri>
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.