source: doc/theses/mike_brooks_MMath/programs/lst-issues-intrusive.run.c @ 9bb6c5f

Last change on this file since 9bb6c5f was 1379c96e, checked in by Peter A. Buhr <pabuhr@…>, 7 months ago

formatting changes to programs

  • Property mode set to 100644
File size: 408 bytes
RevLine 
[5717495]1#include <sys/queue.h>
2#include <stdio.h>
3
4
5
6int main() {
7
8
9
10
11
12
13
14
15
16
17
18
19
20// C
21
22struct req {
[5546f50b]23        int pri, rqr;
[1379c96e]24        LIST_ENTRY(req) d;
[5717495]25};
26LIST_HEAD(reql, req);
27
28struct reql reqs;
29LIST_INIT(&reqs);
30
[1379c96e]31struct req r1 = {1, 42}, r2 = {2, 42};
[5717495]32
[1379c96e]33LIST_INSERT_HEAD(&reqs, &r2, d);
34LIST_INSERT_HEAD(&reqs, &r1, d);
[5717495]35
36
37
38
39
40
41
42
43
44
45
46struct req *cur;
[1379c96e]47LIST_FOREACH(cur, &reqs, d)
[5546f50b]48        printf("{%d %d} ", cur->pri, cur->rqr);
[5717495]49printf("\n");
50
[5546f50b]51}
Note: See TracBrowser for help on using the repository browser.