X-Git-Url: http://git.datanom.net/lensdb.git/blobdiff_plain/6400c00fde977903f15792d6f52311dd0526a46f..refs/heads/release/0.9.4:/src/sqlite-storage.h?ds=inline diff --git a/src/sqlite-storage.h b/src/sqlite-storage.h index dc5e180..33918f5 100644 --- a/src/sqlite-storage.h +++ b/src/sqlite-storage.h @@ -29,9 +29,43 @@ #include #include #include +#include "csv.h" G_BEGIN_DECLS +typedef struct { + gint64 id; + gint maker; + gchar* sn; + gchar* data; + gchar* notes; +} Row; + +typedef struct { + gint64 id; + gchar* maker_name; + gint page; +} Maker; + +gint init_storage(const gchar* path); +void close_storage(); +gint add_lens(Row* row); +gint update_lens(const Row* row); +gint update_lens_maker(const Row* row); +gint add_maker(const gchar* maker, gchar** err); +gint delete_maker(const gchar* maker, gchar** err); +GSList* get_makers(); +gint get_maker_id(const gchar* maker); +Maker* get_maker(gint id); +void update_maker(const Maker* maker); +void maker_free(Maker* maker); +gint delete_lens(const Row* row); +GSList* get_lens_by_maker(gint id); +GSList* get_lens_by_search(const Row* row); +Row* row_new(); +void row_free(gpointer data, gpointer user_data); +void dump_storage(CsvParser* parser); + G_END_DECLS #endif