Lines Matching +full:no +full:- +full:wp
4 /*-
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
37 * kfk 26 Jan 1984 - for login watch functions.
43 # define UTNAMLEN sizeof(((struct utmpx *) 0)->ut_name)
44 # define UTLINLEN sizeof(((struct utmpx *) 0)->ut_line)
46 # define UTHOSTLEN sizeof(((struct utmpx *) 0)->ut_host)
97 # define UTNAMLEN sizeof(((struct utmp *) 0)->ut_name)
98 # define UTLINLEN sizeof(((struct utmp *) 0)->ut_line)
103 # define UTHOSTLEN sizeof(((struct utmp *) 0)->ut_host)
170 * when doing pointer-chase searches.
197 int comp = -1, alldone;
205 struct who *wp, *wpnew; local
225 if ((v == NULL || v->vec == NULL) && !force) {
227 return; /* no names to watch */
230 trim(vp = v->vec);
238 if (t - watch_period < interval) {
245 * From: Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
276 * xterm clears the entire utmp entry - mark everyone on the status list
279 for (wp = whohead.who_next; wp->who_next != NULL; wp = wp->who_next)
280 wp->who_status = OFFLINE | CLEARED;
310 wp = whohead.who_next;
311 while (wp->who_next && (comp = strncmp(wp->who_tty, utmp.ut_line, UTLINLEN)) < 0)
312 wp = wp->who_next;/* find that tty! */
314 if (wp->who_next && comp == 0) { /* found the tty... */
315 if (utmp.ut_time < wp->who_time)
319 wp->who_time = utmp.ut_time;
320 wp->who_status = OFFLINE;
325 wp->who_time = utmp.ut_time;
326 wp->who_status = OFFLINE;
328 else if (strncmp(utmp.ut_name, wp->who_name, UTNAMLEN) == 0) {
330 wp->who_time = utmp.ut_time;
331 wp->who_status = ONLINE | ANNOUNCE; /* same guy */
334 (void) strncpy(wp->who_new, utmp.ut_name, UTNAMLEN);
337 host = ut_find_host(wp->who_tty);
339 (void) strncpy(wp->who_host, host, UTHOSTLEN);
341 wp->who_host[0] = 0;
343 (void) strncpy(wp->who_host, utmp.ut_host, UTHOSTLEN);
346 wp->who_time = utmp.ut_time;
347 if (wp->who_name[0] == '\0')
348 wp->who_status = ONLINE;
350 wp->who_status = CHANGED;
355 (void) strncpy(wpnew->who_tty, utmp.ut_line, UTLINLEN);
358 host = ut_find_host(wpnew->who_tty);
360 (void) strncpy(wpnew->who_host, host, UTHOSTLEN);
362 wpnew->who_host[0] = 0;
364 (void) strncpy(wpnew->who_host, utmp.ut_host, UTHOSTLEN);
367 wpnew->who_time = utmp.ut_time;
370 wpnew->who_status = OFFLINE;
374 wpnew->who_status = OFFLINE;
376 (void) strncpy(wpnew->who_new, utmp.ut_name, UTNAMLEN);
377 wpnew->who_status = ONLINE;
380 debugwholist(wpnew, wp);
383 wpnew->who_next = wp; /* link in a new 'who' */
384 wpnew->who_prev = wp->who_prev;
385 wpnew->who_prev->who_next = wpnew;
386 wp->who_prev = wpnew; /* linked in now */
412 for (wp = whohead.who_next; wp->who_next != NULL; wp = wp->who_next) {
413 if (wp->who_status & ANNOUNCE ||
415 !Gmatch(str2short(wp->who_name), vp[0]) &&
416 !Gmatch(str2short(wp->who_new), vp[0])) ||
417 (!Gmatch(str2short(wp->who_tty), vp[1]) &&
423 if (wp->who_status & CLEARED) {/* utmp entry was cleared */
424 wp->who_time = watch_period;
425 wp->who_status &= ~CLEARED;
428 if ((wp->who_status & OFFLINE) &&
429 (wp->who_name[0] != '\0')) {
431 print_who(wp);
432 wp->who_name[0] = '\0';
433 wp->who_status |= ANNOUNCE;
436 if (wp->who_status & ONLINE) {
438 print_who(wp);
439 (void) strcpy(wp->who_name, wp->who_new);
440 wp->who_status |= ANNOUNCE;
443 if (wp->who_status & CHANGED) {
445 print_who(wp);
446 (void) strcpy(wp->who_name, wp->who_new);
447 wp->who_status |= ANNOUNCE;
457 debugwholist(struct who *new, struct who *wp) argument
462 while (a->who_next != NULL) {
463 xprintf("%s/%s -> ", a->who_name, a->who_tty);
464 a = a->who_next;
473 while (a->who_prev != NULL) {
474 xprintf("%s/%s -> ", a->who_name, a->who_tty);
475 a = a->who_prev;
483 xprintf(CGETS(26, 6, "new: %s/%s\n"), new->who_name, new->who_tty);
484 if (wp)
485 xprintf("wp: %s/%s\n", wp->who_name, wp->who_tty);
491 print_who(struct who *wp) argument
501 if (vp && vp->vec && vp->vec[0])
502 cp = vp->vec[0];
504 str = tprintf(FMT_WHO, cp, NULL, wp->who_time, wp);
516 struct who *wp = ptr; local
526 switch (wp->who_status & STMASK) {
529 return strsave(wp->who_new);
531 return strsave(wp->who_name);
538 switch (wp->who_status & STMASK) {
544 return xasprintf(CGETS(26, 11, "replaced %s on"), wp->who_name);
552 if (wp->who_host[0] == '\0')
555 pb = wp->who_host;
572 if (wp->who_host[0] == '\0')
575 pb = wp->who_host;
587 return strsave(wp->who_tty);
603 struct who *wp; local
612 wp = whohead.who_next;
613 while (wp->who_next != NULL) {
614 wp->who_name[0] = '\0';
615 wp = wp->who_next;
630 struct who *wp; local
635 for (wp = whohead.who_next; wp->who_next != NULL; wp = wp->who_next) {
636 if (strcmp(tty, wp->who_tty) == 0)
637 host = wp->who_host;
638 wp->who_name[0] = '\0';