home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DOOG / CBASE09.ZIP / BLKIO10.ZIP / BLKIO_.H < prev    next >
Text File  |  1989-08-30  |  2KB  |  57 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "blkio_.h    1.1 - 89/07/03" */
  5.  
  6. #ifndef BLKIO_H_    /* prevent multiple includes */
  7. #define BLKIO_H_
  8.  
  9. #define DEBUG        /* switch to enable debugging for blkio package */
  10.  
  11. /* The HOST macro specifies the host operating system.  Currently supported   */
  12. /* systems are:                                                               */
  13. #define UNIX    (1)    /* UNIX */
  14. #define MSDOS    (2)    /* MS-DOS */
  15. #define HOST    MSDOS
  16.  
  17. /* The MSDOSC macro specifies the MS-DOS C compiler being used.  Currently    */
  18. /* supported compilers are:                                                   */
  19. #define TURBOC    (1)    /* Borland Turbo C */
  20. #define MSC    (2)    /* Microsoft C */
  21. #define MSDOSC    TURBOC
  22.  
  23. #include <bool.h>
  24. #include "blkio.h"
  25.  
  26. int    b_alloc(/* BLKFILE *bp */);
  27. #define    b_blkbuf(BP, N)    ((void *)((char *)(BP)->blkbuf +        \
  28.         (((N) == 0) ? 0 : ((BP)->hdrsize + ((N) - 1) * (BP)->blksize))))
  29. #define    b_block_p(BP, N)    ((block_t *)((char *)(BP)->block_p    \
  30.                     + (N) * sizeof(block_t)))
  31. void    b_free(/* BLKFILE *bp */);
  32. int    b_get(/* BLKFILE *bp, size_t i */);
  33. int    b_init(/* BLKFILE *bp */);
  34. int    b_mkmru(/* BLKFILE *bp, size_t i */);
  35. int    b_put(/* BLKFILE *bp, size_t i */);
  36. bool    b_valid(/* BLKFILE *bp */);
  37.  
  38. int    b_uclose(/* BLKFILE *bp */);
  39. int    b_uendblk(/* BLKFILE *bp, bpos_t *endblk_p */);
  40. int    b_ugetf(/* BLKFILE *bp, bpos_t bn, size_t offset, void *buf, size_t bufsize */);
  41. int    b_uopen(/* BLKFILE *bp, char *filename, char *type */);
  42. int    b_uputf(/* BLKFILE *bp, bpos_t bn, size_t offset, void *buf, size_t bufsize */);
  43.  
  44. /* block file open types */
  45. #define BF_READ        ("r")
  46. #define BF_RDWR        ("r+")
  47. #define BF_CRTR        ("w+")
  48. #define BF_CREATE    ("c")
  49.  
  50. #ifdef DEBUG
  51. #define    BEPRINT    {fprintf(stderr, "blkio error line %d of %s.  errno = %d.\n", __LINE__, __FILE__, errno);}
  52. #else
  53. #define BEPRINT
  54. #endif
  55.  
  56. #endif    /* #ifndef BLKIO_H_ */
  57.