www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2119] New: Please provide example of interfacing to C struct

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2119

           Summary: Please provide example of interfacing to C struct
           Product: D
           Version: 2.014
          Platform: PC
               URL: interfaceToC.html
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jlquinn optonline.net


It would be nice to see an example of exporting a C struct to D, such as that
returned by stat().


-- 
May 20 2008
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
<d-bugmail puremagic.com> wrote in message 
news:bug-2119-3 http.d.puremagic.com/issues/...
 http://d.puremagic.com/issues/show_bug.cgi?id=2119

           Summary: Please provide example of interfacing to C struct
           Product: D
           Version: 2.014
          Platform: PC
               URL: interfaceToC.html
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jlquinn optonline.net


 It would be nice to see an example of exporting a C struct to D, such as 
 that
 returned by stat().

D structs are, by design, binary-compatible with C structs. You just.. write it. Also see the sections on structs here: http://www.digitalmars.com/d/1.0/htomodule.html
May 22 2008