-
Notifications
You must be signed in to change notification settings - Fork 0
/
structures.h
68 lines (58 loc) · 1 KB
/
structures.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
#ifndef Structures_h
#define Structures_h
typedef struct query {
int pid;
int type;
int operation;
int code;
int value;
char name[128];
} query;
typedef struct reply {
int code;
int amount;
int price;
}reply;
typedef struct article {
int refI;
int refF;
int price;
int accesses;
}article;
typedef struct sale {
int code;
int quantity;
int paidAmount;
}sale;
typedef struct user {
int pid;
char namedPipe[128];
int type;
int fd;
}user;
typedef struct stockAndPrice{
int stock;
int price;
}stockAndPrice;
typedef struct node {
user data;
struct node* next;
} NODE;
typedef struct cached{
int code;
int price;
int stock;
int accesses;
}cached;
void init(NODE** head);
NODE* add(NODE* node, user toI);
NODE* removeN(NODE* head, int pid);
NODE *free_list(NODE *head);
int getPipe(NODE*head, int pid);
void print_list(NODE* head);
int sizeList(NODE* head);
int pop(NODE* head);
void print_sale(sale s, int i);
int getLine(int fd, char* buffer, int n);
int space_counter(char* buf);
#endif