forked from thewhoo/ifj15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ilist.h
80 lines (69 loc) · 1.36 KB
/
ilist.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
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Course IFJ @ FIT VUT Brno, 2015
* IFJ15 Interpreter Project
*
* Authors:
* Lukas Osadsky - xosads00
* Pavol Plaskon - xplask00
* Pavel Pospisil - xpospi88
* Matej Postolka - xposto02
*
* Unless otherwise stated, all code is licensed under a
* GNU General Public License v2.0
*
*/
/**
* @file ilist.h
* @brief Instruction List library
*
*/
#ifndef ILIST_H
#define ILIST_H
typedef struct listitem
{
int ins_type;
void *addr1;
void *addr2;
void *addr3;
struct listitem *next;
}TList_item;
typedef struct s_list
{
TList_item *first;
TList_item *act;
TList_item *last;
}Tins_list;
/**
* @brief Initialize empty list of instructions
*
* @return list Pointer to new list
*/
Tins_list* list_init();
/**
* @brief Deallocate list
*
* @param list Pointer to list
*/
void list_free(Tins_list *list);
/**
* @brief Insert new instruction item at the end of ins list
*
* @param list Pointer to list
* @param item Pointer to filled instruction
*/
void list_insert(Tins_list *list, TList_item *item);
/**
* @brief Set activity to first item in list
*
* @param list Pointer to list
*/
void list_first(Tins_list *list);
/**
* @brief Set activity to next instruction
*
* Nothing happens when empty list
*
* @param list Pointer to list
*/
void list_next(Tins_list *list);
#endif //ILIST_H