|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: My review of genx.h
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 & and < > (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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








