Lines Matching defs:pers

177 void decode(struct person *pers);
180 void findidle(struct person *pers);
181 void findwhen(struct person *pers);
189 void personprint(struct person *pers);
192 void quickprint(struct person *pers);
193 void shortprint(struct person *pers);
556 quickprint(struct person *pers)
558 (void) printf("%-8.8s ", pers->name);
559 if (pers->loggedin) {
561 findidle(pers);
563 pers->writable ? ' ' : '*',
564 pers->tty, ctime(&pers->loginat));
565 ltimeprint(" ", &pers->idletime, "");
568 pers->tty, ctime(&pers->loginat));
581 shortprint(struct person *pers)
585 if (pers->pwd == NULL) {
586 (void) printf("%-15s ???\n", pers->name);
589 (void) printf("%-8s", pers->pwd->pw_name);
591 if (pers->realname != NULL) {
592 (void) printf(" %-20.20s", pers->realname);
598 if (pers->loggedin && !pers->writable) {
603 if (*pers->tty) {
604 (void) printf("%-11.11s ", pers->tty);
608 p = ctime(&pers->loginat);
609 if (pers->loggedin) {
610 stimeprint(&pers->idletime);
612 } else if (pers->loginat == 0) {
614 } else if (tloc - pers->loginat >= 180 * 24 * 60 * 60) {
619 if (*pers->host) {
620 (void) printf(" %-20.20s", pers->host);
622 if (pers->ttyloc != NULL)
623 (void) printf(" %-20.20s", pers->ttyloc);
634 personprint(struct person *pers)
636 if (pers->pwd == NULL) {
638 pers->name);
641 (void) printf("Login name: %-10s", pers->pwd->pw_name);
642 if (pers->loggedin && !pers->writable) {
647 if (pers->realname != NULL) {
648 (void) printf("In real life: %s", pers->realname);
651 (void) printf("\nDirectory: %-25s", pers->pwd->pw_dir);
652 if (*pers->pwd->pw_shell)
653 (void) printf("\tShell: %-s", pers->pwd->pw_shell);
655 if (pers->loggedin) {
656 char *ep = ctime(&pers->loginat);
657 if (*pers->host) {
659 &ep[4], pers->tty, pers->host);
660 ltimeprint("\n", &pers->idletime, " Idle Time");
663 &ep[4], pers->tty);
664 ltimeprint("\n", &pers->idletime, " Idle Time");
666 } else if (pers->loginat == 0) {
668 } else if (tloc - pers->loginat > 180 * 24 * 60 * 60) {
669 char *ep = ctime(&pers->loginat);
671 ep, ep+20, pers->tty);
672 if (*pers->host) {
673 (void) printf(" from %s", pers->host);
676 char *ep = ctime(&pers->loginat);
677 (void) printf("\nLast login %16.16s on %s", ep, pers->tty);
678 if (*pers->host) {
679 (void) printf(" from %s", pers->host);
690 decode(struct person *pers)
695 pers->realname = NULL;
696 if (pers->pwd == NULL)
698 gp = pers->pwd->pw_gecos;
708 lp = pers->pwd->pw_name;
721 pers->realname = strdup(buffer);
722 if (pers->loggedin)
723 findidle(pers);
725 findwhen(pers);
741 findwhen(struct person *pers)
746 if (fseeko(lf, (off_t)pers->pwd->pw_uid * (off_t)sizeof (ll),
754 bcopy(ll.ll_line, pers->tty, l_max);
755 pers->tty[l_max] = '\0';
756 bcopy(ll.ll_host, pers->host, h_max);
757 pers->host[h_max] = '\0';
758 pers->loginat = ll.ll_time;
763 pers->tty[0] = 0;
764 pers->host[0] = 0;
765 pers->loginat = 0L;
772 pers->tty[0] = 0;
773 pers->host[0] = 0;
774 pers->loginat = 0L;
790 findidle(struct person *pers)
799 (void) strcpy(buffer + TTYLEN, pers->tty);
806 if (strcmp(pers->tty, "console") == 0) {
825 pers->idletime = (time_t)0;
827 pers->idletime = t - lastinputtime;
828 pers->writable = (ttystatus.st_mode & TALKABLE) == TALKABLE;