summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2010-06-17 15:27:00 +0200
committerArnel A. Borja <arnelborja@src.gnome.org>2013-08-31 00:56:45 +0800
commitc74a82f8c4e234ac235b15327a22ffbb3aab5065 (patch)
tree57dd8c7c397b885597c3c85716dffcb66e0d365e
parent50f955526d60ef05a21f92dec9a8fb7941befca6 (diff)
downloadlibmediaart-c74a82f8c4e234ac235b15327a22ffbb3aab5065.tar.gz
libtracker-miner: New helper macros to work with storage types
* TRACKER_STORAGE_TYPE_IS_REMOVABLE * TRACKER_STORAGE_TYPE_IS_OPTICAL
-rw-r--r--src/libtracker-miner/tracker-storage.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/libtracker-miner/tracker-storage.h b/src/libtracker-miner/tracker-storage.h
index 27d0e28..3ac584f 100644
--- a/src/libtracker-miner/tracker-storage.h
+++ b/src/libtracker-miner/tracker-storage.h
@@ -29,6 +29,39 @@
G_BEGIN_DECLS
+/**
+ * TrackerStorageType:
+ * @TRACKER_STORAGE_REMOVABLE: Storage is a removable media
+ * @TRACKER_STORAGE_OPTICAL: Storage is an optical disc
+ *
+ * Flags specifying properties of the type of storage.
+ */
+typedef enum {
+ TRACKER_STORAGE_REMOVABLE = 1 << 0,
+ TRACKER_STORAGE_OPTICAL = 1 << 1
+} TrackerStorageType;
+
+/**
+ * TRACKER_STORAGE_TYPE_IS_REMOVABLE:
+ * @type: Mask of TrackerStorageType flags
+ *
+ * Check if the given storage type is marked as being removable media.
+ *
+ * Returns: %TRUE if the storage is marked as removable media, %FALSE otherwise
+ */
+#define TRACKER_STORAGE_TYPE_IS_REMOVABLE(type) ((type & TRACKER_STORAGE_REMOVABLE) ? TRUE : FALSE)
+
+/**
+ * TRACKER_STORAGE_TYPE_IS_OPTICAL:
+ * @type: Mask of TrackerStorageType flags
+ *
+ * Check if the given storage type is marked as being optical disc
+ *
+ * Returns: %TRUE if the storage is marked as optical disc, %FALSE otherwise
+ */
+#define TRACKER_STORAGE_TYPE_IS_OPTICAL(type) ((type & TRACKER_STORAGE_OPTICAL) ? TRUE : FALSE)
+
+
#define TRACKER_TYPE_STORAGE (tracker_storage_get_type ())
#define TRACKER_STORAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_STORAGE, TrackerStorage))
#define TRACKER_STORAGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_STORAGE, TrackerStorageClass))
@@ -47,11 +80,6 @@ struct _TrackerStorageClass {
GObjectClass parent_class;
};
-typedef enum {
- TRACKER_STORAGE_REMOVABLE = 1 << 0,
- TRACKER_STORAGE_OPTICAL = 1 << 1
-} TrackerStorageType;
-
GType tracker_storage_get_type (void) G_GNUC_CONST;
TrackerStorage * tracker_storage_new (void);
GSList * tracker_storage_get_device_roots (TrackerStorage *storage,
@@ -64,7 +92,7 @@ const gchar * tracker_storage_get_mount_point_for_uuid (TrackerStorage
const gchar *uuid);
TrackerStorageType tracker_storage_get_type_for_uuid (TrackerStorage *storage,
const gchar *uuid);
-const gchar* tracker_storage_get_uuid_for_file (TrackerStorage *storage,
+const gchar * tracker_storage_get_uuid_for_file (TrackerStorage *storage,
GFile *file);
G_END_DECLS