-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.h
70 lines (62 loc) · 1.13 KB
/
tag.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
#ifndef __TAG_H__
#define __TAG_H__
/**
* @brief Tag header structure
*
*/
struct tag_header_t {
// char id[40];
struct tag_t* tags;
struct badge_t* badges;
};
/**
* @brief Tag structure
*
*/
struct tag_t {
char key[128];
char value[128];
struct badge_t* badges;
struct tag_t* next;
};
/**
* @brief Create a tag object
*
* @param raw
* @return struct tag_header_t*
*/
extern struct tag_header_t* create_tag(char* raw);
/**
* @brief Print tag linked-list from header
*
* @param header
*/
void print_tag_header(struct tag_header_t* header);
/**
* @brief Create a tag pair object
*
* @param key
* @param value
* @return struct tag_t*
*/
struct tag_t* create_tag_pair(char* key, char* value);
/**
* @brief Free tag from header
*
* @param header
*/
extern void free_tag_header(struct tag_header_t* header);
/**
* @brief Dissamble tag and attach to tag header
*
* @param header
* @param raw
*/
extern void disassemble_tag(struct tag_header_t* header, char* raw);
/**
* @brief Destory tag header from memory
*
* @param header
*/
extern void destroy_tag_header(struct tag_header_t* header);
#endif