diff options
| author | bors <bors@rust-lang.org> | 2014-04-25 23:31:25 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-25 23:31:25 -0700 |
| commit | a5d203579bc778656902629fa59e2baca012ae0a (patch) | |
| tree | 8a49b9e4bfa26c3c583aeee97ce4901b6539ad25 /src | |
| parent | cf3f9cf3f97a9d17e8a54d3223b19e24ff024d50 (diff) | |
| parent | e7ca1d1c678c856679e263e348efd9b19a1fb1af (diff) | |
| download | rust-a5d203579bc778656902629fa59e2baca012ae0a.tar.gz rust-a5d203579bc778656902629fa59e2baca012ae0a.zip | |
auto merge of #13758 : sodaplayer/rust/patch-1, r=alexcrichton
Rustdoc doesn't seem like it's converting the old format to a table as we can see here: http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface) This new format should fix that and it's also rendered by Github's markdown preview.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/complement-cheatsheet.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/doc/complement-cheatsheet.md b/src/doc/complement-cheatsheet.md index 784724e9a6c..84a000fce57 100644 --- a/src/doc/complement-cheatsheet.md +++ b/src/doc/complement-cheatsheet.md @@ -207,12 +207,12 @@ let _ = close(Door::<Closed>("front".to_owned())); // error: mismatched types: e ## C function signature conversions -Description C signature Equivalent Rust signature ----------------------- ---------------------------------------------- ------------------------------------------ -no parameters `void foo(void);` `fn foo();` -return value `int foo(void);` `fn foo() -> c_int;` -function parameters `void foo(int x, int y);` `fn foo(x: c_int, y: c_int);` -in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);` +| Description | C signature | Equivalent Rust signature | +|---------------------|-----------------------------------------------|------------------------------------------------| +| no parameters | `void foo(void);` | `fn foo();` | +| return value | `int foo(void);` | `fn foo() -> c_int;` | +| function parameters | `void foo(int x, int y);` | `fn foo(x: c_int, y: c_int);` | +| in-out pointers | `void foo(const int* in_ptr, int* out_ptr);` | `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);` | Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block. |
