-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopic.h
More file actions
57 lines (40 loc) · 1.27 KB
/
Copy pathtopic.h
File metadata and controls
57 lines (40 loc) · 1.27 KB
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
struct Topic
{
char *id;
char **concepts;
size_t concepts_number;
char *title;
char *parent_id;
char **children_id;
size_t children_number;
struct ooDict *documents;
/* TODO: it must be not size_t but long-arithm number or string */
size_t documents_number;
/** interface methods **/
/* checks id's syntax */
int (*verify_id)(struct Topic *self,
char *id);
/* alloc mem and makes string copy */
int (*set_title)(struct Topic *self,
char *title);
/* alloc mem and makes string copy */
int (*set_id)(struct Topic *self,
char *id);
/* getting topics child by his id */
int (*get_child)(struct Topic *self,
char *id,
struct Topic **child);
/* add new keyword */
int (*add_concept)(struct Topic *self,
char *name);
int (*add_child)(struct Topic *self,
struct Topic *child);
/* getting parent's id */
int (*predict_parent_id)(struct Topic *self, char *id);
int (*init)(struct Topic *self);
/* destructor */
int (*del)(struct Topic *self);
int (*str)(struct Topic *self);
};
/* constructor */
extern int Topic_new(struct Topic **topic);