Re: [libcroco-list] Some library user feedback...



I intend to replace the class cr-input by a new class cr-core-input (the lib is gonna be separated into cr-core and cr-semantic in a not so far future), that should just handle buffering for performance, position reporting (line, byte offset, and byte offset in the line, column is gonna disapear, it is not something easily defined with all the strange characters in Unicode) and UTF-8 decoding and nothing else.

There will be two convenience functions for handling files and simple guchar * buffer, and another one with three parameters
void *cookie,
enum CRStatus (*feed)(void *cookie, guchar *dest, gulong file_offset, gulong size),
void (*close)(void *cookie)

Maybe it needs some flags to specify if the file is seekable  or not (a socket stream for example, where you must buffer the complete file inside cr-core-input or at least enough so that the lexer can backup if needed (it shouldn't need but the lexer is far from optimal, I'm looking at re2c.org to update it.

My goal is for the library to not have any coupling with an exterior project but glib.
The cookie is of course to feed the croco ;-)

2007/1/18, Dimitur Kirov <dkirov gmail com>:

Bjoern Hoehrmann <derhoermi gmx net> wrote:
>   * The IO and transcoding routines are somewhat dated and in fact a
>     bit broken, I gave an example earlier on the list where it runs
>     into an infinite loop trying to decode a ISO-8859-1 encoded doc
>     as UTF-8; this should never happen. I think there are some glib
>     routines that could replace much of the current code. I also note
>     that IO is apparently the main bottleneck, performance improve-
>     ments there would be very welcome. Perhaps it might make sense if
>     there is a way for the caller to gurantee the input is perfectly
>     valid UTF-8, then some of the normal checks could be skipped.

Just to drop an idea here. Could you use some outer library for net routines, like `libsoup`. I guess in `libsoup` all of the problems of doing network IO are solved, or at least already faced. In general, it will be good to have the ability to define a custom subset of functions for doing the IO. If `libcroco` is used within some code that is also doing network IO one can get use of caching dns lookups, proxy settings, certificate verifications, persistent connections, etc.

--
Benjamin Dauvergne
PhD Student of the Tropics project
INRIA Sophia-Antipolis - France

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]