1: #include "remind.h"
   2: 
   3: main()
   4: {
   5:     register struct rmdblock *rp = &m;
   6:     register FILE *fp;
   7:     register i;
   8:     char buf[BUFSIZ];
   9:     char d[1000];
  10:     char *cp;
  11: 
  12:     setbuf(stdout,buf);
  13:     if((fp=fopen(reminders,"r"))==NULL)
  14:     {
  15:     fprintf(stderr,"cannot open %s\n",reminders);
  16:     exit(1);
  17:     }
  18:     while((fread(rp,sizeof m, 1,fp))==1)
  19:     {
  20:     printf("::::::::::::::::::::::\n");
  21:     printf("deliver time: %s",ctime(&rp->tdeliver));
  22:     printf("nobytes: %d\n",rp->nobytes);
  23:     printf("sent: %s",ctime(&rp->tsent));
  24:     printf("sender%8s\n",rp->sender);
  25:     printf("bits: %d\n",rp->bits&0377);
  26:     printf("dirsize: %d\n",rp->dirsize&0377);
  27:     printf("nrcvrs: %d\n",rp->nrcvrs&0377);
  28:     printf("msgbytes: %d\n",rp->msgbytes);
  29:     if((fread(d,rp->nobytes,1,fp))!=1)
  30:     {
  31:         fprintf(stderr,"fread error\n");
  32:         exit(1);
  33:     }
  34:     printf("receivers: ");
  35:     for(i=0,cp=d;i<8*rp->nrcvrs;i++)
  36:     {
  37:         putchar(*cp++);
  38:         if((i+1)%8 == 0)
  39:         putchar(' ');
  40:     }
  41:     printf("\n");
  42:     if(rp->dirsize)
  43:     {
  44:         printf("directory: ");
  45:         for(i=0;i<rp->dirsize;i++)
  46:         putchar(*cp++);
  47:         printf("\n");
  48:     }
  49:     printf("message:\n");
  50:     for(i=0;i<rp->msgbytes;i++)
  51:         putchar(*cp++);
  52:     }
  53: }

Defined functions

main defined in line 3; never used
Last modified: 1981-09-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 709
Valid CSS Valid XHTML 1.0 Strict