-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatamng.h
51 lines (45 loc) · 841 Bytes
/
datamng.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
#include <stdarg.h>
#include <time.h>
typedef enum{
Started,
Ended,
Suspend,
Restarted,
Plan,
None
} mode;
typedef struct strTele tele;
typedef struct strTlist tlist;
struct strTele{
char *name;
int id;
tele *prev;
tele *next;
int spndnextid;
tlist *list;
time_t start;
time_t endt;
mode status;
};
struct strTlist{
int lenth;
tele *head;
tele *tail;
};
typedef struct{
tlist *iterobj;
int id;
int lenth;
tele *telep;
} iterlist;
tlist *listinit();
tele *add(tlist *list, char *name, mode status);
int delele(tlist *list, tele *ele);
int ptele(tele *,char *,...);
tele *findbyid(tlist *list, int id);
tele *findbyname(tlist *list, char *name);
int datach(tele *obj, char *fmt,...);
iterlist *newiter(tlist *obj);
tele *liter(iterlist *iterobj);
tlist *floads(char *fname);
int fsave(tlist *saveobj, char *fname);