Re: Using a C function with command line parameters

2011-07-05 Thread Steven Schveighoffer
On Tue, 05 Jul 2011 00:29:14 -0400, Jonathan Sternberg wrote: It's one of the applications that consumes command line arguments. So if I wanted to implement this, a copy of the D strings (and null terminated) would have to be made. I would also likely need to add another slot to the comman

Re: Using a C function with command line parameters

2011-07-04 Thread Jacob Carlborg
On 2011-07-04 18:59, Steven Schveighoffer wrote: On Mon, 04 Jul 2011 12:51:48 -0400, Jacob Carlborg wrote: On 2011-07-04 16:31, Jonathan Sternberg wrote: glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be ab

Re: Using a C function with command line parameters

2011-07-04 Thread Jonathan Sternberg
It's one of the applications that consumes command line arguments. So if I wanted to implement this, a copy of the D strings (and null terminated) would have to be made. I would also likely need to add another slot to the command line arguments as usually the command line is null terminated for C

Re: Using a C function with command line parameters

2011-07-04 Thread Steven Schveighoffer
On Mon, 04 Jul 2011 12:51:48 -0400, Jacob Carlborg wrote: On 2011-07-04 16:31, Jonathan Sternberg wrote: glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be able to write a D file with extern (C) on the

Re: Using a C function with command line parameters

2011-07-04 Thread Jacob Carlborg
On 2011-07-04 16:31, Jonathan Sternberg wrote: glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be able to write a D file with extern (C) on the glut functions. How would I wrap this function to be used with

Re: Using a C function with command line parameters

2011-07-04 Thread Steven Schveighoffer
On Mon, 04 Jul 2011 10:39:07 -0400, Steven Schveighoffer wrote: On Mon, 04 Jul 2011 10:31:58 -0400, Jonathan Sternberg wrote: glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be able to write a D f

Re: Using a C function with command line parameters

2011-07-04 Thread Steven Schveighoffer
On Mon, 04 Jul 2011 10:31:58 -0400, Jonathan Sternberg wrote: glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be able to write a D file with extern (C) on the glut functions. How would I wrap this f

Using a C function with command line parameters

2011-07-04 Thread Jonathan Sternberg
glut has the function: void glutInit( int* pargc, char** argv ); In order to use it. Since D has an ABI compatible with C, I should be able to write a D file with extern (C) on the glut functions. How would I wrap this function to be used with D arrays? Such as: int main(string[] args) {