/[pkg-mixmaster]/branches/mixmaster_2_9_STABLE/Mix/Src/buffers.c
ViewVC logotype

Diff of /branches/mixmaster_2_9_STABLE/Mix/Src/buffers.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 326 by rabbi, Fri Oct 4 23:49:17 2002 UTC revision 327 by weaselp, Wed Oct 9 20:29:44 2002 UTC
# Line 6  Line 6 
6     details.     details.
7    
8     Dynamically allocated buffers     Dynamically allocated buffers
9     $Id: buffers.c,v 1.3.2.1 2002/10/04 23:49:16 rabbi Exp $ */     $Id: buffers.c,v 1.3.2.2 2002/10/09 20:29:43 weaselp Exp $ */
10    
11    
12  #include "mix3.h"  #include "mix3.h"
# Line 17  Line 17 
17  #include <stdarg.h>  #include <stdarg.h>
18  #ifdef WIN32  #ifdef WIN32
19  #include <io.h>  #include <io.h>
20  #endif  #endif /* WIN32 */
21  #include <assert.h>  #include <assert.h>
22  #ifdef POSIX  #ifdef POSIX
23  #include <unistd.h>  #include <unistd.h>
24  #endif  #endif /* POSIX */
25    
26  static void fail(void)  static void fail(void)
27  {  {
# Line 65  static void sanity_check(BUFFER *b) Line 65  static void sanity_check(BUFFER *b)
65    assert(b->length >= 0 && b->length < b->size);    assert(b->length >= 0 && b->length < b->size);
66    assert(b->ptr >= 0 && b->ptr <= b->length);    assert(b->ptr >= 0 && b->ptr <= b->length);
67  }  }
68  #else  #else /* not DEBUG */
69  #define sanity_check(arg)  #define sanity_check(arg)
70  #endif  #endif /* else not DEBUG */
71    
72  int buf_reset(BUFFER *buffer)  int buf_reset(BUFFER *buffer)
73  {  {
# Line 326  int buf_read(BUFFER *outmsg, FILE *infil Line 326  int buf_read(BUFFER *outmsg, FILE *infil
326        errlog(ERRORMSG, "Message file too large. Giving up.\n");        errlog(ERRORMSG, "Message file too large. Giving up.\n");
327        return (1);        return (1);
328      }      }
329  #endif  #endif /* BUFFER_MAX */
330    }    }
331    
332  #ifdef WIN32  #ifdef WIN32
333    if (isatty(fileno(infile)) && isatty(fileno(stdout)))    if (isatty(fileno(infile)) && isatty(fileno(stdout)))
334      printf("\n");      printf("\n");
335  #endif  #endif /* WIN32 */
336    
337    return (err);    return (err);
338  }  }
# Line 362  int buf_write_sync(BUFFER *buffer, FILE Line 362  int buf_write_sync(BUFFER *buffer, FILE
362      /* dir entry not synced */      /* dir entry not synced */
363      if (fsync(fileno(out)) != 0)      if (fsync(fileno(out)) != 0)
364        ret = -1;        ret = -1;
365  #endif  #endif /* POSIX */
366    
367      if (fclose(out) != 0)      if (fclose(out) != 0)
368        ret = -1;        ret = -1;
# Line 544  int buf_getheader(BUFFER *buffer, BUFFER Line 544  int buf_getheader(BUFFER *buffer, BUFFER
544  #if 1  #if 1
545      buf_nl(content);      buf_nl(content);
546      buf_cat(content, line);      buf_cat(content, line);
547  #else  #else /* end of 1 */
548      buf_appendc(content, ' ');      buf_appendc(content, ' ');
549      buf_appends(content, line->data + 1);      buf_appends(content, line->data + 1);
550  #endif  #endif /* else if not 1 */
551    }    }
552    buffer->ptr = p;    buffer->ptr = p;
553  end:  end:

Legend:
Removed from v.326  
changed lines
  Added in v.327

  ViewVC Help
Powered by ViewVC 1.1.5