diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2021-06-26 19:52:58 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2021-06-26 19:52:58 -0300 |
commit | bace9b0d34de842544e9ffa5989f433ec177dde7 (patch) | |
tree | 27053ca740e3a3fe611f6c1767b931243e655e6f /src/internals.rs | |
parent | 7a9a4290248ee9019303e9d866f75e4104fe51da (diff) |
Use a different field for userdata
Diffstat (limited to 'src/internals.rs')
-rw-r--r-- | src/internals.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/internals.rs b/src/internals.rs index 1975182..2ae8bd0 100644 --- a/src/internals.rs +++ b/src/internals.rs @@ -89,8 +89,15 @@ pub struct Ph { hook: *const HexchatHook) -> *const libc::c_void, pub hexchat_print: unsafe extern "C" fn(ph: *mut HexchatPlugin, text: *const libc::c_char), - pub hexchat_printf_do_not_use: unsafe extern "C" fn(ph: *mut HexchatPlugin, - format: *const libc::c_char, ...), + // this is VERY NAUGHTY. + // TODO see if hexchat's gonna provide a proper userdata field at some point. + // it appears this function isn't used anywhere by hexchat so we reuse its pointer. + // on linux, it's a dummy anyway. + // another option would've been to use one of the printf functions. + // TODO test this on platforms hexchat doesn't build on, like AVR. + pub userdata: *mut libc::c_void, + /*pub hexchat_printf_do_not_use: unsafe extern "C" fn(ph: *mut HexchatPlugin, + format: *const libc::c_char, ...),*/ pub hexchat_command: unsafe extern "C" fn(ph: *mut HexchatPlugin, command: *const libc::c_char), pub hexchat_commandf_do_not_use: unsafe extern "C" fn(ph: *mut HexchatPlugin, @@ -134,17 +141,10 @@ pub struct Ph { handle: *const PluginGuiHandle), pub hexchat_emit_print: unsafe extern "C" fn(ph: *mut HexchatPlugin, event_name: *const libc::c_char, ...) -> libc::c_int, - // this is VERY NAUGHTY. - // TODO see if hexchat's gonna provide a proper userdata field at some point. - // it appears this function isn't used anywhere by hexchat so we reuse its pointer. - // on linux, it's a dummy anyway. - // another option would've been to use one of the printf functions. - // TODO test this on platforms hexchat doesn't build on, like AVR. - pub userdata: *mut libc::c_void, - /*pub hexchat_read_fd: unsafe extern "C" fn(ph: *mut HexchatPlugin, + pub hexchat_read_fd: unsafe extern "C" fn(ph: *mut HexchatPlugin, src: *const libc::c_void, buf: *mut char, - len: *mut libc::c_int) -> libc::c_int,*/ + len: *mut libc::c_int) -> libc::c_int, pub hexchat_list_time: unsafe extern "C" fn(ph: *mut HexchatPlugin, xlist: *const HexchatList, name: *const libc::c_char) -> libc::time_t, |