137660Sbostic /* 237660Sbostic * Copyright (c) 1989 The Regents of the University of California. 337660Sbostic * All rights reserved. 437660Sbostic * 540027Sbostic * This code is derived from software contributed to Berkeley by 640027Sbostic * Tony Nardo of the Johns Hopkins University/Applied Physics Lab. 740027Sbostic * 842731Sbostic * %sccs.include.redist.c% 937660Sbostic * 10*50596Sbostic * @(#)finger.h 5.6 (Berkeley) 07/27/91 1137660Sbostic */ 1237660Sbostic 1337664Sedward /* 1437664Sedward * All unique persons are linked in a list headed by "head" and linkd 1537664Sedward * by the "next" field, as well as kept in a hash table. 1637664Sedward */ 1737664Sedward 1837660Sbostic typedef struct person { 1937660Sbostic struct person *next; /* link to next person */ 2037664Sedward struct person *hlink; /* link to next person in hash bucket */ 2137660Sbostic uid_t uid; /* user id */ 2237660Sbostic char *dir; /* user's home directory */ 2337660Sbostic char *homephone; /* pointer to home phone no. */ 2437660Sbostic char *name; /* login name */ 2537660Sbostic char *office; /* pointer to office name */ 2637660Sbostic char *officephone; /* pointer to office phone no. */ 2737660Sbostic char *realname; /* pointer to full name */ 2837660Sbostic char *shell; /* user's shell */ 2937664Sedward struct where *whead, *wtail; /* list of where he is or has been */ 3037664Sedward } PERSON; 3137664Sedward 3237664Sedward enum status { LASTLOG, LOGGEDIN }; 3337664Sedward 3437664Sedward typedef struct where { 3537664Sedward struct where *next; /* next place he is or has been */ 3637664Sedward enum status info; /* type/status of request */ 3737664Sedward short writable; /* tty is writable */ 3837664Sedward time_t loginat; /* time of (last) login */ 3937664Sedward time_t idletime; /* how long idle (if logged in) */ 4037660Sbostic char tty[UT_LINESIZE+1]; /* null terminated tty line */ 4137660Sbostic char host[UT_HOSTSIZE+1]; /* null terminated remote host name */ 4237664Sedward } WHERE; 4337660Sbostic 4437664Sedward #define HBITS 8 /* number of bits in hash code */ 4537664Sedward #define HSIZE (1 << 8) /* hash table size */ 4637664Sedward #define HMASK (HSIZE - 1) /* hash code mask */ 4737664Sedward 48*50596Sbostic #include "extern.h" 49