Last change
on this file since 4397ea8 was
04ca20e,
checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago
|
#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.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[2629906] | 1 | #ifndef __OG_DBI |
---|
| 2 | #define __OG_DBI |
---|
| 3 | |
---|
| 4 | #include <dbi/dbi.h> |
---|
| 5 | |
---|
| 6 | struct og_dbi_config { |
---|
| 7 | const char *user; |
---|
| 8 | const char *passwd; |
---|
| 9 | const char *host; |
---|
| 10 | const char *database; |
---|
| 11 | }; |
---|
| 12 | |
---|
| 13 | struct og_dbi { |
---|
| 14 | dbi_conn conn; |
---|
| 15 | dbi_inst inst; |
---|
| 16 | }; |
---|
| 17 | |
---|
| 18 | struct og_dbi *og_dbi_open(struct og_dbi_config *config); |
---|
| 19 | void og_dbi_close(struct og_dbi *db); |
---|
| 20 | |
---|
[04ca20e] | 21 | #define OG_DB_IMAGE_NAME_MAXLEN 50 |
---|
| 22 | #define OG_DB_FILESYSTEM_MAXLEN 16 |
---|
| 23 | #define OG_DB_INT8_MAXLEN 8 |
---|
| 24 | #define OG_DB_INT_MAXLEN 11 |
---|
| 25 | #define OG_DB_IP_MAXLEN 15 |
---|
| 26 | #define OG_DB_SMALLINT_MAXLEN 6 |
---|
| 27 | |
---|
| 28 | struct og_image_legacy { |
---|
| 29 | char software_id[OG_DB_INT_MAXLEN + 1]; |
---|
| 30 | char image_id[OG_DB_INT_MAXLEN + 1]; |
---|
| 31 | char name[OG_DB_IMAGE_NAME_MAXLEN + 1]; |
---|
| 32 | char repo[OG_DB_IP_MAXLEN + 1]; |
---|
| 33 | char part[OG_DB_SMALLINT_MAXLEN + 1]; |
---|
| 34 | char disk[OG_DB_SMALLINT_MAXLEN + 1]; |
---|
| 35 | char code[OG_DB_INT8_MAXLEN + 1]; |
---|
| 36 | }; |
---|
| 37 | |
---|
| 38 | struct og_legacy_partition { |
---|
| 39 | char partition[OG_DB_SMALLINT_MAXLEN + 1]; |
---|
| 40 | char code[OG_DB_INT8_MAXLEN + 1]; |
---|
| 41 | char size[OG_DB_INT_MAXLEN + 1]; |
---|
| 42 | char filesystem[OG_DB_FILESYSTEM_MAXLEN + 1]; |
---|
| 43 | char format[2]; /* Format is a boolean 0 or 1 => length is 2 */ |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | extern struct og_dbi_config dbi_config; |
---|
| 47 | |
---|
[2629906] | 48 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.