[BACK]Return to tftpsubs.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tftp

Diff for /src/usr.bin/tftp/tftpsubs.c between version 1.6 and 1.7

version 1.6, 2003/06/03 02:56:18 version 1.7, 2003/06/25 15:45:10
Line 80 
Line 80 
   
 static struct tftphdr *rw_init();  static struct tftphdr *rw_init();
   
 struct tftphdr *w_init() { return rw_init(0); }         /* write-behind */  struct tftphdr *
 struct tftphdr *r_init() { return rw_init(1); }         /* read-ahead */  w_init(void)
   {
           return rw_init(0);      /* write-behind */
   }
   
   struct tftphdr *
   r_init(void)
   {
           return rw_init(1);      /* read-ahead */
   }
   
   /* init for either read-ahead or write-behind */
   /* zero for write-behind, one for read-head */
 static struct tftphdr *  static struct tftphdr *
 rw_init(x)                      /* init for either read-ahead or write-behind */  rw_init(int x)
         int x;                  /* zero for write-behind, one for read-head */  
 {  {
         newline = 0;            /* init crlf flag */          newline = 0;            /* init crlf flag */
         prevchar = -1;          prevchar = -1;
Line 101 
Line 111 
    Free it and return next buffer filled with data.     Free it and return next buffer filled with data.
  */   */
 int  int
 readit(file, dpp, convert)  readit(FILE *file, struct tftphdr **dpp, int convert)
         FILE *file;                     /* file opened for read */  
         struct tftphdr **dpp;  
         int convert;                    /* if true, convert to ascii */  
 {  {
         struct bf *b;          struct bf *b;
   
Line 124 
Line 131 
  * conversions are  lf -> cr,lf  and cr -> cr, nul   * conversions are  lf -> cr,lf  and cr -> cr, nul
  */   */
 void  void
 read_ahead(file, convert)  read_ahead(FILE *file, int convert)
         FILE *file;                     /* file opened for read */  
         int convert;                    /* if true, convert to ascii */  
 {  {
         int i;          int i;
         char *p;          char *p;
Line 173 
Line 178 
    available.     available.
  */   */
 int  int
 writeit(file, dpp, ct, convert)  writeit(FILE *file, struct tftphdr **dpp, int ct, int convert)
         FILE *file;  
         struct tftphdr **dpp;  
         int ct, convert;  
 {  {
         bfs[current].counter = ct;      /* set size of data to write */          bfs[current].counter = ct;      /* set size of data to write */
         current = !current;             /* switch to other buffer */          current = !current;             /* switch to other buffer */
Line 194 
Line 196 
  * CR followed by anything else.  In this case we leave it alone.   * CR followed by anything else.  In this case we leave it alone.
  */   */
 int  int
 write_behind(file, convert)  write_behind(FILE *file, int convert)
         FILE *file;  
         int convert;  
 {  {
         char *buf;          char *buf;
         int count;          int count;
Line 253 
Line 253 
  */   */
   
 int  int
 synchnet(f)  synchnet(int f)
         int     f;              /* socket to flush */  
 {  {
         int i, j = 0;          int i, j = 0;
         char rbuf[PKTSIZE];          char rbuf[PKTSIZE];

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7