annotate src/list/listContext.h @ 55:2ff693c5563c

Add stub to list
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Tue, 16 Jun 2015 01:18:39 +0900
parents 2bdd8e2118c7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Context definition for list example */
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #define ALLOCATE_SIZE 100
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 enum Code {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 Code1,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 Code2,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 Code3,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 Code4,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 Code5,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 Code6,
55
2ff693c5563c Add stub to list
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
12 Code7,
34
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 Allocator,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 Append,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 Traverse,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 Delete,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 Exit,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 };
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 enum UniqueData {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 Allocate,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 List,
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 };
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 struct Context {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 int codeNum;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 __code (**code) (struct Context *);
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 void* heap_start;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 void* heap;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 long dataSize;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 int dataNum;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 union Data* head;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 union Data** data;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 };
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 union Data {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 long count;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 struct List {
55
2ff693c5563c Add stub to list
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
39 struct Element* head;
2ff693c5563c Add stub to list
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
40 struct Element* tail;
2ff693c5563c Add stub to list
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
41 struct Element* current;
34
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 } list;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 struct Element {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 int value;
55
2ff693c5563c Add stub to list
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
45 struct Element* next;
34
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 } element;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 struct Allocate {
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 long size;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 enum Code next;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 enum Code after_append;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 enum Code after_delete;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 enum Code after_traverse;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 } allocate;
c3314208d7b9 Add listContext files
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 };