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