-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardv.h
51 lines (42 loc) · 809 Bytes
/
hardv.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
#define MAXN 65536
#define KCHAR "abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
#define Q "Q"
#define A "A"
#define MOD "MOD"
#define PREV "PREV"
#define NEXT "NEXT"
struct option {
int exact;
int rand;
int maxn;
};
struct field {
char *key;
char *val;
struct field *next;
};
struct card {
char *head;
struct field *field;
char *tail;
char *file;
};
/* main.c */
extern char *progname;
extern struct option opt;
extern time_t now;
/* ctab.c */
extern struct card *ctab;
extern size_t ncards;
void ctabload(char *file);
void ctabdump(char *file);
/* learn.c */
void learn(void);
/* parse.c */
void parseinit(char *path);
struct card *parsecard(struct card *dst);
void parsedone(void);
/* utils.c */
time_t elapsecs(char *buf);
void err(char *fmt, ...);
void syserr(void);