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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Refreshed genx.h, plus some plans

[ Lists Home | Date Index | Thread Index ]

Tim Bray scripsit:

> Most of the changes are obvious and reflect the discussion here, but I 
> probably missed something so another pair of eyes would be welcome.

You should clarify that if the allocator is NULL, then genx allocates
using malloc() *and* frees using free(), ignoring the setting of the
freer (which should be called the deallocator).

For UTR_8 read UTF_8 in one case.

On genxCharacter: For "U+XXXX notation" read "U+XXXX or U+XXXXX notation",
to eliminate the suggestion that nothing above U+FFFF will work.
Similarly, for "Unicode character value" read "Unicode scalar value",
the term defined in the standard.  Make the second argument a long to
defend against retrograde (but conformant) platforms where int is 16 bits;
it may waste a little bit on 64-bit platforms, but not much.

> int genxText(genxWriter w, const utf8Byte * start);
> int genxCountedText(genxWriter w, const utf8Byte * start, int 
> byteCount);
> int genxBoundedText(genxWriter w, const utf8Byte * start, utf8Byte * 
> end);

Pick one of the last two: having both is API bloat, and each is a
one-liner given the other.  I have no preference.

> The first case is null-terminated.  This is going to add maybe ten 
> lines of (easy) code to the implementation and it gives everyone what 
> they want, and it will be faster too.

+1

> Then the calls with namespaces lose the separate prefix argument, and 
> genx fills in the declarations as appropriate.  This feels more like 
> the way that people actually think about writing and reading XML docs.  

+1

> NEW: Making it fast

1) Premature optimization is the root of all evil.
2) Make it right before you make it fast.
3) You can't hope to beat printf for speed, and it's your main
   competitor -- so don't even try.

-- 
You let them out again, Old Man Willow!                 John Cowan
What you be a-thinking of?  You should not be waking!   jcowan@reutershealth.com
Eat earth!  Dig deep!  Drink water!  Go to sleep!       www.reutershealth.com
Bombadil is talking.                                    www.ccil.org/~cowan




 

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

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