summaryrefslogtreecommitdiff
path: root/gi/pygi-marshal-cleanup.c
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-10-11 23:26:08 -0700
committerSimon Feltman <sfeltman@src.gnome.org>2014-02-02 16:02:57 -0800
commit4697a3793b46a803c6dbef749ba75c0fee80020d (patch)
treec3390741084cf9d4de3adb9120423310da1aa7db /gi/pygi-marshal-cleanup.c
parentc48ddacf4479d2cf80beb9c614cdce2a61599b3b (diff)
downloadpygobject-4697a3793b46a803c6dbef749ba75c0fee80020d.tar.gz
cache refactoring: Move GList/GSList arg setup and marshaling into new file
Move GList and GSList argument caching and marshaling fragments into an isolated file: pygi-list.c. https://bugzilla.gnome.org/show_bug.cgi?id=709700
Diffstat (limited to 'gi/pygi-marshal-cleanup.c')
-rw-r--r--gi/pygi-marshal-cleanup.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c
index 52d7bb38..d402f1ea 100644
--- a/gi/pygi-marshal-cleanup.c
+++ b/gi/pygi-marshal-cleanup.c
@@ -444,83 +444,3 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
g_ptr_array_free (ptr_array_, TRUE);
}
}
-
-void
-_pygi_marshal_cleanup_from_py_glist (PyGIInvokeState *state,
- PyGIArgCache *arg_cache,
- PyObject *py_arg,
- gpointer data,
- gboolean was_processed)
-{
- if (was_processed) {
- GSList *list_;
- PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache;
-
- list_ = (GSList *)data;
-
- /* clean up items first */
- if (sequence_cache->item_cache->from_py_cleanup != NULL) {
- PyGIMarshalCleanupFunc cleanup_func =
- sequence_cache->item_cache->from_py_cleanup;
- GSList *node = list_;
- gsize i = 0;
- while (node != NULL) {
- PyObject *py_item = PySequence_GetItem (py_arg, i);
- cleanup_func (state,
- sequence_cache->item_cache,
- py_item,
- node->data,
- TRUE);
- Py_XDECREF (py_item);
- node = node->next;
- i++;
- }
- }
-
- if (arg_cache->type_tag == GI_TYPE_TAG_GLIST) {
- g_list_free ( (GList *)list_);
- } else if (arg_cache->type_tag == GI_TYPE_TAG_GSLIST) {
- g_slist_free (list_);
- } else {
- g_assert_not_reached();
- }
- }
-}
-
-void
-_pygi_marshal_cleanup_to_py_glist (PyGIInvokeState *state,
- PyGIArgCache *arg_cache,
- PyObject *dummy,
- gpointer data,
- gboolean was_processed)
-{
- PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache;
- if (arg_cache->transfer == GI_TRANSFER_EVERYTHING ||
- arg_cache->transfer == GI_TRANSFER_CONTAINER) {
- GSList *list_ = (GSList *)data;
-
- if (sequence_cache->item_cache->to_py_cleanup != NULL) {
- PyGIMarshalCleanupFunc cleanup_func =
- sequence_cache->item_cache->to_py_cleanup;
- GSList *node = list_;
-
- while (node != NULL) {
- cleanup_func (state,
- sequence_cache->item_cache,
- NULL,
- node->data,
- was_processed);
- node = node->next;
- }
- }
-
- if (arg_cache->type_tag == GI_TYPE_TAG_GLIST) {
- g_list_free ( (GList *)list_);
- } else if (arg_cache->type_tag == GI_TYPE_TAG_GSLIST) {
- g_slist_free (list_);
- } else {
- g_assert_not_reached();
- }
- }
-}
-