[Home] [By Thread] [By Date] [Recent Entries]


David Tolpin wrote:

> Joe Gregorio:
> 
>>David Tolpin wrote: 
>>
>>>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);
>>
>>This is a C interface and null terminated strings are
>>the standard way of handling this, the nbytes would
>>just be redundant information. If the implmentation of
>>genxText() needs the length it can call strlen(text), 
>>if it doesn't need the length then why force it to 
>>be passed in?
> 
> 
> Have you looked at the API of James Clark's Expat?

Based on your question I just took a look at
Expat and saw a mix of calls in xmlparse.h,
some using strings that are null terminated, 
some that are not:

  /* s is not 0 terminated. */
  typedef void (*XML_CharacterDataHandler)(void *userData,
					 const XML_Char *s,
					 int len);

  /* target and data are 0 terminated */
  typedef void (*XML_ProcessingInstructionHandler)(void *userData,
						 const XML_Char *target,
						 const XML_Char *data);

  /* data is 0 terminated */
  typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);


Now this was a quick look and I could be poking
around in the wrong file, please point me
it the right direction if that's the case.

	Thanks,
	-joe

-- 
http://BitWorking.org
http://WellFormedWeb.org


  • Follow-Ups:
    • Re: Genx
      • From: "Karl Waclawek" <karl@w...>
    • Re: Genx
      • From: David Tolpin <dvd@d...>
  • References:
    • Re: Genx
      • From: David Tolpin <dvd@d...>
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member