-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocess_test.c
More file actions
51 lines (39 loc) · 743 Bytes
/
Copy pathprocess_test.c
File metadata and controls
51 lines (39 loc) · 743 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
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "process.h"
int main() {
struct process a, b, c, d;
init_process_list();
memset(&a, 0, sizeof(a));
memset(&b, 0, sizeof(b));
memset(&c, 0, sizeof(c));
memset(&d, 0, sizeof(d));
a.tag = "a";
a.pid = 1;
b.tag = "b";
b.pid = 2;
c.tag = "c";
c.pid = 3;
d.tag = "d";
d.pid = 4;
add_process(&a);
add_process(&b);
add_process(&c);
add_process(&d);
print_processes();
printf("------\n");
remove_process(&a);
print_processes();
printf("------\n");
remove_process(&c);
print_processes();
printf("------\n");
remove_process(&b);
print_processes();
printf("------\n");
remove_process(&d);
print_processes();
printf("------\n");
return 1;
}