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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   NULL in C (was RE: [xml-dev] Why would MS want to make XML break on UNI

[ Lists Home | Date Index | Thread Index ]
  • To: "Rick Jelliffe" <ricko@allette.com.au>,<xml-dev@lists.xml.org>
  • Subject: NULL in C (was RE: [xml-dev] Why would MS want to make XML break on UNIX, Perl, Python, etc ?)
  • From: "Michael Rys" <mrys@microsoft.com>
  • Date: Fri, 21 Dec 2001 15:02:04 -0800
  • Thread-index: AcGJ/I2kPfLyv6jwSEuy0kdqdvoZdwAdeLBw
  • Thread-topic: NULL in C (was RE: [xml-dev] Why would MS want to make XML break on UNIX, Perl, Python, etc ?)

This is going off-topic a bit, but two ways to represent 0C in C strings
are: 

- Do not use *char but operate on the byte level. Since C let's you work
on a string even if it contains 0C (although not with the standard
string libraries, functions and operations), you could return a struct
that gives the length and the memory area.

Thus 'a0Cb0C0Cd' would become (6, 'a0Cb0C0Cd')

- Use an array of strings where every 0C will move to the next item and
give length of array. You will need a sentinel at the end for the last
0C. 

Thus 'a0Cb0C0Cd' would become (4, 'a0C', 'b0C', '0C, 'd0C')

So it is doable, but not easy...

Best regards
Michael





 

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

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