-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecord.h
52 lines (37 loc) · 825 Bytes
/
record.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
#ifndef NAT_RECORD_H_
#define NAT_RECORD_H_
typedef struct nat_record {
// unique id for record
int id;
int value;
/**
* Add extra fields here
*
*/
} NAT_Record;
/**
* @brief Create new record
*
* @param value The "value" field of the created record
* @return NAT_Record* Pointer to created record
*/
NAT_Record* NAT_createRecord(int value);
/**
* @brief Free record r
*
* @param r Pointer to record
*/
void NAT_freeRecord(NAT_Record *r);
/**
* @brief A function to compare records. Compares by: value, id
*
* @param r1 Pointer to record 1
* @param r2 Pointer to record 2
* @return int > 0 if |r1| > |r2|, < 0 if |r1| < |r2|, == 0 if |r1| == |r2|
*/
int NAT_recordsCompare1(NAT_Record *r1, NAT_Record *r2);
/**
* Add compare functions here
*
*/
#endif