[cffi-devel] bits from a new tutorial

Stephen Compall s11 at member.fsf.org
Thu Dec 22 07:12:33 UTC 2005


I am writing a CFFI tutorial, to be integrated into the manual when it
is done if the maintainers will have it.  You can get the first half or
so in Texinfo format if you so desire at
http://csserver.evansville.edu/~sc87/cffi/tutorial.texi .  You can
integrate it into cffi-manual.texi for building (if you want to see TeX,
HTML, etc output) with a

@include tutorial.texi

For best results, put it where that comment about the manual needing a
tutorial is.  If you want curl.h and easy.h to follow along, they are in
the same directory.

Stuff left to be written about:

* Dealing with memory allocation.  The importance of the "Breaking the
abstraction" section should become clearer here.

* define-foreign-type for bits to be LOGIORed, then using that to type
the input to curl_global_init.

* Writing type translators.  This will be used to restrict
the :curl-easy-handle type.

* Callbacks.  This of course will be a :writefunction.

* I think that error CURLcodes should "translate" to conditions.
However, that is mostly macrology rather than new CFFI material, so I am
not sure it should be included.

* Some other stuff I can't remember right now.  It depends on what I can
reasonably introduce in the context of the example I've chosen.

I may also consider disjoining the TYPEs in the :curl-option definition.
After all, I'm breaking the abstraction, so I might as well make a
better one.

Some notes may be confusing at the moment.  If you see one, please tell
me anyway, in case it is not one I am thinking of.

There is a stray TODO, and I don't yet know how I'm going to type
curl_off_t portably.  I will probably just remove :off-t for this
tutorial.

Comments are of course welcome here, and especially on Freenode #lisp,
where I am S11001001.

-- 
Stephen Compall
http://scompall.nocandysw.com/blog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20051222/d28c2658/attachment.sig>


More information about the cffi-devel mailing list