1 | /* |
2 | * general definitions and control information for the DSS data types |
3 | * and function prototypes |
4 | */ |
5 | |
6 | #pragma once |
7 | |
8 | #ifdef __cplusplus |
9 | extern "C" { |
10 | #endif |
11 | |
12 | /* |
13 | * typedefs |
14 | */ |
15 | typedef struct { |
16 | DSS_HUGE custkey; |
17 | char name[C_NAME_LEN + 3]; |
18 | char address[C_ADDR_MAX + 1]; |
19 | int alen; |
20 | DSS_HUGE nation_code; |
21 | char phone[PHONE_LEN + 1]; |
22 | DSS_HUGE acctbal; |
23 | char mktsegment[MAXAGG_LEN + 1]; |
24 | char [C_CMNT_MAX + 1]; |
25 | int clen; |
26 | } customer_t; |
27 | /* customers.c */ |
28 | long mk_cust PROTO((DSS_HUGE n_cust, customer_t *c)); |
29 | int pr_cust PROTO((customer_t * c, int mode)); |
30 | int ld_cust PROTO((customer_t * c, int mode)); |
31 | |
32 | typedef struct { |
33 | DSS_HUGE okey; |
34 | DSS_HUGE partkey; |
35 | DSS_HUGE suppkey; |
36 | DSS_HUGE lcnt; |
37 | DSS_HUGE quantity; |
38 | DSS_HUGE eprice; |
39 | DSS_HUGE discount; |
40 | DSS_HUGE tax; |
41 | char rflag[1]; |
42 | char lstatus[1]; |
43 | char cdate[DATE_LEN]; |
44 | char sdate[DATE_LEN]; |
45 | char rdate[DATE_LEN]; |
46 | char shipinstruct[MAXAGG_LEN + 1]; |
47 | char shipmode[MAXAGG_LEN + 1]; |
48 | char [L_CMNT_MAX + 1]; |
49 | int clen; |
50 | } line_t; |
51 | |
52 | typedef struct { |
53 | DSS_HUGE okey; |
54 | DSS_HUGE custkey; |
55 | char orderstatus; |
56 | DSS_HUGE totalprice; |
57 | char odate[DATE_LEN]; |
58 | char opriority[MAXAGG_LEN + 1]; |
59 | char clerk[O_CLRK_LEN + 1]; |
60 | long spriority; |
61 | DSS_HUGE lines; |
62 | char [O_CMNT_MAX + 1]; |
63 | int clen; |
64 | line_t l[O_LCNT_MAX]; |
65 | } order_t; |
66 | |
67 | /* order.c */ |
68 | long mk_order PROTO((DSS_HUGE index, order_t *o, long upd_num)); |
69 | int pr_order PROTO((order_t * o, int mode)); |
70 | int ld_order PROTO((order_t * o, int mode)); |
71 | void mk_sparse PROTO((DSS_HUGE index, DSS_HUGE *ok, long seq)); |
72 | |
73 | typedef struct { |
74 | DSS_HUGE partkey; |
75 | DSS_HUGE suppkey; |
76 | DSS_HUGE qty; |
77 | DSS_HUGE scost; |
78 | char [PS_CMNT_MAX + 1]; |
79 | int clen; |
80 | } partsupp_t; |
81 | |
82 | typedef struct { |
83 | DSS_HUGE partkey; |
84 | char name[P_NAME_LEN + 1]; |
85 | int nlen; |
86 | char mfgr[P_MFG_LEN + 1]; |
87 | char brand[P_BRND_LEN + 1]; |
88 | char type[P_TYPE_LEN + 1]; |
89 | int tlen; |
90 | DSS_HUGE size; |
91 | char container[P_CNTR_LEN + 1]; |
92 | DSS_HUGE retailprice; |
93 | char [P_CMNT_MAX + 1]; |
94 | int clen; |
95 | partsupp_t s[SUPP_PER_PART]; |
96 | } part_t; |
97 | |
98 | /* parts.c */ |
99 | long mk_part PROTO((DSS_HUGE index, part_t *p)); |
100 | int pr_part PROTO((part_t * part, int mode)); |
101 | int ld_part PROTO((part_t * part, int mode)); |
102 | |
103 | typedef struct { |
104 | DSS_HUGE suppkey; |
105 | char name[S_NAME_LEN + 1]; |
106 | char address[S_ADDR_MAX + 1]; |
107 | int alen; |
108 | DSS_HUGE nation_code; |
109 | char phone[PHONE_LEN + 1]; |
110 | DSS_HUGE acctbal; |
111 | char [S_CMNT_MAX + 1]; |
112 | int clen; |
113 | } supplier_t; |
114 | /* supplier.c */ |
115 | long mk_supp PROTO((DSS_HUGE index, supplier_t *s)); |
116 | int pr_supp PROTO((supplier_t * supp, int mode)); |
117 | int ld_supp PROTO((supplier_t * supp, int mode)); |
118 | |
119 | typedef struct { |
120 | DSS_HUGE timekey; |
121 | char alpha[DATE_LEN]; |
122 | long year; |
123 | long month; |
124 | long week; |
125 | long day; |
126 | } dss_time_t; |
127 | |
128 | /* time.c */ |
129 | long mk_time PROTO((DSS_HUGE h, dss_time_t *t)); |
130 | |
131 | /* |
132 | * this assumes that N_CMNT_LEN >= R_CMNT_LEN |
133 | */ |
134 | typedef struct { |
135 | DSS_HUGE code; |
136 | char *text; |
137 | long join; |
138 | char [N_CMNT_MAX + 1]; |
139 | int clen; |
140 | } code_t; |
141 | |
142 | /* code table */ |
143 | int mk_nation PROTO((DSS_HUGE i, code_t *c)); |
144 | int pr_nation PROTO((code_t * c, int mode)); |
145 | int ld_nation PROTO((code_t * c, int mode)); |
146 | int mk_region PROTO((DSS_HUGE i, code_t *c)); |
147 | int pr_region PROTO((code_t * c, int mode)); |
148 | int ld_region PROTO((code_t * c, int mode)); |
149 | |
150 | #ifdef __cplusplus |
151 | }; |
152 | #endif |
153 | |