www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - expat port to d

reply "Miguel Ferreira Simões" <kobold netcabo.pt> writes:
does anyone ported expat to D ?

Miguel
May 31 2004
next sibling parent "Zz" <Zz Zz.com> writes:
I was thinking about it sometime ago so I did a little research on different
XML Parsers out there and I came to the conclusion that CWXML which is
faster than Expat would be better to port if I ever came round to doing one.

I'm loaded with work for the next few months.

I just play with D in my free time.

Zz

"Miguel Ferreira Simões" <kobold netcabo.pt> wrote in message
news:c9g4dm$1els$1 digitaldaemon.com...
 does anyone ported expat to D ?

 Miguel

May 31 2004
prev sibling next sibling parent reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
I know Brad Anderson took a look at one point, but don't know how far he
really got with it. I'd very much like to see either a native port, or a D
bridge.

- Kris


"Miguel Ferreira Simões" <kobold netcabo.pt> wrote in message
news:c9g4dm$1els$1 digitaldaemon.com...
 does anyone ported expat to D ?

 Miguel

May 31 2004
parent Brad Anderson <brad dsource.dot.org> writes:
I did indeed attempt this port, but didn't know too much about function 
pointers and C in general, let alone D.  One can argue that not much has 
changed...

In any case, Cabal has started a project at dsource.org, called h2d. 
The title tells all, as this utility attempts to convert .h files to .d 
files and do the wrapping for you.

He said that he'd try to run expat through the tool after he finishes 
another lib (OpenGL, I think?)

Let me know if you want my attempt at converting expat.  It must be DMD 
0.65 - 0.70 range when I last tried.

BA

Kris wrote:
 I know Brad Anderson took a look at one point, but don't know how far he
 really got with it. I'd very much like to see either a native port, or a D
 bridge.
 
 - Kris
 
 
 "Miguel Ferreira Simões" <kobold netcabo.pt> wrote in message
 news:c9g4dm$1els$1 digitaldaemon.com...
 
does anyone ported expat to D ?

Miguel


May 31 2004
prev sibling next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Miguel Ferreira Simões wrote:
 does anyone ported expat to D ?
 
 Miguel

After Kris mentioned it on dsource.org, I tried to make a wrapper. I think I was making pretty good progress, but I ran into some syntax that I didn't know how to convert: XMLPARSEAPI(char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); I got stuck on parts like this, so I commented them out. I haven't tested it. I've just tried to get the file to compile with DMD (which it does now that I've commented out the parts I didn't understand). I've attached my latest efforts. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
May 31 2004
parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
 XMLPARSEAPI(char *)

just a return type, decorated with __declspec(dllimport) and so on. In this case, a char * return type.
 XML_GetInputContext(XML_Parser parser,

XML_Parser is a pointer alias to the struct. If this was a struct in the D version, then you'd have to make all the argument declaration be 'in' for pass-by-reference. Alternatively, you might be able to make that a class instead of a struct. - Kris "J C Calvarese" <jcc7 cox.net> wrote in message news:c9gepr$1t59$1 digitaldaemon.com...
 Miguel Ferreira Simões wrote:
 does anyone ported expat to D ?

 Miguel

After Kris mentioned it on dsource.org, I tried to make a wrapper. I think I was making pretty good progress, but I ran into some syntax that I didn't know how to convert: XMLPARSEAPI(char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); I got stuck on parts like this, so I commented them out. I haven't tested it. I've just tried to get the file to compile with DMD (which it does now that I've commented out the parts I didn't understand). I've attached my latest efforts. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/

May 31 2004
prev sibling parent reply "Pablo Aguilar" <paguilarg hotmail.com> writes:
 does anyone ported expat to D ?

Would a true port try and be faithful to the original expat (free function like) or would a class based approach be adequate? Or would a wrapper like JCC tried be better? I was looking for an interesting project to get myself into D, and I kinda liked this one I'm gonna give it a shot. Any suggestions?
Jun 02 2004
parent reply Brian Hammond <Brian_member pathlink.com> writes:
 does anyone ported expat to D ?

Would a true port try and be faithful to the original expat (free function like) or would a class based approach be adequate? Or would a wrapper like JCC tried be better? I was looking for an interesting project to get myself into D, and I kinda liked this one I'm gonna give it a shot. Any suggestions?

I did a little while back. Wasn't too hard but then again it's not tested 100%. The little testing I did it was with GDC on Mac OS X 10.3 http://brianhammond.com/expat-1.95.7-d-binding.tar.gz It does not provide a class based wrapper. It just uses function pointers. Brian
Jun 02 2004
parent reply "Pablo Aguilar" <paguilarg hotmail.com> writes:
 I did a little while back.  Wasn't too hard but then again it's not tested

 The little testing I did it was with GDC on Mac OS X 10.3

 http://brianhammond.com/expat-1.95.7-d-binding.tar.gz

 It does not provide a class based wrapper.  It just uses function

I guess I'll do it class based with delegates then, to make it different enough to be worth doing... thanks for the info...
Jun 02 2004
parent Brad Anderson <brad sankaty.dot.com> writes:
Pablo Aguilar wrote:
 
 I guess I'll do it class based with delegates then, to make it different
 enough to be worth doing... thanks for the info...

You may want to start with Kris Bell's Mango IO library. http://www.dsource.org/projects/mango BA
Jun 02 2004