[librsvg] Remove a bunch of unused functions



commit 643efe85e690074ba94c68fcecacf2cd73db49cc
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Dec 18 10:38:09 2018 -0600

    Remove a bunch of unused functions

 librsvg/rsvg-handle.c        |  2 -
 rsvg_internals/src/handle.rs | 98 --------------------------------------------
 rsvg_internals/src/io.rs     | 19 +--------
 rsvg_internals/src/lib.rs    |  4 --
 4 files changed, 1 insertion(+), 122 deletions(-)
---
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index 8ac1ad8d..a14a3313 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -163,10 +163,8 @@ extern RsvgNode *rsvg_handle_rust_get_root (RsvgHandleRust *raw_handle);
 extern GFile *rsvg_handle_rust_get_base_gfile (RsvgHandleRust *raw_handle);
 extern RsvgNode *rsvg_handle_defs_lookup (RsvgHandle *handle, const char *name);
 extern gboolean rsvg_handle_rust_node_is_root(RsvgHandleRust *raw_handle, RsvgNode *node);
-extern void rsvg_handle_rust_steal_result (RsvgHandleRust *raw_handle, RsvgXmlState *xml);
 extern guint rsvg_handle_rust_get_flags (RsvgHandleRust *raw_handle);
 extern void rsvg_handle_rust_set_flags (RsvgHandleRust *raw_handle, guint flags);
-extern void rsvg_handle_rust_set_load_state (RsvgHandleRust *raw_handle, RsvgHandleState state);
 extern RsvgHandleState rsvg_handle_rust_get_load_state (RsvgHandleRust *raw_handle);
 extern gboolean rsvg_handle_rust_read_stream_sync (RsvgHandle *handle,
                                                    GInputStream *stream,
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 28857983..8601bd2f 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -1,5 +1,4 @@
 use std::cell::{Cell, Ref, RefCell};
-use std::error::Error;
 use std::ptr;
 use std::rc::Rc;
 use std::slice;
@@ -555,93 +554,6 @@ pub unsafe extern "C" fn rsvg_handle_defs_lookup(
     }
 }
 
-#[no_mangle]
-pub unsafe extern "C" fn rsvg_handle_acquire_data(
-    handle: *mut RsvgHandle,
-    href_str: *const libc::c_char,
-    out_len: *mut usize,
-    error: *mut *mut glib_sys::GError,
-) -> *mut libc::c_char {
-    assert!(!href_str.is_null());
-    assert!(!out_len.is_null());
-
-    let href_str: String = from_glib_none(href_str);
-
-    let rhandle = get_rust_handle(handle);
-
-    let aurl = match AllowedUrl::from_href(&href_str, rhandle.base_url.borrow().as_ref()) {
-        Ok(a) => a,
-        Err(e) => {
-            set_gerror(error, 0, &format!("{}", e));
-            return ptr::null_mut();
-        }
-    };
-
-    match acquire_data(handle, &aurl) {
-        Ok(binary) => {
-            if !error.is_null() {
-                *error = ptr::null_mut();
-            }
-
-            *out_len = binary.data.len();
-            io::binary_data_to_glib(&binary, ptr::null_mut(), out_len)
-        }
-
-        Err(e) => {
-            set_gerror(error, 0, e.description());
-            *out_len = 0;
-            ptr::null_mut()
-        }
-    }
-}
-
-#[no_mangle]
-pub unsafe extern "C" fn rsvg_handle_acquire_stream(
-    handle: *mut RsvgHandle,
-    href_str: *const libc::c_char,
-    error: *mut *mut glib_sys::GError,
-) -> *mut gio_sys::GInputStream {
-    assert!(!href_str.is_null());
-
-    let href_str: String = from_glib_none(href_str);
-
-    let rhandle = get_rust_handle(handle);
-
-    let aurl = match AllowedUrl::from_href(&href_str, rhandle.base_url.borrow().as_ref()) {
-        Ok(a) => a,
-        Err(e) => {
-            set_gerror(error, 0, &format!("{}", e));
-            return ptr::null_mut();
-        }
-    };
-
-    match acquire_stream(handle, &aurl) {
-        Ok(stream) => {
-            if !error.is_null() {
-                *error = ptr::null_mut();
-            }
-
-            stream.to_glib_full()
-        }
-
-        Err(e) => {
-            set_gerror(error, 0, e.description());
-            ptr::null_mut()
-        }
-    }
-}
-
-#[no_mangle]
-pub unsafe extern "C" fn rsvg_handle_rust_steal_result(
-    raw_handle: *const Handle,
-    raw_xml_state: *mut XmlState,
-) {
-    let handle = &*raw_handle;
-    let xml = &mut *raw_xml_state;
-
-    *handle.svg.borrow_mut() = Some(xml.steal_result());
-}
-
 #[no_mangle]
 pub unsafe extern "C" fn rsvg_handle_rust_cascade(raw_handle: *const Handle) {
     let rhandle = &*raw_handle;
@@ -699,16 +611,6 @@ pub unsafe extern "C" fn rsvg_handle_rust_get_load_state(raw_handle: *const Hand
     rhandle.load_state.get()
 }
 
-#[no_mangle]
-pub unsafe extern "C" fn rsvg_handle_rust_set_load_state(
-    raw_handle: *const Handle,
-    load_state: LoadState,
-) {
-    let rhandle = &*raw_handle;
-
-    rhandle.load_state.set(load_state)
-}
-
 #[no_mangle]
 pub unsafe extern "C" fn rsvg_handle_rust_read_stream_sync(
     handle: *mut RsvgHandle,
diff --git a/rsvg_internals/src/io.rs b/rsvg_internals/src/io.rs
index aad45638..0744a58d 100644
--- a/rsvg_internals/src/io.rs
+++ b/rsvg_internals/src/io.rs
@@ -1,5 +1,4 @@
 use data_url;
-use libc;
 
 use gio::{
     self,
@@ -14,7 +13,7 @@ use gio::{
     ZlibCompressorFormat,
     ZlibDecompressor,
 };
-use glib::{self, translate::*, Bytes as GBytes, Cast};
+use glib::{self, Bytes as GBytes, Cast};
 
 use allowed_url::AllowedUrl;
 use error::{LoadingError, RsvgError};
@@ -44,22 +43,6 @@ fn decode_data_uri(uri: &str) -> Result<BinaryData, LoadingError> {
     })
 }
 
-pub fn binary_data_to_glib(
-    binary_data: &BinaryData,
-    out_mime_type: *mut *mut libc::c_char,
-    out_size: *mut usize,
-) -> *mut libc::c_char {
-    unsafe {
-        if !out_mime_type.is_null() {
-            *out_mime_type = binary_data.content_type.to_glib_full();
-        }
-
-        *out_size = binary_data.data.len();
-
-        ToGlibContainerFromSlice::to_glib_full_from_slice(&binary_data.data) as *mut libc::c_char
-    }
-}
-
 // Header of a gzip data stream
 const GZ_MAGIC_0: u8 = 0x1f;
 const GZ_MAGIC_1: u8 = 0x8b;
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index bec58f88..1936e5cc 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -44,8 +44,6 @@ pub use drawing_ctx::{
 };
 
 pub use handle::{
-    rsvg_handle_acquire_data,
-    rsvg_handle_acquire_stream,
     rsvg_handle_defs_lookup,
     rsvg_handle_rust_cascade,
     rsvg_handle_rust_close,
@@ -63,8 +61,6 @@ pub use handle::{
     rsvg_handle_rust_set_dpi_x,
     rsvg_handle_rust_set_dpi_y,
     rsvg_handle_rust_set_flags,
-    rsvg_handle_rust_set_load_state,
-    rsvg_handle_rust_steal_result,
     rsvg_handle_rust_write,
 };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]