aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/faces/faces.h
blob: 0a4661c1f4e578b2c6a8e4cdaa59c70233f14774 (plain)
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
enum	/* face strings */
{
	Suser,
	Sdomain,
	Sshow,
	Sdigest,
	Nstring
};

enum
{
	Facesize = 48,
};

typedef struct Face		Face;
typedef struct Facefile	Facefile;

struct Face
{
	Image	*bit;		/* unless there's an error, this is file->image */
	Image	*mask;	/* unless there's an error, this is file->mask */
	char		*str[Nstring];
	int		recent;
	ulong	time;
	Tm		tm;
	int		unknown;
	Facefile	*file;
};

/*
 * Loading the files is slow enough on a dial-up line to be worth this trouble
 */
struct Facefile
{
	Image	*image;
	Image	*mask;
	ulong	mtime;
	ulong	rdtime;
	int		ref;
	char		*file;
	Facefile	*next;
};

extern char	date[];
extern char	*maildir;
extern char	**maildirs;
extern int	nmaildirs;
extern CFsys	*mailfs;

Face*	nextface(void);
void	findbit(Face*);
void	freeface(Face*);
void	initplumb(void);
void	killall(char*);
void	showmail(Face*);
void	delete(char*, char*);
void	freefacefile(Facefile*);
Face*	dirface(char*, char*);
void	resized(void);
int	alreadyseen(char*);
ulong	dirlen(char*);
ulong	fsdirlen(CFsys*, char*);

void	*emalloc(ulong);
void	*erealloc(void*, ulong);
char	*estrdup(char*);
char	*findfile(Face*, char*, char*);
void	addmaildir(char*);