# 2.11BSD#431 - /usr/src/ucb/talk/msgs.c

##### Functions

    disp_msg          X
    end_msgs          X
    start_msgs        X

##### Variables

    current_line      X
    current_state     X

##### Macros

    LONG_TIME         X
    MSG_INTERVAL      X

       1: /*
       2:  * Copyright (c) 1983 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifndef lint
       8: static char sccsid[] = "@(#)msgs.c	5.1 (Berkeley) 6/6/85";
       9: #endif not lint
      10:
      11: /*
      12:  * A package to display what is happening every MSG_INTERVAL seconds
      13:  * if we are slow connecting.
      14:  */
      15:
      16: #include <signal.h>
      17: #include <stdio.h>
      18: #include <sys/time.h>
      19: #include "talk.h"
      20:
      21: #define MSG_INTERVAL 4
      22: #define LONG_TIME 100000
      23:
      24: char    *current_state;
      25: int current_line = 0;
      26:
      27: static  struct itimerval itimer;
      28: static  struct timeval wait = { MSG_INTERVAL , 0};
      29: static  struct timeval undo = { LONG_TIME, 0};
      30:
      31: disp_msg()
      32: {
      33:
      34:     message(current_state);
      35: }
      36:
      37: start_msgs()
      38: {
      39:
      40:     message(current_state);
      41:     signal(SIGALRM, disp_msg);
      42:     itimer.it_value = wait;
      43:     itimer.it_interval = wait;
      44:     setitimer(ITIMER_REAL, &itimer, (struct timerval *)0);
      45: }
      46:
      47: end_msgs()
      48: {
      49:
      50:     signal(SIGALRM, SIG_IGN);
      51:     timerclear(&itimer.it_value);
      52:     timerclear(&itimer.it_interval);
      53:     setitimer(ITIMER_REAL, &itimer, (struct timerval *)0);
      54: }

#### Defined functions

disp_msg defined in line 31; used 1 times

- in line 41

end_msgs defined in line 47; used 2 times

- in /usr/src/ucb/talk/invite.c line 52
- in /usr/src/ucb/talk/talk.c line 45

start_msgs defined in line 37; used 2 times

- in /usr/src/ucb/talk/invite.c line 70
- in /usr/src/ucb/talk/talk.c line 42

#### Defined variables

current_line defined in line 25; never used
current_state defined in line 24; used 2 times

- in line 34, 40

itimer defined in line 27; used 6 times

- in line 42-44(3), 51-53(3)

sccsid defined in line 8; never used
undo defined in line 29; never used
wait defined in line 28; used 2 times

- in line 42-43(2)

#### Defined macros

LONG_TIME defined in line 22; used 1 times

- in line 29

MSG_INTERVAL defined in line 21; used 1 times

- in line 28

Last modified: 1988-08-03 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1393 |