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
9extern "C" {
10#endif
11
12/*
13 * typedefs
14 */
15typedef 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 comment[C_CMNT_MAX + 1];
25 int clen;
26} customer_t;
27/* customers.c */
28long mk_cust PROTO((DSS_HUGE n_cust, customer_t *c));
29int pr_cust PROTO((customer_t * c, int mode));
30int ld_cust PROTO((customer_t * c, int mode));
31
32typedef 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 comment[L_CMNT_MAX + 1];
49 int clen;
50} line_t;
51
52typedef 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 comment[O_CMNT_MAX + 1];
63 int clen;
64 line_t l[O_LCNT_MAX];
65} order_t;
66
67/* order.c */
68long mk_order PROTO((DSS_HUGE index, order_t *o, long upd_num));
69int pr_order PROTO((order_t * o, int mode));
70int ld_order PROTO((order_t * o, int mode));
71void mk_sparse PROTO((DSS_HUGE index, DSS_HUGE *ok, long seq));
72
73typedef struct {
74 DSS_HUGE partkey;
75 DSS_HUGE suppkey;
76 DSS_HUGE qty;
77 DSS_HUGE scost;
78 char comment[PS_CMNT_MAX + 1];
79 int clen;
80} partsupp_t;
81
82typedef 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 comment[P_CMNT_MAX + 1];
94 int clen;
95 partsupp_t s[SUPP_PER_PART];
96} part_t;
97
98/* parts.c */
99long mk_part PROTO((DSS_HUGE index, part_t *p));
100int pr_part PROTO((part_t * part, int mode));
101int ld_part PROTO((part_t * part, int mode));
102
103typedef 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 comment[S_CMNT_MAX + 1];
112 int clen;
113} supplier_t;
114/* supplier.c */
115long mk_supp PROTO((DSS_HUGE index, supplier_t *s));
116int pr_supp PROTO((supplier_t * supp, int mode));
117int ld_supp PROTO((supplier_t * supp, int mode));
118
119typedef 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 */
129long mk_time PROTO((DSS_HUGE h, dss_time_t *t));
130
131/*
132 * this assumes that N_CMNT_LEN >= R_CMNT_LEN
133 */
134typedef struct {
135 DSS_HUGE code;
136 char *text;
137 long join;
138 char comment[N_CMNT_MAX + 1];
139 int clen;
140} code_t;
141
142/* code table */
143int mk_nation PROTO((DSS_HUGE i, code_t *c));
144int pr_nation PROTO((code_t * c, int mode));
145int ld_nation PROTO((code_t * c, int mode));
146int mk_region PROTO((DSS_HUGE i, code_t *c));
147int pr_region PROTO((code_t * c, int mode));
148int ld_region PROTO((code_t * c, int mode));
149
150#ifdef __cplusplus
151};
152#endif
153