[BACK]Return to file2.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / plugin

Diff for /OpenXM/src/kan96xx/plugin/file2.c between version 1.1.1.1 and 1.2

version 1.1.1.1, 1999/10/08 02:12:05 version 1.2, 1999/11/18 00:54:17
Line 1 
Line 1 
   /*$OpenXM$ */
 #include <stdio.h>  #include <stdio.h>
 #include <sys/time.h>  #include <sys/time.h>
 #include <sys/types.h>  #include <sys/types.h>
Line 9 
Line 10 
 #else  #else
 void *GC_malloc(int size);  void *GC_malloc(int size);
 #endif  #endif
   int WatchStream = 0;
 /*  Note:  1997, 12/6   cf. SS475/kxx/openxxx.tex, SS475/memo1.txt  /*  Note:  1997, 12/6   cf. SS475/kxx/openxxx.tex, SS475/memo1.txt
     The functions in file2.c should not accept interruptions      The functions in file2.c should not accept interruptions
     during its critical operations.  The synchronization mechanism      during its critical operations.  The synchronization mechanism
Line 91  int fp2fclose(FILE2 *fp2) {
Line 92  int fp2fclose(FILE2 *fp2) {
 }  }
   
 int fp2fputc(int c,FILE2 *fp2) {  int fp2fputc(int c,FILE2 *fp2) {
     FILE *fp;
   if (debug1) {    if (debug1) {
     printf("fp2fputc is called with %2x, fp2->writepos=%d, ",c,fp2->writepos);      printf("fp2fputc is called with %2x, fp2->writepos=%d, ",c,fp2->writepos);
     printf("fp2 = %x.\n",(int) fp2);      printf("fp2 = %x.\n",(int) fp2);
   }    }
   if (fp2->watch) {    if (fp2->watch || WatchStream) {
           if (fp2->watch) fp = fp2->watchFile;
           else fp = stderr;
     if (c >= ' ' && c <='z') {      if (c >= ' ' && c <='z') {
       fprintf(fp2->watchFile," %2x(%c)-> ",c,c);        fprintf(fp," %2x(%c)-> ",c,c);
     }else{      }else{
       fprintf(fp2->watchFile," %2x( )-> ",c);        fprintf(fp," %2x( )-> ",c);
     }      }
     fflush(NULL);      fflush(NULL);
   }    }
Line 116  int fp2fputc(int c,FILE2 *fp2) {
Line 120  int fp2fputc(int c,FILE2 *fp2) {
   
 int fp2fgetc(FILE2 *fp2) {  int fp2fgetc(FILE2 *fp2) {
   int c;    int c;
     FILE *fp;
   /* printf("fp2fgetc is called. "); fflush(NULL); */    /* printf("fp2fgetc is called. "); fflush(NULL); */
   if (checkfp2(fp2," fp2fgetc ") == -1) return(-1);    if (checkfp2(fp2," fp2fgetc ") == -1) return(-1);
   if (fp2->readpos < fp2->readsize) {    if (fp2->readpos < fp2->readsize) {
     fp2->readpos++;      fp2->readpos++;
     c = fp2->readBuf[fp2->readpos -1];      c = fp2->readBuf[fp2->readpos -1];
     if (fp2->watch) {      if (fp2->watch || WatchStream) {
             if (fp2->watch) fp = fp2->watchFile;
             else fp = stderr;
       if (c >= ' ' && c <= 'z') {        if (c >= ' ' && c <= 'z') {
         fprintf(fp2->watchFile," %2x(%c) ",c,c);                  fprintf(fp," %2x(%c) ",c,c);
       }else{        }else{
         fprintf(fp2->watchFile," %2x( ) ",c);                  fprintf(fp," %2x( ) ",c);
       }        }
       fflush(NULL);        fflush(NULL);
     }      }
Line 135  int fp2fgetc(FILE2 *fp2) {
Line 142  int fp2fgetc(FILE2 *fp2) {
     fp2 ->readsize =      fp2 ->readsize =
       read(fp2->fd, fp2->readBuf, fp2->limit);        read(fp2->fd, fp2->readBuf, fp2->limit);
     if (fp2->readsize == 0) {      if (fp2->readsize == 0) {
       if (fp2->watch) {        if (fp2->watch || WatchStream) {
         fprintf(fp2->watchFile," <%2x ",c);                  if (fp2->watch) fp = fp2->watchFile;
         fflush(NULL);                  else fp = stderr;
                   fprintf(fp," <%2x ",c);
                   fflush(NULL);
       }        }
       return(-1);        return(-1);
     }      }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>