Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 22, 2004 Carbon for D | ||||
---|---|---|---|---|
| ||||
I'm rather inexperienced in making interfaces for D. I'm trying to make a carbon interface for D. I tried SWIG with D but I get tons of errors in the interface file i made via: gcc Carbon_stub.h -E -framework ..../Carbon.framework. //Which basically leaves me with one header file for all of Carbon.I added a %module Carbon and tried to get it to generate me an interface. Am I even going about this in a sane manor? Has anyone already done this? I tried to do this by hand before but there's nearly 900,000 lines of code in this file. |
July 22, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sha Chancellor | In message <cdp6k6$1286$1@digitaldaemon.com> Sha Chancellor <schancel@pacific.net> wrote: >I'm rather inexperienced in making interfaces for D. I'm trying to >made via: >gcc Carbon_stub.h -E -framework ..../Carbon.framework. //Which >interface. >Am I even going about this in a sane manor? Has anyone already done >this? I tried to do this by hand before but there's nearly 900,000 lines >of code in this file. >. > Whoops this was supposed to go into digitalmars.d. |
July 23, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sha Chancellor | Sha Chancellor schrieb:
> Whoops this was supposed to go into digitalmars.d.
No, this newsgroup is quite right. All people who are non-x86 are here.
Look for "docoa" in this newsgroup by Owen "resistor".
-eye
|
July 25, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Minkov | Carbon isn't really my area of expertise and isn't part of Docoa, but I'll see if I can help. Carbon is a pure C API, so all you have to do is prototype the C functions and structs inside a D module, and you're good to go. Quite frankly, it'd be a lot of work to make working prototypes for all of Carbon. So unless that's actually your intent, I'd suggest just prototype the functions you intend to use. Good luck! Owen In article <cdquos$1s39$1@digitaldaemon.com>, Ilya Minkov says... > >Sha Chancellor schrieb: > >> Whoops this was supposed to go into digitalmars.d. > >No, this newsgroup is quite right. All people who are non-x86 are here. > >Look for "docoa" in this newsgroup by Owen "resistor". > >-eye |
July 25, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to resistor AT mac DOT com | I suppose that's probably the best way for me to handle it. Go a bit at a time. I tried preprocessing Carbon/Carbon.h and running that through SWIG. But no go. I'll see how doing it one function at a time goes :) In article <cdvgv5$1n3r$1@digitaldaemon.com>, resistor AT mac DOT com says... > >Carbon isn't really my area of expertise and isn't part of Docoa, but I'll see if I can help. > >Carbon is a pure C API, so all you have to do is prototype the C functions and structs inside a D module, and you're good to go. Quite frankly, it'd be a lot of work to make working prototypes for all of Carbon. So unless that's actually your intent, I'd suggest just prototype the functions you intend to use. > >Good luck! > >Owen > >In article <cdquos$1s39$1@digitaldaemon.com>, Ilya Minkov says... >> >>Sha Chancellor schrieb: >> >>> Whoops this was supposed to go into digitalmars.d. >> >>No, this newsgroup is quite right. All people who are non-x86 are here. >> >>Look for "docoa" in this newsgroup by Owen "resistor". >> >>-eye > > |
July 25, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sha Chancellor | "Sha Chancellor" <schancel@pacific.net> escribió en el mensaje news:ce1ac5$2qj5$1@digitaldaemon.com | I suppose that's probably the best way for me to handle it. Go a bit at a time. | I tried preprocessing Carbon/Carbon.h and running that through SWIG. But no go. | I'll see how doing it one function at a time goes :) | | In article <cdvgv5$1n3r$1@digitaldaemon.com>, resistor AT mac DOT com says... || || Carbon isn't really my area of expertise and isn't part of Docoa, but I'll see || if I can help. || || Carbon is a pure C API, so all you have to do is prototype the C functions and || structs inside a D module, and you're good to go. Quite frankly, it'd be a lot || of work to make working prototypes for all of Carbon. So unless that's actually || your intent, I'd suggest just prototype the functions you intend to use. || || Good luck! || || Owen I know nothing about Carbon, but I have a question regarding to what you want to do: if Carbon is a "pure C API" (as Owen said), why are you using SWIG? Isn't SWIG supposed to be for C++ code? With a bit of luck, even the pure preprocessor output can be accepted by the D compiler (gdc in this case, I assume), otherwise you'll have to tweak it a bit. Now, of course, the ideal solution would be for someone (not me, sorry) to write an automatic C header to D import module converter, the everyone could use it for any C library. Are you up for it? ;) ----------------------- Carlos Santander Bernal |
July 25, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | http://www.dsource.org/projects/h2d/ -Owen In article <ce1cql$2s6s$1@digitaldaemon.com>, Carlos Santander B. says... > >"Sha Chancellor" <schancel@pacific.net> escribió en el mensaje >news:ce1ac5$2qj5$1@digitaldaemon.com >| I suppose that's probably the best way for me to handle it. Go a bit at a >time. >| I tried preprocessing Carbon/Carbon.h and running that through SWIG. But >no go. >| I'll see how doing it one function at a time goes :) >| >| In article <cdvgv5$1n3r$1@digitaldaemon.com>, resistor AT mac DOT com >says... >|| >|| Carbon isn't really my area of expertise and isn't part of Docoa, but >I'll see >|| if I can help. >|| >|| Carbon is a pure C API, so all you have to do is prototype the C >functions and >|| structs inside a D module, and you're good to go. Quite frankly, it'd be >a lot >|| of work to make working prototypes for all of Carbon. So unless that's >actually >|| your intent, I'd suggest just prototype the functions you intend to use. >|| >|| Good luck! >|| >|| Owen > >I know nothing about Carbon, but I have a question regarding to what you >want to do: if Carbon is a "pure C API" (as Owen said), why are you using >SWIG? Isn't SWIG supposed to be for C++ code? With a bit of luck, even the >pure preprocessor output can be accepted by the D compiler (gdc in this >case, I assume), otherwise you'll have to tweak it a bit. >Now, of course, the ideal solution would be for someone (not me, sorry) to >write an automatic C header to D import module converter, the everyone could >use it for any C library. Are you up for it? ;) > >----------------------- >Carlos Santander Bernal > > |
July 26, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to resistor AT mac DOT com | "resistor AT mac DOT com" <resistor_member@pathlink.com> escribió en el mensaje news:ce1h6a$2upn$1@digitaldaemon.com | http://www.dsource.org/projects/h2d/ | | -Owen | But it seems sooooo dead.... ----------------------- Carlos Santander Bernal |
July 27, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." wrote: > "Sha Chancellor" <schancel@pacific.net> escribió en el mensaje > news:ce1ac5$2qj5$1@digitaldaemon.com > | I suppose that's probably the best way for me to handle it. Go a bit at a > time. > | I tried preprocessing Carbon/Carbon.h and running that through SWIG. But > no go. > | I'll see how doing it one function at a time goes :) > | > | In article <cdvgv5$1n3r$1@digitaldaemon.com>, resistor AT mac DOT com > says... > || > || Carbon isn't really my area of expertise and isn't part of Docoa, but > I'll see > || if I can help. > || > || Carbon is a pure C API, so all you have to do is prototype the C > functions and > || structs inside a D module, and you're good to go. Quite frankly, it'd be > a lot > || of work to make working prototypes for all of Carbon. So unless that's > actually > || your intent, I'd suggest just prototype the functions you intend to use. > || > || Good luck! > || > || Owen > > I know nothing about Carbon, but I have a question regarding to what you > want to do: if Carbon is a "pure C API" (as Owen said), why are you using > SWIG? Isn't SWIG supposed to be for C++ code? With a bit of luck, even the > pure preprocessor output can be accepted by the D compiler (gdc in this > case, I assume), otherwise you'll have to tweak it a bit. > Now, of course, the ideal solution would be for someone (not me, sorry) to > write an automatic C header to D import module converter, the everyone could > use it for any C library. Are you up for it? ;) > > ----------------------- > Carlos Santander Bernal I have been looking into using SWIG to interface both C and C++ to D. The basic work had been done by Andy Friesen. SWIG provides a way of generating the interfaces for C++ or C. It is true that for C it generates a layer of C code which could be avoided, but it would make it quick to generate a lot of interface functions, selecting the ones you want from a big header file. See http://www.prowiki.org/wiki4d/wiki.cgi?DwithSwig for some details John |
July 27, 2004 Re: Carbon for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Fletcher | In article <41062AEB.E7B0E64C@aston.ac.uk>, John Fletcher <J.P.Fletcher@aston.ac.uk> wrote: > I have been looking into using SWIG to interface both C and C++ to D. The > basic > work had been done by Andy Friesen. > > SWIG provides a way of generating the interfaces for C++ or C. It is true > that > for C it generates a layer of C code which could be avoided, but it would > make > it quick to generate a lot of interface functions, selecting the ones you > want > from a big header file. > > See http://www.prowiki.org/wiki4d/wiki.cgi?DwithSwig for some details > > John I used Andy Friesen's version and it didn't understand structs embedded in structs and gave me hundreds of errors. Also, I still see no link to download your modified version of SWIG from that page. Sha |
Copyright © 1999-2021 by the D Language Foundation