OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: My review of genx.h

[ Lists Home | Date Index | Thread Index ]

Addressing issues not addressed elsewhere

On Jan 22, 2004, at 10:14 AM, Rich Salz wrote:

> Follow the standard open-modify-close model.  Support only one 
> document per genxWriter object.  That gets rid of genxNew; it would 
> also get rid of genxClose if it existed.  (See, I told you the current 
> model is too complicated. :)  Look at unix open syscall; flags specify 
> calling sequence.

Here's my thinking.  Genx is going to need a table for ascertaining 
which codepoints are legal Unicode characters, name characters, and so 
on.  I had the notion that rather than precompiling this I would cook 
it all up in code in a little one-time initializer routine.  Thus genx 
would have no static data, which would make it easier to compile into, 
for example Gnumacs and some embedded systems.  Thus you'd rather have 
a writer object that you generate multiple documents from.  On the 
other hand, if you don't mind having a precompiled table, then you're 
right, this eliminates one whole set of calls.

Am I going too far here?

> As someone else said, use typed opaque pointers:
>    typedef struct genxWriter_struct* genxWriter;

D'oh, that should have gone in the list of no-brainers.  Of course.

> Flags include:
>     gxoFILE -- next argument is FILE* for output
>     gxoNOPROLOG -- don't generate XML prolog
>     gxoSTANDALONE -- output "standalone='yes" in prolog
>     gxoABORT -- call abort() on any error (for debugging mode)
>     gxoFIXAMP -- turn & and < into &amp; and &lt;
>                  (perhaps gxoNOFIXMAP, I don't care)

I'm not too enthused about these, with the exception of the ABORT 
option, which could be a godsend at debugging time.

> genxScanUTF8 is a bad name -- looks to much like sscanf() et al.  
> Again, I'd merge that and the Check functions into the single Valid 
> predicate.

Yep, should be check not scan.

> How important is single-character output, really?  Making them use a 
> temporary buffer is not very inconvenient.  And if you believe must 
> single-char output will be in some kind of loop, anyway...

I'd use it all the time for odd characters by U+XXXX number

Cheers, Tim Bray  http://www.tbray.org/ongoing/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS