1 | /* |
2 | * $Id: dsstypes.h,v 1.3 2005/10/28 02:57:04 jms Exp $ |
3 | * |
4 | * Revision History |
5 | * =================== |
6 | * $Log: dsstypes.h,v $ |
7 | * Revision 1.3 2005/10/28 02:57:04 jms |
8 | * allow for larger names in customer table |
9 | * |
10 | * Revision 1.2 2005/01/03 20:08:58 jms |
11 | * change line terminations |
12 | * |
13 | * Revision 1.1.1.1 2004/11/24 23:31:46 jms |
14 | * re-establish external server |
15 | * |
16 | * Revision 1.3 2004/04/07 20:17:29 jms |
17 | * bug #58 (join fails between order/lineitem) |
18 | * |
19 | * Revision 1.2 2004/01/22 05:49:29 jms |
20 | * AIX porting (AIX 5.1) |
21 | * |
22 | * Revision 1.1.1.1 2003/08/07 17:58:34 jms |
23 | * recreation after CVS crash |
24 | * |
25 | * Revision 1.2 2003/08/07 17:58:34 jms |
26 | * Convery RNG to 64bit space as preparation for new large scale RNG |
27 | * |
28 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms |
29 | * initial checkin |
30 | * |
31 | * |
32 | */ |
33 | /* |
34 | * general definitions and control information for the DSS data types |
35 | * and function prototypes |
36 | */ |
37 | |
38 | /* |
39 | * typedefs |
40 | */ |
41 | typedef struct |
42 | { |
43 | DSS_HUGE custkey; |
44 | char name[C_NAME_LEN + 3]; |
45 | char address[C_ADDR_MAX + 1]; |
46 | int alen; |
47 | DSS_HUGE nation_code; |
48 | char phone[PHONE_LEN + 1]; |
49 | DSS_HUGE acctbal; |
50 | char mktsegment[MAXAGG_LEN + 1]; |
51 | char [C_CMNT_MAX + 1]; |
52 | int clen; |
53 | } customer_t; |
54 | /* customers.c */ |
55 | long mk_cust PROTO((DSS_HUGE n_cust, customer_t * c)); |
56 | int pr_cust PROTO((customer_t * c, int mode)); |
57 | int ld_cust PROTO((customer_t * c, int mode)); |
58 | |
59 | typedef struct |
60 | { |
61 | DSS_HUGE okey; |
62 | DSS_HUGE partkey; |
63 | DSS_HUGE suppkey; |
64 | DSS_HUGE lcnt; |
65 | DSS_HUGE quantity; |
66 | DSS_HUGE eprice; |
67 | DSS_HUGE discount; |
68 | DSS_HUGE tax; |
69 | char rflag[1]; |
70 | char lstatus[1]; |
71 | char cdate[DATE_LEN]; |
72 | char sdate[DATE_LEN]; |
73 | char rdate[DATE_LEN]; |
74 | char shipinstruct[MAXAGG_LEN + 1]; |
75 | char shipmode[MAXAGG_LEN + 1]; |
76 | char [L_CMNT_MAX + 1]; |
77 | int clen; |
78 | } line_t; |
79 | |
80 | typedef struct |
81 | { |
82 | DSS_HUGE okey; |
83 | DSS_HUGE custkey; |
84 | char orderstatus; |
85 | DSS_HUGE totalprice; |
86 | char odate[DATE_LEN]; |
87 | char opriority[MAXAGG_LEN + 1]; |
88 | char clerk[O_CLRK_LEN + 1]; |
89 | long spriority; |
90 | DSS_HUGE lines; |
91 | char [O_CMNT_MAX + 1]; |
92 | int clen; |
93 | line_t l[O_LCNT_MAX]; |
94 | } order_t; |
95 | |
96 | /* order.c */ |
97 | long mk_order PROTO((DSS_HUGE index, order_t * o, long upd_num)); |
98 | int pr_order PROTO((order_t * o, int mode)); |
99 | int ld_order PROTO((order_t * o, int mode)); |
100 | void mk_sparse PROTO((DSS_HUGE index, DSS_HUGE *ok, long seq)); |
101 | |
102 | typedef struct |
103 | { |
104 | DSS_HUGE partkey; |
105 | DSS_HUGE suppkey; |
106 | DSS_HUGE qty; |
107 | DSS_HUGE scost; |
108 | char [PS_CMNT_MAX + 1]; |
109 | int clen; |
110 | } partsupp_t; |
111 | |
112 | typedef struct |
113 | { |
114 | DSS_HUGE partkey; |
115 | char name[P_NAME_LEN + 1]; |
116 | int nlen; |
117 | char mfgr[P_MFG_LEN + 1]; |
118 | char brand[P_BRND_LEN + 1]; |
119 | char type[P_TYPE_LEN + 1]; |
120 | int tlen; |
121 | DSS_HUGE size; |
122 | char container[P_CNTR_LEN + 1]; |
123 | DSS_HUGE retailprice; |
124 | char [P_CMNT_MAX + 1]; |
125 | int clen; |
126 | partsupp_t s[SUPP_PER_PART]; |
127 | } part_t; |
128 | |
129 | /* parts.c */ |
130 | long mk_part PROTO((DSS_HUGE index, part_t * p)); |
131 | int pr_part PROTO((part_t * part, int mode)); |
132 | int ld_part PROTO((part_t * part, int mode)); |
133 | |
134 | typedef struct |
135 | { |
136 | DSS_HUGE suppkey; |
137 | char name[S_NAME_LEN + 1]; |
138 | char address[S_ADDR_MAX + 1]; |
139 | int alen; |
140 | DSS_HUGE nation_code; |
141 | char phone[PHONE_LEN + 1]; |
142 | DSS_HUGE acctbal; |
143 | char [S_CMNT_MAX + 1]; |
144 | int clen; |
145 | } supplier_t; |
146 | /* supplier.c */ |
147 | long mk_supp PROTO((DSS_HUGE index, supplier_t * s)); |
148 | int pr_supp PROTO((supplier_t * supp, int mode)); |
149 | int ld_supp PROTO((supplier_t * supp, int mode)); |
150 | |
151 | typedef struct |
152 | { |
153 | DSS_HUGE timekey; |
154 | char alpha[DATE_LEN]; |
155 | long year; |
156 | long month; |
157 | long week; |
158 | long day; |
159 | } dss_time_t; |
160 | |
161 | /* time.c */ |
162 | long mk_time PROTO((DSS_HUGE h, dss_time_t * t)); |
163 | |
164 | /* |
165 | * this assumes that N_CMNT_LEN >= R_CMNT_LEN |
166 | */ |
167 | typedef struct |
168 | { |
169 | DSS_HUGE code; |
170 | char *text; |
171 | long join; |
172 | char [N_CMNT_MAX + 1]; |
173 | int clen; |
174 | } code_t; |
175 | |
176 | /* code table */ |
177 | int mk_nation PROTO((DSS_HUGE i, code_t * c)); |
178 | int pr_nation PROTO((code_t * c, int mode)); |
179 | int ld_nation PROTO((code_t * c, int mode)); |
180 | int mk_region PROTO((DSS_HUGE i, code_t * c)); |
181 | int pr_region PROTO((code_t * c, int mode)); |
182 | int ld_region PROTO((code_t * c, int mode)); |
183 | |
184 | |