summaryrefslogtreecommitdiff
path: root/db.h
blob: 16f4cac771b0fe7d741a6dddddacc35870344fc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _DB_H_
#define _DB_H_

#include <glib.h>
#include <sqlite3.h>

struct directory_t {
	gchar *name;
	sqlite_uint64 dirid;
};

struct wallpaper_t {
	gchar *filepath;
	sqlite_uint64 id;
	int size;
	int width;
	int height;
};

struct tag_t {
	gchar *name;
	sqlite_uint64 id;
};

int db_open();
void db_close();
sqlite_uint64 db_add_directory(const char*, sqlite_uint64);
sqlite_uint64 db_get_directory(const char*);
int db_get_top_level_directories(GArray**);
int db_get_directories(sqlite_uint64, GArray**);
sqlite_uint64 db_add_wallpaper(const char*, sqlite_uint64, int, int, int);
sqlite_uint64 db_get_wallpaper(const char*);
int db_get_wallpaper_data(sqlite_uint64, struct wallpaper_t*);
int db_get_wall_tags(sqlite_uint64, GArray**);
int db_get_wallpapers(sqlite_uint64, GArray**);
sqlite_uint64 db_add_tag(const char*);
int db_get_tags_all(GArray**);
int db_add_wall_tag(sqlite_uint64, sqlite_uint64);
int db_remove_wall_tag(sqlite_uint64, sqlite_uint64);

#endif