[Xfce4-commits] <squeeze:master> Cleanup internals.{c,h}
Stephan Arts
noreply at xfce.org
Tue Oct 4 21:14:01 CEST 2011
Updating branch refs/heads/master
to faa835c7b72f20e231e1b4c4f1e5755203f95695 (commit)
from 7b1638ebe6f0db4d19d3e52900e7f44b5f1fa06c (commit)
commit faa835c7b72f20e231e1b4c4f1e5755203f95695
Author: Stephan Arts <stephan at xfce.org>
Date: Tue Oct 4 21:14:21 2011 +0200
Cleanup internals.{c,h}
libsqueeze/internals.c | 79 +++++++++++++++++++++++++++++------------------
libsqueeze/internals.h | 17 ++++++----
2 files changed, 59 insertions(+), 37 deletions(-)
diff --git a/libsqueeze/internals.c b/libsqueeze/internals.c
index 17bb6d3..b51202c 100644
--- a/libsqueeze/internals.c
+++ b/libsqueeze/internals.c
@@ -39,51 +39,70 @@
#include <sys/wait.h>
static gint
-lsq_opened_archives_lookup_archive(gconstpointer open_archive, gconstpointer path);
+lsq_opened_archives_lookup_archive (
+ gconstpointer open_archive,
+ gconstpointer path);
gchar *
-lsq_concat_filenames(GSList *filenames)
+lsq_concat_filenames ( GSList *filenames )
{
- GSList *_filenames = filenames;
- gchar *concat_str = g_strdup(" "), *_concat_str;
-
- while(_filenames)
- {
- _concat_str = concat_str;
- concat_str = g_strconcat(concat_str, " ", g_shell_quote(_filenames->data) , NULL);
- _filenames = _filenames->next;
- g_free(_concat_str);
- }
- return concat_str;
+ GSList *_filenames = filenames;
+ gchar *concat_str = g_strdup(" "), *_concat_str;
+
+ while ( NULL != _filenames )
+ {
+ _concat_str = concat_str;
+ concat_str = g_strconcat (
+ concat_str,
+ " ",
+ g_shell_quote ( _filenames->data ),
+ NULL );
+
+ _filenames = _filenames->next;
+
+ g_free ( _concat_str );
+ }
+ return concat_str;
}
LSQArchive *
-lsq_opened_archive_get_archive(gchar *path)
+lsq_opened_archive_get_archive ( gchar *path )
{
- GSList *result = g_slist_find_custom(lsq_opened_archive_list, path, lsq_opened_archives_lookup_archive);
- if ( NULL != result )
- {
- g_object_ref(result->data);
- return result->data;
- }
- return NULL;
+ GSList *result = g_slist_find_custom (
+ lsq_opened_archive_list,
+ path,
+ lsq_opened_archives_lookup_archive );
+
+ if ( NULL != result )
+ {
+ g_object_ref ( result->data );
+ return result->data;
+ }
+ return NULL;
}
static gint
-lsq_opened_archives_lookup_archive(gconstpointer open_archive, gconstpointer uri)
+lsq_opened_archives_lookup_archive (
+ gconstpointer open_archive,
+ gconstpointer uri )
{
GFile *file;
+ GFile *archive_file;
#ifdef DEBUG
- g_return_val_if_fail ( NULL != open_archive, 1 );
+ g_return_val_if_fail ( NULL != open_archive, 1 );
#endif
- file = g_file_new_for_path (uri);
+ file = g_file_new_for_path ( uri );
+ archive_file = lsq_archive_get_file ( LSQ_ARCHIVE ( open_archive ) );
- if ( TRUE == g_file_equal ( lsq_archive_get_file ( LSQ_ARCHIVE(open_archive) ), file) )
- {
- g_object_unref (file);
- return 0;
- }
- g_object_unref (file);
+ if ( TRUE == g_file_equal (archive_file , file) )
+ {
+ g_object_unref ( file );
+
+ return 0;
+ }
+
+ g_object_unref ( file );
+
return 1;
}
diff --git a/libsqueeze/internals.h b/libsqueeze/internals.h
index 52bb301..c76afe2 100644
--- a/libsqueeze/internals.h
+++ b/libsqueeze/internals.h
@@ -14,15 +14,18 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-GSList *support_factory_list;
-GSList *lsq_mime_support_list;
-GSList *lsq_opened_archive_list;
-gchar *lsq_relative_base_uri;
+GSList *support_factory_list;
+GSList *lsq_mime_support_list;
+GSList *lsq_opened_archive_list;
+gchar *lsq_relative_base_uri;
gchar *
-lsq_concat_filenames(GSList *filenames);
+lsq_concat_filenames ( GSList *filenames );
+
gchar *
-lsq_concat_iter_filenames(GSList *file_iters, gboolean);
+lsq_concat_iter_filenames (
+ GSList *file_iters,
+ gboolean );
LSQArchive *
-lsq_opened_archive_get_archive(gchar *path);
+lsq_opened_archive_get_archive ( gchar *path );
More information about the Xfce4-commits
mailing list