[librsvg] rsvg_decode_data_uri(): Remove unused function
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg_decode_data_uri(): Remove unused function
- Date: Thu, 29 Nov 2018 18:05:09 +0000 (UTC)
commit def3c5b38bea2eac2086a466ef549978ec86ce9a
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 28 12:47:37 2018 -0600
rsvg_decode_data_uri(): Remove unused function
rsvg_internals/src/io.rs | 39 +--------------------------------------
rsvg_internals/src/lib.rs | 2 +-
2 files changed, 2 insertions(+), 39 deletions(-)
---
diff --git a/rsvg_internals/src/io.rs b/rsvg_internals/src/io.rs
index 905a326d..a93c0b9e 100644
--- a/rsvg_internals/src/io.rs
+++ b/rsvg_internals/src/io.rs
@@ -20,9 +20,8 @@ use glib::{self, translate::*, Bytes as GBytes, Cast};
use std::ptr;
use allowed_url::AllowedUrl;
-use error::{set_gerror, LoadingError, RsvgError};
+use error::{LoadingError, RsvgError};
use handle::BinaryData;
-use util::utf8_cstr;
fn decode_data_uri(uri: &str) -> Result<BinaryData, LoadingError> {
let data_url = data_url::DataUrl::process(uri).map_err(|_| LoadingError::BadDataUrl)?;
@@ -64,42 +63,6 @@ pub fn binary_data_to_glib(
}
}
-#[no_mangle]
-pub fn rsvg_decode_data_uri(
- uri: *const libc::c_char,
- out_mime_type: *mut *mut libc::c_char,
- out_size: *mut usize,
- error: *mut *mut glib_sys::GError,
-) -> *mut libc::c_char {
- unsafe {
- assert!(!out_size.is_null());
-
- let uri = utf8_cstr(uri);
-
- match decode_data_uri(uri) {
- Ok(binary_data) => {
- if !error.is_null() {
- *error = ptr::null_mut();
- }
-
- binary_data_to_glib(&binary_data, out_mime_type, out_size)
- }
-
- Err(_) => {
- if !out_mime_type.is_null() {
- *out_mime_type = ptr::null_mut();
- }
-
- *out_size = 0;
-
- set_gerror(error, 0, "could not decode data: URL");
-
- ptr::null_mut()
- }
- }
- }
-}
-
// 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 9149bdeb..fab96ef3 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -55,7 +55,7 @@ pub use handle::{
rsvg_handle_rust_set_base_url,
};
-pub use io::{rsvg_decode_data_uri, rsvg_get_input_stream_for_loading};
+pub use io::rsvg_get_input_stream_for_loading;
pub use node::rsvg_node_unref;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]