[librsvg] rsvg-load.c: Move the rust_state up to the main struct
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg-load.c: Move the rust_state up to the main struct
- Date: Mon, 10 Dec 2018 20:54:28 +0000 (UTC)
commit 3b1eb0944591b3e88e34348ea1dfd1e6b2d8bd95
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 10 13:48:30 2018 -0600
rsvg-load.c: Move the rust_state up to the main struct
librsvg/rsvg-load.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index 95b2affb..0a6dff22 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -55,11 +55,6 @@ extern gboolean rsvg_xml_state_load_from_possibly_compressed_stream (RsvgXmlStat
extern void rsvg_handle_rust_steal_result (RsvgHandleRust *raw_handle, RsvgXmlState *xml);
-/* Holds the XML parsing state */
-typedef struct {
- RsvgXmlState *rust_state;
-} XmlState;
-
/* Holds the GIO and loading state for compressed data */
struct RsvgLoad {
RsvgHandle *handle;
@@ -68,7 +63,7 @@ struct RsvgLoad {
GInputStream *stream;
- XmlState xml;
+ RsvgXmlState *rust_state;
};
RsvgLoad *
@@ -80,7 +75,7 @@ rsvg_load_new (RsvgHandle *handle)
load->state = LOAD_STATE_START;
load->stream = NULL;
- load->xml.rust_state = rsvg_xml_state_new (handle);
+ load->rust_state = rsvg_xml_state_new (handle);
return load;
}
@@ -89,17 +84,17 @@ void
rsvg_load_free (RsvgLoad *load)
{
g_clear_object (&load->stream);
- g_clear_pointer (&load->xml.rust_state, rsvg_xml_state_free);
+ g_clear_pointer (&load->rust_state, rsvg_xml_state_free);
g_free (load);
}
gboolean
rsvg_load_finish_load (RsvgLoad *load, GError **error)
{
- gboolean was_successful = rsvg_xml_state_tree_is_valid(load->xml.rust_state, error);
+ gboolean was_successful = rsvg_xml_state_tree_is_valid(load->rust_state, error);
if (was_successful) {
- rsvg_handle_rust_steal_result (load->handle->priv->rust_handle, load->xml.rust_state);
+ rsvg_handle_rust_steal_result (load->handle->priv->rust_handle, load->rust_state);
}
return was_successful;
@@ -135,7 +130,7 @@ rsvg_load_read_stream_sync (RsvgLoad *load,
gboolean res = FALSE;
gboolean unlimited_size = (rsvg_handle_get_flags (load->handle) && RSVG_HANDLE_FLAG_UNLIMITED) != 0;
- res = rsvg_xml_state_load_from_possibly_compressed_stream (load->xml.rust_state,
+ res = rsvg_xml_state_load_from_possibly_compressed_stream (load->rust_state,
unlimited_size,
stream,
cancellable,
@@ -198,7 +193,7 @@ rsvg_load_close (RsvgLoad *load, GError **error)
}
if (!res) {
- g_clear_pointer (&load->xml.rust_state, rsvg_xml_state_free);
+ g_clear_pointer (&load->rust_state, rsvg_xml_state_free);
}
load->state = LOAD_STATE_CLOSED;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]