-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.h
79 lines (68 loc) · 1.89 KB
/
Node.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
#ifndef _NODE_H_
#define _NODE_H_
#include "Object.h"
#include "String.h"
typedef struct Node_char Node_char;
typedef struct Node_float Node_float;
typedef struct Node_double Node_double;
typedef struct Node_short Node_short;
typedef struct Node_int Node_int;
typedef struct Node_long Node_long;
typedef struct Node_ptr Node_ptr;
typedef struct Node_String Node_String;
typedef struct Node_int_int Node_int_int;
typedef struct Node_int_long Node_int_long;
typedef struct Node_int_ptr Node_int_ptr;
typedef struct Node_int_String Node_int_String;
typedef struct Node_long_int Node_long_int;
typedef struct Node_long_long Node_long_long;
typedef struct Node_long_String Node_long_String;
typedef struct Node_long_ptr Node_long_ptr;
typedef struct Node_String_int Node_String_int;
typedef struct Node_String_long Node_String_long;
typedef struct Node_String_String Node_String_String;
typedef struct Node_String_ptr Node_String_ptr;
typedef struct Node_ptr_int Node_ptr_int;
typedef struct Node_ptr_long Node_ptr_long;
typedef struct Node_ptr_String Node_ptr_String;
typedef struct Node_ptr_ptr Node_ptr_ptr;
#define UniNode(T) struct Node_##T { \
Node_##T * pre; \
Node_##T * next; \
T value; \
}
#define BiNode(K, V) struct Node_##K##_##V { \
Node_##K##_##V * pre; \
Node_##K##_##V * next; \
K key; \
V value; \
}
void Node_connect(void * father, void * son) {
*(void**)(father + 8) = son;
*(void**)son = father;
}
UniNode(int);
UniNode(long);
UniNode(ptr);
UniNode(char);
UniNode(short);
UniNode(float);
UniNode(double);
UniNode(String);
BiNode(int,int);
BiNode(int,long);
BiNode(int,String);
BiNode(int,ptr);
BiNode(long,int);
BiNode(long,long);
BiNode(long,String);
BiNode(long,ptr);
BiNode(String,int);
BiNode(String,long);
BiNode(String,ptr);
BiNode(String,String);
BiNode(ptr,int);
BiNode(ptr,long);
BiNode(ptr,String);
BiNode(ptr,ptr);
#endif