-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.h
More file actions
40 lines (29 loc) · 809 Bytes
/
server.h
File metadata and controls
40 lines (29 loc) · 809 Bytes
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
struct request
{
char user[10];
int itemNumber;
int qty;
int price;
char type; //B v S
int id;
};
struct userLog //completed transactions (partially and wholly)
{
char buyer[10];
char seller[10];
int itemNumber;
int price;
int qty;
int buyRequestID;
int sellRequestID;
};
struct request userRequests[5][500]; //initial requests by users
int nRequest[5] = {0};
struct userLog tradeLog[5000]; //transactions completed, wholly or partially
int nTradeLog = 0;
int requestID=0;
struct request buyQueue[10][500];
struct request sellQueue[10][500];
int buyHead[10]={0}, buyTail[10]={0}, sellHead[10]={0}, sellTail[10]={0};
void sortInsert(struct request); //on basis of price then id
void removeItem(struct request);