]> git.datanom.net - lensdb.git/blobdiff - src/sqlite-storage.h
fix spelling error. add more precise maker finder
[lensdb.git] / src / sqlite-storage.h
index f81e7dc8d0cb137d06d7edcbd142798c3cd1cd88..33918f59d70070d134a97ace96a49167b8768f53 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * sqlite-storage.h
+ *
+ * Copyright 2024 Michael Rasmussen <mir@datanom.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
 
 #ifndef __SQLITE_STORAGE_H__
 #define __SQLITE_STORAGE_H__
@@ -9,9 +29,43 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <sqlite3.h>
+#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
This page took 0.439897 seconds and 5 git commands to generate.