diff options
author | defanor <defanor@uberspace.net> | 2023-10-07 20:29:00 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2023-10-07 20:29:00 +0300 |
commit | 430d97ddc6e68e62cc0f2e77319aaa92876f51eb (patch) | |
tree | b566aea000feebaac699b14de39c660e1e3f7e60 /src/rexmpp_xml.rs | |
parent | ccdb748c81abc9bb30b8989e27d22bbbb219f9a0 (diff) |
Use file descriptors instead of streams, update Rust sources
File descriptors tend to be easier to handle with FFI.
Diffstat (limited to 'src/rexmpp_xml.rs')
-rw-r--r-- | src/rexmpp_xml.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rexmpp_xml.rs b/src/rexmpp_xml.rs index 8938e57..90e312b 100644 --- a/src/rexmpp_xml.rs +++ b/src/rexmpp_xml.rs @@ -8,6 +8,7 @@ use std::fs::File; use std::io::Write; use super::{rexmpp}; +use super::{rexmpp_random}; // extern { // fn rexmpp_xml_parse (str: *mut c_char, str_len: c_int) -> *mut RexmppXML; @@ -585,13 +586,13 @@ fn rexmpp_xml_serialize (node_ptr: *const RexmppXML, #[no_mangle] pub extern "C" -fn rexmpp_xml_add_id (s: *mut rexmpp::Rexmpp, node: *mut RexmppXML) +fn rexmpp_xml_add_id (node: *mut RexmppXML) -> *mut RexmppXML { match CString::new("id") { Err(_) => return ptr::null_mut(), Ok(id_cstr) => { - let buf = unsafe { rexmpp::rexmpp_gen_id(s) }; + let buf = unsafe { rexmpp_random::rexmpp_random_id() }; if buf == ptr::null_mut() { return ptr::null_mut(); } |