/******************************************************************** pointers - generate pointers file for cookie prog. input : s:cookie.dat - cookie file output : s:cookie.ptr - pointers file © S.E.Mitchell 5/6/90 *********************************************************************/ #include #include #include #include #include #include #include #include #define BUF_SIZE 256 /* size of read buffer */ #define SEPERATOR 0x0c /* char that seperates fortunes */ void _main() { int c=1,i,t,count,len,*p,*base; BPTR in,out; char buffer[BUF_SIZE]; if((in=Open("s:cookie.dat",MODE_OLDFILE))==NULL) { Write(Output(),"Cannot open in file\n",20); Exit(1); } if((out=Open("s:cookie.ptr",MODE_NEWFILE))==NULL) { Write(Output(),"Cannot open out file\n",21); Close(in); Exit(1); } /* find number of fortunes */ while((count=Read(in,buffer,BUF_SIZE))>0) { for(i=0;i0) { for(t=0;t