/*
* Geeqie
* (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: John Ellis
*
*-----------------------------------------------------------------------------
*/
-gint pan_date_compare(time_t a, time_t b, PanDateLengthType length)
+gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length)
{
struct tm ta;
struct tm tb;
*-----------------------------------------------------------------------------
*/
-gint pan_is_link_loop(const gchar *s)
+gboolean pan_is_link_loop(const gchar *s)
{
gchar *sl;
struct stat st;
- gint ret = FALSE;
+ gboolean ret = FALSE;
sl = path_from_utf8(s);
parse_out_relatives(sl);
- if (buf[0] == '/')
+ if (buf[0] == G_DIR_SEPARATOR)
{
if (strncmp(sl, buf, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
}
else
{
gchar *link_path;
- link_path = concat_dir_and_file(sl, buf);
+ link_path = g_build_filename(sl, buf, NULL);
parse_out_relatives(link_path);
if (strncmp(sl, link_path, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
g_free(link_path);
}
return ret;
}
-gint pan_is_ignored(const gchar *s, gint ignore_symlinks)
+gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks)
{
struct stat st;
const gchar *n;
return FALSE;
}
-GList *pan_list_tree(const gchar *path, SortType sort, gint ascend,
- gint ignore_symlinks)
+GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend,
+ gboolean ignore_symlinks)
{
- GList *flist = NULL;
- GList *dlist = NULL;
+ GList *flist;
+ GList *dlist;
GList *result;
GList *folders;
- filelist_read(path, &flist, &dlist);
+ filelist_read(dir_fd, &flist, &dlist);
if (sort != SORT_NONE)
{
flist = filelist_sort(flist, sort, ascend);
folders = g_list_remove(folders, fd);
if (!pan_is_ignored(fd->path, ignore_symlinks) &&
- filelist_read(fd->path, &flist, &dlist))
+ filelist_read(fd, &flist, &dlist))
{
if (sort != SORT_NONE)
{
return result;
}
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */