1 |
|
/* |
2 |
|
* DotGNU Execution Environment Core |
3 |
|
* (c)2003 netFluid Technology Ltd - http://www.nfluid.com |
4 |
|
* |
5 |
|
* user DB Table -- AUTO GENERATED FROM dbtables.cfg -- |
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_USER_TABLE_H |
26 |
|
#define DG_USER_TABLE_H |
27 |
|
|
28 |
|
#include "dbObject.h" |
29 |
|
|
30 |
|
|
31 |
|
#define C_USERNAME_LEN 64 |
32 |
|
#define C_REALNAME_LEN 128 |
33 |
|
#define C_EMAIL_LEN 80 |
34 |
|
#define C_WEBSITE_LEN 80 |
35 |
|
#define C_PUBLICKEY_LEN 512 |
36 |
|
#define C_SESSIONID_LEN 40 |
37 |
|
|
38 |
|
/* Define the User Table |
39 |
|
*/ |
40 |
|
#define DBUSER_KFIELDS \ |
41 |
|
\ |
42 |
|
X_CHAR( userName, C_USERNAME_LEN) \ |
43 |
|
\ |
44 |
|
\ |
45 |
|
|
46 |
|
|
47 |
|
#define DBUSER_DFIELDS \ |
48 |
|
\ |
49 |
|
X_CHAR( realName, C_REALNAME_LEN) \ |
50 |
|
\ |
51 |
|
\ |
52 |
|
\ |
53 |
|
X_CHAR( email, C_EMAIL_LEN) \ |
54 |
|
\ |
55 |
|
\ |
56 |
|
\ |
57 |
|
X_CHAR( website, C_WEBSITE_LEN) \ |
58 |
|
\ |
59 |
|
\ |
60 |
|
\ |
61 |
|
X_CHAR( publicKey, C_PUBLICKEY_LEN) \ |
62 |
|
\ |
63 |
|
\ |
64 |
|
\ |
65 |
|
X_CHAR( sessionID, C_SESSIONID_LEN) \ |
66 |
|
\ |
67 |
|
\ |
68 |
|
|
69 |
|
|
70 |
|
/* Create the Table Structures ----------------------------------------------- |
71 |
|
*/ |
72 |
|
#include "start_decl.h" |
73 |
|
typedef struct { |
74 |
|
DBUSER_KFIELDS |
75 |
|
} dbUserKey; |
76 |
|
|
77 |
|
typedef struct { |
78 |
|
DBUSER_DFIELDS |
79 |
|
} dbUserData; |
80 |
|
#include "end_decl.h" |
81 |
|
|
82 |
|
typedef struct { |
83 |
|
/* Methods then private MUST come first */ |
84 |
|
dbObjMethods method; |
85 |
|
dbObjPrivate private; |
86 |
|
|
87 |
|
/* Followed immediately by the key structure */ |
88 |
|
dbUserKey key; |
89 |
|
/* And then the data structure */ |
90 |
|
dbUserData data; |
91 |
|
|
92 |
|
/* Everything after here is 'free' for use */ |
93 |
|
|
94 |
|
} dbUser; |
95 |
|
|
96 |
|
#ifdef DBSTORE_WANT_DETAILS |
97 |
|
|
98 |
|
#include "start_prop_decl.h" |
99 |
|
#define KTYPE dbUserKey |
100 |
|
dbProperty userKeyProperties[] = { |
101 |
|
DBUSER_KFIELDS |
102 |
|
{ NULL } |
103 |
|
}; |
104 |
|
#undef KTYPE |
105 |
|
#define KTYPE dbUserData |
106 |
|
dbProperty userDataProperties[] = { |
107 |
|
DBUSER_DFIELDS |
108 |
|
{ NULL } |
109 |
|
}; |
110 |
|
#undef KTYPE |
111 |
|
#include "end_decl.h" |
112 |
|
|
113 |
|
char *userDBH = NULL; |
114 |
|
|
115 |
|
/* Define the complete User Object so the |
116 |
|
* constructor knows everything it needs. |
117 |
|
*/ |
118 |
|
dbObjDesc dbUserDef = { |
119 |
|
sizeof(dbUserKey), /* Key Size */ |
120 |
|
sizeof(dbUserData), /* Data Size */ |
121 |
|
sizeof(dbUser), /* Object Size */ |
122 |
|
"user", /* Table Name */ |
123 |
|
KEY_IS_UNIQUE, |
124 |
|
&userDBH, /* user DBH */ |
125 |
|
userKeyProperties, |
126 |
|
userDataProperties |
127 |
|
}; |
128 |
|
#else |
129 |
|
extern dbObjDesc dbUserDef; |
130 |
|
#endif /* DBSTORE_WANT_DETAILS */ |
131 |
|
|
132 |
|
/* ------------------------------------------------------------------------- */ |
133 |
|
#endif |