view lib-src/=wakeup.c @ 3803:c267c2431d92

Don't let the 'B' interactive spec default to buffers viewed in any visible frame. * buffer.c (Fother_buffer): Pass Qt as the second argument to Fget_buffer_window. * window.c (window_loop): In GET_BUFFER_WINDOW case, ignore non-visible frames. (Fget_buffer_window): Change doc string to mention that passing Qt for the FRAME argument returns windows on visible frames only. (Qvisible): Removed.
author Jim Blandy <jimb@redhat.com>
date Thu, 17 Jun 1993 05:06:36 +0000
parents 0810187da5d9
children d253c8a4b7e5
line wrap: on
line source

/* Program to produce output at regular intervals.  */

#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <sys/time.h>

struct tm *localtime ();

main (argc, argv)
     int argc;
     char **argv;
{
  int period = 60;
  time_t when;
  struct tm *tp;

  if (argc > 1)
    period = atoi (argv[1]);

  while (1)
    {
      /* Make sure wakeup stops when Emacs goes away.  */
      if (getppid () == 1)
	exit (0);
      printf ("Wake up!\n");
      fflush (stdout);
      /* If using a period of 60, produce the output when the minute
	 changes. */
      if (period == 60)
	{
	  time (&when);
	  tp = localtime (&when);
	  sleep (60 - tp->tm_sec);
	}
      else
	sleep (period);
    }
}