1 |
|
/* |
2 |
|
* DotGNU Execution Environment Core |
3 |
|
* (c)2003 netFluid Technology Ltd - http://www.nfluid.com |
4 |
|
* |
5 |
|
* webService Owner DB Table |
6 |
|
* |
7 |
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
* it under the terms of the GNU General Public License as published by |
9 |
|
* the Free Software Foundation; either version 2 of the License, or |
10 |
|
* (at your option) any later version. |
11 |
|
* |
12 |
|
* This program is distributed in the hope that it will be useful, |
13 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
* GNU General Public License for more details. |
16 |
|
* |
17 |
|
* You should have received a copy of the GNU General Public License |
18 |
|
* along with this program; if not, write to the Free Software |
19 |
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
20 |
|
* |
21 |
|
* $Revision$ $Date$ |
22 |
|
* |
23 |
|
* -------------------------------------------------------------------------- |
24 |
|
*/ |
25 |
|
#ifndef DG_OWNER_TABLE_H |
26 |
|
#define DG_OWNER_TABLE_H |
27 |
|
|
28 |
|
#include "dbObject.h" |
29 |
|
|
30 |
|
#define C_OWNERNAME_LEN 128 |
31 |
|
#define C_REALNAME_LEN 128 |
32 |
|
#define C_PUBLICKEY_LEN 512 |
33 |
|
#define C_EMAIL_LEN 128 |
34 |
|
#define C_WEBSITE_LEN 128 |
35 |
|
|
36 |
|
/* Define the Owner Table |
37 |
|
*/ |
38 |
|
#define DBOWNER_KFIELDS \ |
39 |
|
X_CHAR( ownerName, C_OWNERNAME_LEN) |
40 |
|
|
41 |
|
#define DBOWNER_DFIELDS \ |
42 |
|
X_CHAR( realName, C_REALNAME_LEN ) \ |
43 |
|
X_CHAR( email, C_EMAIL_LEN ) \ |
44 |
|
X_CHAR( website, C_WEBSITE_LEN ) \ |
45 |
|
X_CHAR( publicKey, C_PUBLICKEY_LEN) |
46 |
|
|
47 |
|
/* Create the Table Structures ----------------------------------------------- |
48 |
|
*/ |
49 |
|
#include "start_decl.h" |
50 |
|
typedef struct { |
51 |
|
DBOWNER_KFIELDS |
52 |
|
} dbOwnerKey; |
53 |
|
|
54 |
|
typedef struct { |
55 |
|
DBOWNER_DFIELDS |
56 |
|
} dbOwnerData; |
57 |
|
#include "end_decl.h" |
58 |
|
|
59 |
|
|
60 |
|
typedef struct { |
61 |
|
/* Methods then private MUST come first */ |
62 |
|
dbObjMethods method; |
63 |
|
dbObjPrivate private; |
64 |
|
|
65 |
|
/* Followed immediately by the key structure */ |
66 |
|
dbOwnerKey key; |
67 |
|
/* And then the data structure */ |
68 |
|
dbOwnerData data; |
69 |
|
|
70 |
|
/* Everything after here is 'free' for use */ |
71 |
|
|
72 |
|
} dbOwner; |
73 |
|
|
74 |
|
#ifdef DBSTORE_WANT_DETAILS |
75 |
|
|
76 |
|
#include "start_prop_decl.h" |
77 |
|
#define KTYPE(a) dbOwnerKey |
78 |
|
dbProperty ownerKeyProperties[] = { |
79 |
|
DBOWNER_KFIELDS |
80 |
|
}; |
81 |
|
#undef KTYPE |
82 |
|
#define KTYPE(a) dbOwnerData |
83 |
|
dbProperty ownerDataProperties[] = { |
84 |
|
DBOWNER_DFIELDS |
85 |
|
{ NULL } |
86 |
|
}; |
87 |
|
#undef KTYPE |
88 |
|
#include "end_decl.h" |
89 |
|
|
90 |
|
char *ownerDBH = NULL; |
91 |
|
|
92 |
|
/* Define the complete Owner Object so the |
93 |
|
* constructor knows everything it needs. |
94 |
|
*/ |
95 |
|
dbObjDesc dbOwnerDef = { |
96 |
|
sizeof(dbOwnerKey), /* Key Size */ |
97 |
|
sizeof(dbOwnerData), /* Data Size */ |
98 |
|
sizeof(dbOwner), /* Object Size */ |
99 |
|
"owner", /* Table Name */ |
100 |
|
KEY_IS_UNIQUE, |
101 |
|
&ownerDBH, /* owner DMH */ |
102 |
|
ownerKeyProperties, |
103 |
|
ownerDataProperties |
104 |
|
}; |
105 |
|
#else |
106 |
|
extern dbObjDesc dbOwnerDef; |
107 |
|
#endif /* DBSTORE_WANT_DETAILS */ |
108 |
|
|
109 |
|
/* ------------------------------------------------------------------------- */ |
110 |
|
#endif |