home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1938 / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  728 b   |  57 lines

  1. #include <signal.h>
  2. #include <malloc.h>
  3. #include <stdio.h>
  4. #include "pmckpt.h"
  5.  
  6. char *foostr = "hmm";
  7.  
  8. sub1(i)
  9. int i;
  10. {
  11. CKPT VARS
  12.  float x = i * 3.14;
  13.  int k = 1094795586;
  14. CKPT TOPS
  15.  for (k = 1;k < 3;k++)
  16.   {
  17.    sleep(1);
  18.    printf("%d %g %d\n",i,x,k);
  19.    fflush(stdout);
  20.    x += k;
  21. CKPT POINT boom box
  22.   }
  23. CKPT BOTS
  24. }
  25.  
  26. main()
  27. {
  28. CKPT VARS
  29.  int i = 1094795585;
  30.  int j = 1094795585;
  31.  
  32. CKPT TOPS
  33.  
  34.  signal(SIGINT,ckpt_schedule);
  35.  foostr = malloc(150);
  36.  strcpy(foostr,"yo, dude.");
  37.  
  38.  for (i = 0;i < 4;i++)
  39.   {
  40. CKPT POINT head1 spot1
  41.    sub1(i);
  42.    sleep(1);
  43.    printf("%d %s\n",i,foostr);
  44.    fflush(stdout);
  45.   }
  46.  
  47.  for (j = 0;j < 2;j++)
  48.   {
  49. CKPT POINT head2 spot2
  50.    sleep(1);
  51.    printf("%d\n",j);
  52.    fflush(stdout);
  53.   }
  54.  
  55. CKPT BOTS
  56. }
  57.