[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Genx


passing from incompatible pointer type
> // for making UTF-8 strings
> > typedef unsigned char utf8Byte;

I would prefer this to be just char, the whole point behind UTF-8 is then
you don't need to know that it is it is just char *. Convertion to unsigned char *
is due to arithmetics, but arithemtics is opaque.

> // writer object
> typedef void * genxWriter;

This is C; any type typedef'ed to void * allows any other type.  I would prefer it to 
be opaque, but not void:

typedef struct GenxWriter *genxWriter;

to get error 'passing from incompatible pointer type'.

> void genxStartDocument(genxWriter w, FILE * file);

While FILE * is 'standard', it is often incovenient to use it; I would prefer
to have

void genxStartDocument(genxWriter w, char *buf, int size, void (*bytesReady)(int n,void *userData))

size is the size of the buffer, bytesReady is passed actual number of bytes available.
Much more freedom to use.

> int genxText(genxWriter w, const utf8Byte * text);
> int genxTextW(genxWriter w, const codePoint * text);

passing data in buffers oftern requires number of bytes or characters to be passed;
consider getting data from Expat and writing it to the output.

int genxText(genxWriter w, const utf8Byte * text, int nbytes);
int genxTextW(genxWriter w, const codePoint * text, int nchars);

instead?

> int genxCharacter(genxWriter w, codePoint c);

What's the use case for this?

> int genxScanUTF8(genxWriter w, const utf8Byte * s);

1) again, length. s/)/,int nbytes)/
2) what if I am reading from a stream and the last utf sequence is not read fully?


David Tolpin

  • Follow-Ups:
    • Re: Genx
      • From: Joe Gregorio <joe@b...>
    • Re: Genx
      • From: Adam Turoff <ziggy@p...>
  • References:
    • Re: Genx
      • From: Joe Gregorio <joe@b...>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.