xref: /original-bsd/usr.bin/finger/finger.h (revision a1c2194a)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Tony Nardo of the Johns Hopkins University/Applied Physics Lab.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)finger.h	5.6 (Berkeley) 07/27/91
11  */
12 
13 /*
14  * All unique persons are linked in a list headed by "head" and linkd
15  * by the "next" field, as well as kept in a hash table.
16  */
17 
18 typedef struct person {
19 	struct person *next;		/* link to next person */
20 	struct person *hlink;		/* link to next person in hash bucket */
21 	uid_t uid;			/* user id */
22 	char *dir;			/* user's home directory */
23 	char *homephone;		/* pointer to home phone no. */
24 	char *name;			/* login name */
25 	char *office;			/* pointer to office name */
26 	char *officephone;		/* pointer to office phone no. */
27 	char *realname;			/* pointer to full name */
28 	char *shell;			/* user's shell */
29 	struct where *whead, *wtail;	/* list of where he is or has been */
30 } PERSON;
31 
32 enum status { LASTLOG, LOGGEDIN };
33 
34 typedef struct where {
35 	struct where *next;		/* next place he is or has been */
36 	enum status info;		/* type/status of request */
37 	short writable;			/* tty is writable */
38 	time_t loginat;			/* time of (last) login */
39 	time_t idletime;		/* how long idle (if logged in) */
40 	char tty[UT_LINESIZE+1];	/* null terminated tty line */
41 	char host[UT_HOSTSIZE+1];	/* null terminated remote host name */
42 } WHERE;
43 
44 #define	HBITS	8			/* number of bits in hash code */
45 #define	HSIZE	(1 << 8)		/* hash table size */
46 #define	HMASK	(HSIZE - 1)		/* hash code mask */
47 
48 #include "extern.h"
49