-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.h
46 lines (35 loc) · 903 Bytes
/
list.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
#ifndef LIST
#define LIST
#include "intercode.h"
#include "type-symbol.h"
#include<stdio.h>
// add elements from head in all lists
//-------- OpList ---------//
struct OpListNode_def{
Operand val_;
struct OpListNode_def *next;
struct OpListNode_def *prev;
};
typedef struct OpListNode_def OpListNode;
struct OpList_def{
struct OpListNode_def *head_;
struct OpListNode_def *tail_;
};
typedef struct OpList_def OpList;
OpList* OpListInit();
void OpListInsert(OpList* self, Operand val);
//-------- IntList ---------//
struct IntListNode_def{
int val_;
struct IntListNode_def *next;
struct IntListNode_def *prev;
};
typedef struct IntListNode_def IntListNode;
struct IntList_def{
struct IntListNode_def *head_;
struct IntListNode_def *tail_;
};
typedef struct IntList_def IntList;
IntList* IntListInit();
void IntListInsert(IntList* self, int val);
#endif