2 * Copyright (C) 2008 - 2016 The Geeqie Team
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 typedef struct _FileCluster FileCluster;
25 typedef struct _FileClusterList FileClusterList;
27 // A FileCluster is a GList with HashTable access to each node (to perform contains() checks quickly).
34 struct _FileClusterList
36 // All of the elements in the list, regardless of whether they're part of a cluster or not.
39 // A map from any clustered FileData to the FileCluster object that describes the cluster.
43 FileClusterList *fileclusterlist_new();
44 FileCluster *filecluster_new(); // internal?
45 void fileclusterlist_free(FileClusterList *fcl);
46 void filecluster_free(FileCluster *fc);
48 // Creates a cluster with items that must already be in the cluster list. Will fail (and make no
49 // changes) if any of the specified items isn't in the list, or if any of the items is already
50 // part of a different cluster.
51 FileCluster *fileclusterlist_create_cluster(FileClusterList *fcl, GList *fd_items);
53 gboolean fileclusterlist_has_head(FileClusterList *fcl, FileData *fd);
54 gboolean fileclusterlist_has_child(FileClusterList *fcl, FileData *fd);
57 #endif // FILECLUSTER_H