source: ogServer-Git/src/dbi.h @ d6789f1

Last change on this file since d6789f1 was 37e91b2, checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago

#971 rename sources folder to src

Use the same folder as in ogClient.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#ifndef __OG_DBI
2#define __OG_DBI
3
4#include <dbi/dbi.h>
5
6struct og_dbi_config {
7        const char      *user;
8        const char      *passwd;
9        const char      *host;
10        const char      *database;
11};
12
13struct og_dbi {
14        dbi_conn        conn;
15        dbi_inst        inst;
16};
17
18struct og_dbi *og_dbi_open(struct og_dbi_config *config);
19void og_dbi_close(struct og_dbi *db);
20
21#define OG_DB_COMPUTER_NAME_MAXLEN      100
22#define OG_DB_CENTER_NAME_MAXLEN        100
23#define OG_DB_ROOM_NAME_MAXLEN          100
24#define OG_DB_IMAGE_NAME_MAXLEN 50
25#define OG_DB_FILESYSTEM_MAXLEN 16
26#define OG_DB_INT8_MAXLEN       8
27#define OG_DB_INT_MAXLEN        11
28#define OG_DB_IP_MAXLEN         15
29#define OG_DB_SMALLINT_MAXLEN   6
30
31struct og_image_legacy {
32        char software_id[OG_DB_INT_MAXLEN + 1];
33        char image_id[OG_DB_INT_MAXLEN + 1];
34        char name[OG_DB_IMAGE_NAME_MAXLEN + 1];
35        char repo[OG_DB_IP_MAXLEN + 1];
36        char part[OG_DB_SMALLINT_MAXLEN + 1];
37        char disk[OG_DB_SMALLINT_MAXLEN + 1];
38        char code[OG_DB_INT8_MAXLEN + 1];
39};
40
41struct og_legacy_partition {
42        char partition[OG_DB_SMALLINT_MAXLEN + 1];
43        char code[OG_DB_INT8_MAXLEN + 1];
44        char size[OG_DB_INT_MAXLEN + 1];
45        char filesystem[OG_DB_FILESYSTEM_MAXLEN + 1];
46        char format[2]; /* Format is a boolean 0 or 1 => length is 2 */
47};
48
49extern struct og_dbi_config dbi_config;
50
51#endif
Note: See TracBrowser for help on using the repository browser.