home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / FORK.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  2KB  |  53 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. ** fork.h -- get characters from a pipe and display to all files
  5. **           needed (assumes stdout), Public Domain.
  6. **
  7. ** PROGRAMMER : Dustin Puryear <dpuryear@delphi.com>
  8. ** COMPILER   : Mix PowerC v2.2.0a (MSDOS)
  9. ** HISTORY    : May 4, 1994  - Original
  10. **              May 11, 1994 - Output in binary, buffer read of stdin.
  11. **              June 8, 1994 - Cleaned up header, and removed some
  12. **                             unneeded code.
  13. */
  14.  
  15. #include <stdio.h>    /* standard include file        */
  16. #include <stdlib.h>   /* malloc(), free(), exit()     */
  17. #include <string.h>   /* strcpy()                     */
  18. #include <ctype.h>    /* tolower()                    */
  19. #include <direct.h>   /* MAXPATH definition (MSDOS)   */
  20.  
  21. #ifndef __DATE__
  22. #define __DATE__ "June 8 1994"    /* Date last updated              */
  23. #endif
  24. #ifndef MAXPATH
  25. #define MAXPATH 80                /* Make sure there is a MAXPATH   */
  26. #endif
  27. #ifndef __STDC__
  28. #ifndef EXIT_SUCCESS
  29. #define EXIT_SUCCESS 0            /* Define exit values             */
  30. #endif
  31. #ifndef EXIT_FAILURE
  32. #define EXIT_FAILURE 1
  33. #endif
  34. #endif
  35. #define VER     "1.02"            /* Version number                 */
  36. #define MAXBUFF 4096              /* Maximum buffer size            */
  37.  
  38. typedef struct filenode
  39. {
  40.       FILE            *ptr;
  41.       struct filenode *next;
  42. } FILENODE;                 /* Node in ll containing a file pointer */
  43. typedef struct
  44. {
  45.       FILENODE     *head;
  46.       FILENODE     *tail;
  47. } LL;                       /* ll of FILE pointers                  */
  48.  
  49. void llopen(LL *files, FILE *fptr);
  50. void llfree(LL *files);
  51. void output(LL *files, char *buffer, int size);
  52. void help(void);
  53.