diff options
| author | bors <bors@rust-lang.org> | 2014-09-13 13:50:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-13 13:50:57 +0000 |
| commit | 079951ed2a0d11c9ccfb8023cc1a645a883f890f (patch) | |
| tree | e001b77f58de1f05ffd330c6372653166fad8180 /src/doc | |
| parent | 13475a0851afc66ca574874bfb16fde09afbe9d3 (diff) | |
| parent | d4b2edc3eeaa5b5fd4f83533c7ffe9f56744ba55 (diff) | |
auto merge of #17187 : damag/rust/ffi-guide-fixes, r=alexcrichton
Updates the callbacks section to refer to the right function name and fixes a couple of minor whitespace issues in the examples.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/guide-ffi.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/guide-ffi.md b/src/doc/guide-ffi.md index dd35a610e15..14e60b5ba08 100644 --- a/src/doc/guide-ffi.md +++ b/src/doc/guide-ffi.md @@ -209,7 +209,7 @@ A basic example is: Rust code: ~~~~no_run -extern fn callback(a:i32) { +extern fn callback(a: i32) { println!("I'm called from C with value {0}", a); } @@ -243,7 +243,7 @@ void trigger_callback() { } ~~~~ -In this example Rust's `main()` will call `do_callback()` in C, +In this example Rust's `main()` will call `trigger_callback()` in C, which would, in turn, call back to `callback()` in Rust. @@ -269,7 +269,7 @@ struct RustObject { // other members } -extern "C" fn callback(target: *mut RustObject, a:i32) { +extern "C" fn callback(target: *mut RustObject, a: i32) { println!("I'm called from C with value {0}", a); unsafe { // Update the value in RustObject with the value received from the callback |
