summaryrefslogtreecommitdiffstats
path: root/sources/dbi.h
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-18 18:15:25 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-18 18:46:48 +0200
commit04ca20e9f1999d2c780043152cf233bcb1836d18 (patch)
treecca304b6d34723ec3a2a13e6745a874443ce5704 /sources/dbi.h
parent0b9465f783124340d85ff414c2ffb1dc40745f10 (diff)
#971 split into smaller file
Split ogAdmServer into several files: * sources/rest.c that implements the server REST API. * sources/client.c that implements the client REST API. * sources/json.c that provides a few JSON helpers.
Diffstat (limited to 'sources/dbi.h')
-rw-r--r--sources/dbi.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sources/dbi.h b/sources/dbi.h
index 882550f..78b79aa 100644
--- a/sources/dbi.h
+++ b/sources/dbi.h
@@ -18,4 +18,31 @@ struct og_dbi {
struct og_dbi *og_dbi_open(struct og_dbi_config *config);
void og_dbi_close(struct og_dbi *db);
+#define OG_DB_IMAGE_NAME_MAXLEN 50
+#define OG_DB_FILESYSTEM_MAXLEN 16
+#define OG_DB_INT8_MAXLEN 8
+#define OG_DB_INT_MAXLEN 11
+#define OG_DB_IP_MAXLEN 15
+#define OG_DB_SMALLINT_MAXLEN 6
+
+struct og_image_legacy {
+ char software_id[OG_DB_INT_MAXLEN + 1];
+ char image_id[OG_DB_INT_MAXLEN + 1];
+ char name[OG_DB_IMAGE_NAME_MAXLEN + 1];
+ char repo[OG_DB_IP_MAXLEN + 1];
+ char part[OG_DB_SMALLINT_MAXLEN + 1];
+ char disk[OG_DB_SMALLINT_MAXLEN + 1];
+ char code[OG_DB_INT8_MAXLEN + 1];
+};
+
+struct og_legacy_partition {
+ char partition[OG_DB_SMALLINT_MAXLEN + 1];
+ char code[OG_DB_INT8_MAXLEN + 1];
+ char size[OG_DB_INT_MAXLEN + 1];
+ char filesystem[OG_DB_FILESYSTEM_MAXLEN + 1];
+ char format[2]; /* Format is a boolean 0 or 1 => length is 2 */
+};
+
+extern struct og_dbi_config dbi_config;
+
#endif