www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4779] New: www.d-programming-language.org "Interfacing to C" should make clear how to do callbacks

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

           Summary: www.d-programming-language.org "Interfacing to C"
                    should make clear how to do callbacks
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: cruxic gmail.com


--- Comment #0 from AdamB <cruxic gmail.com> 2010-08-31 21:59:06 PDT ---
Callbacks are an essential part of interfacing with C code.  The "Interfacing
to C" document comes close to telling you how to setup a callback but assumes
the reader knows about the "function" keyword already.  In the section where it
says:

"C code can correspondingly call D functions, if the D functions use an
attribute that is compatible with the C compiler, most likely the extern
(C)..."

There should be an example showing how to setup the binding like so:

  extern (C) void registerSomeCallback(void function(int,int) yourFunc);

And then it should hyperlink to the "Delegates, Function Pointers, and
Closures" section in /function.html.

I'd be glad to make these changes myself if you like.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4779



--- Comment #1 from github-bugzilla puremagic.com 2012-12-08 10:06:01 PST ---
Commits pushed to master at
https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/2cb4d8d66fc5ee808662cb4cacd7ef704a2045af
Fixes Issue 4779 - Add Callback example.

https://github.com/D-Programming-Language/d-programming-language.org/commit/d98aede8e83d44f1c1065f4cf2aa540867f3af04
Merge pull request #209 from AndrejMitrovic/Fix4779

Issue 4779 - Add Callback example in interface to C docs

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4779


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2012