version 1.26, 2003/06/03 02:56:09 |
version 1.27, 2003/06/10 22:20:47 |
|
|
#define HOST_WIDTH 24 |
#define HOST_WIDTH 24 |
|
|
int |
int |
main(argc, argv) |
main(int argc, char *argv[]) |
int argc; |
|
char *argv[]; |
|
{ |
{ |
extern int optind; |
extern int optind; |
extern char *optarg; |
extern char *optarg; |
|
|
*/ |
*/ |
|
|
void |
void |
checkargs() |
checkargs(void) |
{ |
{ |
ARG *step; |
ARG *step; |
int ttyflag = 0; |
int ttyflag = 0; |
|
|
* read through the wtmp file |
* read through the wtmp file |
*/ |
*/ |
void |
void |
wtmp() |
wtmp(void) |
{ |
{ |
struct utmp *bp; /* current structure */ |
struct utmp *bp; /* current structure */ |
TTY *T; /* tty list entry */ |
TTY *T; /* tty list entry */ |
|
|
* see if want this entry |
* see if want this entry |
*/ |
*/ |
int |
int |
want(bp, check) |
want(struct utmp *bp, int check) |
struct utmp *bp; |
|
int check; |
|
{ |
{ |
ARG *step; |
ARG *step; |
|
|
|
|
* add an entry to a linked list of arguments |
* add an entry to a linked list of arguments |
*/ |
*/ |
void |
void |
addarg(type, arg) |
addarg(int type, char *arg) |
int type; |
|
char *arg; |
|
{ |
{ |
ARG *cur; |
ARG *cur; |
|
|
|
|
* add an entry to a linked list of ttys |
* add an entry to a linked list of ttys |
*/ |
*/ |
TTY * |
TTY * |
addtty(ttyname) |
addtty(char *ttyname) |
char *ttyname; |
|
{ |
{ |
TTY *cur; |
TTY *cur; |
|
|
|
|
* off the domain suffix since that's what login(1) does. |
* off the domain suffix since that's what login(1) does. |
*/ |
*/ |
void |
void |
hostconv(arg) |
hostconv(char *arg) |
char *arg; |
|
{ |
{ |
static int first = 1; |
static int first = 1; |
static char *hostdot, name[MAXHOSTNAMELEN]; |
static char *hostdot, name[MAXHOSTNAMELEN]; |
|
|
* convert tty to correct name. |
* convert tty to correct name. |
*/ |
*/ |
char * |
char * |
ttyconv(arg) |
ttyconv(char *arg) |
char *arg; |
|
{ |
{ |
char *mval; |
char *mval; |
size_t len = 8; |
size_t len = 8; |
|
|
* Derived from atime_arg1() in usr.bin/touch/touch.c |
* Derived from atime_arg1() in usr.bin/touch/touch.c |
*/ |
*/ |
time_t |
time_t |
dateconv(arg) |
dateconv(char *arg) |
char *arg; |
|
{ |
{ |
time_t timet; |
time_t timet; |
struct tm *t; |
struct tm *t; |
|
|
* on interrupt, we inform the user how far we've gotten |
* on interrupt, we inform the user how far we've gotten |
*/ |
*/ |
void |
void |
onintr(signo) |
onintr(int signo) |
int signo; |
|
{ |
{ |
char str[1024], *ct; |
char str[1024], *ct; |
|
|