-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notably, this lets us use bytestring literals (with a slightly awkward double-cast).
- Loading branch information
Showing
2 changed files
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#![feature(libc)] | ||
|
||
extern crate libc; | ||
|
||
mod bash; | ||
|
||
extern fn builtin_lulz(args: *mut bash::word_list) -> libc::c_int { | ||
extern fn builtin_lulz(_: *mut bash::word_list) -> libc::c_int { | ||
println!("lulz"); | ||
0 | ||
} | ||
|
||
#[no_mangle] | ||
pub static mut lulz_struct: bash::builtin = bash::builtin { | ||
name: &['l' as i8, 'u' as i8, 'l' as i8, 'z' as i8, 0 as i8] as *const i8, | ||
name: b"lulz\0" as *const u8 as *const libc::c_char, | ||
function: builtin_lulz, | ||
flags: bash::BUILTIN_ENABLED, | ||
long_doc: 0 as *const *const i8, | ||
short_doc: &['l' as i8, 'o' as i8, 'l' as i8, 'w' as i8, 'u' as i8, 't' as i8, 0 as i8] as *const i8, | ||
long_doc: 0 as *const *const libc::c_char, | ||
short_doc: b"lolwut\0" as *const u8 as *const libc::c_char, | ||
handle: 0 as *const i8, | ||
}; |