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