~ubuntu-branches/ubuntu/utopic/rhythmbox/utopic-proposed

« back to all changes in this revision

Viewing changes to rhythmdb/rhythmdb-tree.h

Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#ifndef RHYTHMDB_TREE_H
23
23
#define RHYTHMDB_TREE_H
24
24
 
25
 
#include "rhythmdb.h"
26
 
#include "rb-atomic.h"
 
25
#include "rhythmdb-private.h"
27
26
#include <glib-object.h>
 
27
#include <glib/gatomic.h>
28
28
 
29
29
G_BEGIN_DECLS
30
30
 
54
54
 
55
55
RhythmDB *      rhythmdb_tree_new       (const char *name);
56
56
 
57
 
void            rhythmdb_tree_entry_destroy     (RhythmDBTree *db, RhythmDBEntry *entry);
58
 
 
59
 
/* PRIVATE */
60
 
 
61
 
typedef struct RhythmDBTreeProperty
62
 
{
63
 
#ifndef G_DISABLE_ASSERT
64
 
        guint magic;
65
 
#endif  
66
 
        struct RhythmDBTreeProperty *parent;
67
 
        char *name;
68
 
        char *folded;
69
 
        char *sort_key;
70
 
        GHashTable *children;
71
 
} RhythmDBTreeProperty;
72
 
 
73
 
/* Optimization possibility - note that we aren't using at least
74
 
 * three values in the array; the genre/artist/album names are
75
 
 * actually stored in the tree structure. */
76
 
typedef struct
77
 
{
78
 
#ifndef G_DISABLE_ASSERT
79
 
        guint magic;
80
 
#endif  
81
 
        gboolean deleted;
82
 
        RBAtomic refcount;
83
 
        RhythmDBTreeProperty *album;
84
 
        GValue properties[RHYTHMDB_NUM_PROPERTIES];
85
 
} RhythmDBTreeEntry;
86
 
 
87
 
#define rhythmdb_entry_ref_unlocked(DB,ENTRY) rhythmdb_entry_ref (DB, ENTRY)
88
 
 
89
 
static inline void
90
 
rhythmdb_entry_ref (RhythmDB *adb, RhythmDBEntry *aentry)
91
 
{
92
 
        RhythmDBTreeEntry *entry = (RhythmDBTreeEntry *) aentry;
93
 
 
94
 
        rb_atomic_inc (&entry->refcount);
95
 
}
96
 
 
97
 
void rhythmdb_entry_unref (RhythmDB *adb, RhythmDBEntry *aentry);
98
 
 
99
 
void rhythmdb_entry_unref_unlocked (RhythmDB *adb, RhythmDBEntry *aentry);
100
 
 
101
 
 
102
57
G_END_DECLS
103
58
 
104
59
#endif /* __RHYTHMBDB_TREE_H */