Lines Matching refs:entry
61 struct entry {
70 static struct entry *entry;
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);
165 free(entry);
190 free(entry);
202 struct entry *tmp;
205 if ((tmp = realloc(entry, sizeof (struct entry)
208 entry = tmp;
237 * RUSERSVERS_3 format, and store in entry database.
243 struct entry *entryp, *lim;
268 struct entry *tmp;
271 if ((tmp = realloc(entry, sizeof (struct entry)
274 entry = tmp;
281 lim = entry + curentry;
282 for (entryp = entry; entryp < lim; entryp++) {
301 * if raw, print this entry out immediately
319 entry[curentry].machine = malloc(MACHINELEN + 1);
320 if (entry[curentry].machine == NULL) {
324 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
325 entry[curentry++].cnt = 0;
330 entry[curentry].machine = malloc(MACHINELEN + 1);
331 if (entry[curentry].machine == NULL) {
335 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
336 entry[curentry].cnt = cnt;
337 iconvert = &entry[curentry].users;
354 entry[curentry].idle = minidle;
369 struct entry *entryp, *lim;
395 struct entry *tmp;
398 if ((tmp = realloc(entry, sizeof (struct entry)
401 entry = tmp;
408 lim = entry + curentry;
409 for (entryp = entry; entryp < lim; entryp++) {
427 * if raw, print this entry out immediately
442 entry[curentry].machine = malloc(MACHINELEN + 1);
443 if (entry[curentry].machine == NULL) {
447 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
448 entry[curentry++].cnt = 0;
454 entry[curentry].machine = malloc(MACHINELEN + 1);
455 if (entry[curentry].machine == NULL) {
459 (void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
460 entry[curentry].cnt = cnt;
461 entry[curentry].users.utmp_array_len = cnt;
462 entry[curentry].users.utmp_array_val = malloc(cnt *
466 entry[curentry].users.utmp_array_val[i].ut_user =
468 entry[curentry].users.utmp_array_val[i].ut_line =
470 entry[curentry].users.utmp_array_val[i].ut_host =
472 entry[curentry].users.utmp_array_val[i].ut_time =
474 entry[curentry].users.utmp_array_val[i].ut_idle =
478 entry[curentry].idle = minidle;
498 qsort(entry, curentry, sizeof (struct entry), compare);
500 if (!lflag || (entry[i].cnt < 1)) {
502 MACHINELEN, entry[i].machine);
503 for (j = 0; j < entry[i].cnt; j++)
505 entry[i].users.utmp_array_val[j].ut_user);
508 for (j = 0; j < entry[i].cnt; j++)
509 putline_3(entry[i].machine,
510 &entry[i].users.utmp_array_val[j]);
516 hcompare(const struct entry *a, const struct entry *b)
522 ucompare(const struct entry *a, const struct entry *b)
528 icompare(const struct entry *a, const struct entry *b)
633 (void) printf("%12.12s: ", entry[i].machine);
634 if (entry[i].cnt) {
635 putline_3(entry[i].machine, &entry[i].users.utmp_array_val[0]);
636 for (j = 1; j < entry[i].cnt; j++) {
638 putline_3(entry[i].machine,
639 &entry[i].users.utmp_array_val[j]);
650 free(entry);