home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / ZOO21E.EXE / ZOOIO.H < prev    next >
C/C++ Source or Header  |  1991-07-11  |  2KB  |  67 lines

  1. /* @(#) zooio.h 2.7 88/01/27 19:39:24 */
  2.  
  3. /*
  4. Declarations for portable I/O
  5.  
  6. The contents of this file are hereby placed in the public domain.
  7.  
  8.                                             -- Rahul Dhesi 1988/01/24
  9. */
  10. #ifndef    OK_STDIO
  11. #include <stdio.h>
  12. #define    OK_STDIO
  13. #endif
  14.  
  15. #ifndef PARMS
  16. #ifdef LINT_ARGS
  17. #define    PARMS(x)        x
  18. #else
  19. #define    PARMS(x)        ()
  20. #endif
  21. #endif
  22.  
  23. /*
  24. In theory, all I/O using buffered files could be replaced with unbuffered
  25. I/O simply by changing the following definitions.  This has not been tried
  26. out yet, and there may be some remaining holes in the scheme.  On systems
  27. with limited memory, it might prove necessary to use unbuffered I/O
  28. only.
  29. */
  30. typedef FILE *ZOOFILE;
  31. #define NOFILE        ((ZOOFILE) 0)
  32. #define NULLFILE    ((ZOOFILE) -1)        /* or any unique value */
  33. #define STDOUT        stdout
  34.  
  35. #ifdef FILTER
  36. #define STDIN        stdin
  37. #endif
  38.  
  39. #ifdef IO_MACROS
  40. #define zooread(file, buffer, count)        fread (buffer, 1, count, file)
  41. #define zoowrite(file, buffer, count) \
  42.     (file == NULLFILE ? count : fwrite (buffer, 1, count, file))
  43. #define zooseek(file, offset, whence)        fseek (file, offset, whence)
  44. #define zootell(file)                            ftell (file)
  45. #else
  46. int zooread PARMS((ZOOFILE, char *, int));
  47. int zoowrite PARMS((ZOOFILE, char *, int));
  48. long zooseek PARMS((ZOOFILE, long, int));
  49. long zootell PARMS((ZOOFILE));
  50. #endif /* IO_MACROS */
  51.  
  52. ZOOFILE zooopen PARMS((char *, char *));
  53. ZOOFILE zoocreate PARMS((char *));
  54. int zooclose PARMS((ZOOFILE));
  55. int zootrunc PARMS((ZOOFILE));
  56.  
  57. char *choosefname PARMS((struct direntry *));
  58. char *fullpath PARMS((struct direntry *));
  59. int frd_zooh PARMS((struct zoo_header *, ZOOFILE));
  60. int frd_dir PARMS((struct direntry *, ZOOFILE));
  61. int fwr_dir PARMS((struct direntry *, ZOOFILE));
  62. int fwr_zooh PARMS((struct zoo_header *, ZOOFILE));
  63. int readdir PARMS((struct direntry *, ZOOFILE, int));
  64. void rwheader PARMS((struct zoo_header *, ZOOFILE, int));
  65. void newdir PARMS((struct direntry *));
  66. void writedir PARMS((struct direntry *, ZOOFILE));
  67.