summaryrefslogtreecommitdiff
path: root/db.h
blob: e655f7cdd47e82b1d41f533810bef4fd3a0d9378 (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
#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;
};

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_wallpapers(sqlite_uint64, GArray**);

#endif