Lines Matching refs:entry
61 struct entry { struct
70 static struct entry *entry; variable
82 static int hcompare(const struct entry *, const struct entry *);
83 static int icompare(const struct entry *, const struct entry *);
84 static int ucompare(const struct entry *, const struct entry *);
110 entry = malloc(sizeof (struct entry) * total_entries); in main()
165 free(entry); in main()
190 free(entry); in main()
202 struct entry *tmp; in singlehost()
205 if ((tmp = realloc(entry, sizeof (struct entry) in singlehost()
208 entry = tmp; in singlehost()
243 struct entry *entryp, *lim; in collectnames()
268 struct entry *tmp; in collectnames()
271 if ((tmp = realloc(entry, sizeof (struct entry) in collectnames()
274 entry = tmp; in collectnames()
281 lim = entry + curentry; in collectnames()
282 for (entryp = entry; entryp < lim; entryp++) { in collectnames()
319 entry[curentry].machine = malloc(MACHINELEN + 1); in print_info()
320 if (entry[curentry].machine == NULL) { in print_info()
324 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1); in print_info()
325 entry[curentry++].cnt = 0; in print_info()
330 entry[curentry].machine = malloc(MACHINELEN + 1); in print_info()
331 if (entry[curentry].machine == NULL) { in print_info()
335 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1); in print_info()
336 entry[curentry].cnt = cnt; in print_info()
337 iconvert = &entry[curentry].users; in print_info()
354 entry[curentry].idle = minidle; in print_info()
369 struct entry *entryp, *lim; in collectnames_3()
395 struct entry *tmp; in collectnames_3()
398 if ((tmp = realloc(entry, sizeof (struct entry) in collectnames_3()
401 entry = tmp; in collectnames_3()
408 lim = entry + curentry; in collectnames_3()
409 for (entryp = entry; entryp < lim; entryp++) { in collectnames_3()
442 entry[curentry].machine = malloc(MACHINELEN + 1); in print_info_3()
443 if (entry[curentry].machine == NULL) { in print_info_3()
447 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1); in print_info_3()
448 entry[curentry++].cnt = 0; in print_info_3()
454 entry[curentry].machine = malloc(MACHINELEN + 1); in print_info_3()
455 if (entry[curentry].machine == NULL) { in print_info_3()
459 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1); in print_info_3()
460 entry[curentry].cnt = cnt; in print_info_3()
461 entry[curentry].users.utmp_array_len = cnt; in print_info_3()
462 entry[curentry].users.utmp_array_val = malloc(cnt * in print_info_3()
466 entry[curentry].users.utmp_array_val[i].ut_user = in print_info_3()
468 entry[curentry].users.utmp_array_val[i].ut_line = in print_info_3()
470 entry[curentry].users.utmp_array_val[i].ut_host = in print_info_3()
472 entry[curentry].users.utmp_array_val[i].ut_time = in print_info_3()
474 entry[curentry].users.utmp_array_val[i].ut_idle = in print_info_3()
478 entry[curentry].idle = minidle; in print_info_3()
498 qsort(entry, curentry, sizeof (struct entry), compare); in printnames()
500 if (!lflag || (entry[i].cnt < 1)) { in printnames()
502 MACHINELEN, entry[i].machine); in printnames()
503 for (j = 0; j < entry[i].cnt; j++) in printnames()
505 entry[i].users.utmp_array_val[j].ut_user); in printnames()
508 for (j = 0; j < entry[i].cnt; j++) in printnames()
509 putline_3(entry[i].machine, in printnames()
510 &entry[i].users.utmp_array_val[j]); in printnames()
516 hcompare(const struct entry *a, const struct entry *b) in hcompare()
522 ucompare(const struct entry *a, const struct entry *b) in ucompare()
528 icompare(const struct entry *a, const struct entry *b) in icompare()
633 (void) printf("%12.12s: ", entry[i].machine); in printit()
634 if (entry[i].cnt) { in printit()
635 putline_3(entry[i].machine, &entry[i].users.utmp_array_val[0]); in printit()
636 for (j = 1; j < entry[i].cnt; j++) { in printit()
638 putline_3(entry[i].machine, in printit()
639 &entry[i].users.utmp_array_val[j]); in printit()
650 free(entry); in usage()