home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / pcmail2 / part01 / main / ascf.h next >
C/C++ Source or Header  |  1990-01-24  |  1KB  |  44 lines

  1. /*++
  2. /* NAME
  3. /*    ascf 5
  4. /* SUMMARY
  5. /*    stdio-like ascii filter
  6. /* PROJECT
  7. /*    pc-mail
  8. /* PACKAGE
  9. /*    ascii filtering
  10. /* SYNOPSIS
  11. /*    #include <stdio.h>
  12. /*    #include "ascf.h"
  13. /* DESCRIPTION
  14. /* .nf
  15.  
  16.  /* An _iobuf-like structure for buffer management */
  17.  
  18. typedef struct {
  19.     char   *buf;            /* intermediate buffer */
  20.     char   *ptr;            /* read pointer */
  21.     int     cnt;            /* buffer size */
  22.     char    nlf;            /* last newline kludge */
  23. } Asc;
  24.  
  25. #define    ascget(p) (--asc[fileno(p)].cnt>=0?*asc[fileno(p)].ptr++&0377:ascbuf(p))
  26. #define    ascpbk(c,p) (asc[fileno(p)].cnt++, (*--asc[fileno(p)].ptr = c))
  27.  
  28. extern FILE *ascopen();            /* open filtered stream */
  29. extern Asc asc[];            /* buffers, status etc. */
  30. extern char *ascgets();            /* read string, strip crlf */
  31.  
  32. /* AUTHOR(S)
  33. /*    W.Z. Venema
  34. /*    Eindhoven University of Technology
  35. /*    Department of Mathematics and Computer Science
  36. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  37. /* CREATION DATE
  38. /*    Mon Jul  6 16:03:41 GMT+1:00 1987
  39. /* LAST MODIFICATION
  40. /*    90/01/22 13:01:15
  41. /* VERSION/RELEASE
  42. /*    2.1
  43. /*--*/
  44.