| 17 #endif |
17 #endif |
| 18 |
18 |
| 19 #include <stdlib.h> |
19 #include <stdlib.h> |
| 20 #include <errno.h> |
20 #include <errno.h> |
| 21 |
21 |
| 22 Code_t ZSetLocation(exposure) |
22 Code_t |
| 23 char *exposure; |
23 ZSetLocation(char *exposure) |
| 24 { |
24 { |
| 25 return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH, |
25 return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH, |
| 26 "$sender logged in to $1 on $3 at $2")); |
26 "$sender logged in to $1 on $3 at $2")); |
| 27 } |
27 } |
| 28 |
28 |
| 29 Code_t ZUnsetLocation() |
29 Code_t |
| |
30 ZUnsetLocation(void) |
| 30 { |
31 { |
| 31 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH, |
32 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH, |
| 32 "$sender logged out of $1 on $3 at $2")); |
33 "$sender logged out of $1 on $3 at $2")); |
| 33 } |
34 } |
| 34 |
35 |
| 35 Code_t ZFlushMyLocations() |
36 Code_t |
| |
37 ZFlushMyLocations(void) |
| 36 { |
38 { |
| 37 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, "")); |
39 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, "")); |
| 38 } |
40 } |
| 39 |
41 |
| 40 static char host[MAXHOSTNAMELEN]; |
42 static char host[MAXHOSTNAMELEN]; |
| 41 static char *mytty = NULL; |
43 static char *mytty = NULL; |
| 42 static int reenter = 0; |
44 static int reenter = 0; |
| 43 |
45 |
| 44 Code_t Z_SendLocation(class, opcode, auth, format) |
46 Code_t |
| 45 char *class; |
47 Z_SendLocation(char *class, char *opcode, Z_AuthProc auth, char *format) |
| 46 char *opcode; |
|
| 47 Z_AuthProc auth; |
|
| 48 char *format; |
|
| 49 { |
48 { |
| 50 int retval; |
49 int retval; |
| 51 time_t ourtime; |
50 time_t ourtime; |
| 52 ZNotice_t notice, retnotice; |
51 ZNotice_t notice, retnotice; |
| 53 char *bptr[3]; |
52 char *bptr[3]; |