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

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "bgeth.c    1.1 - 89/07/03" */
  5.  
  6. #include <errno.h>
  7. #include "blkio_.h"
  8.  
  9. /*man---------------------------------------------------------------------------
  10. NAME
  11.      bgeth - get the header from a block file
  12.  
  13. SYNOPSIS
  14.      #include <blkio.h>
  15.  
  16.      int bgeth(bp, buf)
  17.      BLKFILE *bp;
  18.      void *buf;
  19.  
  20. DESCRIPTION
  21.      The bgeth function reads the header from the block file associated with
  22.      BLKFILE pointer bp.  buf must point to a storage area at least as large
  23.      as the header size for bp.
  24.  
  25.      bgeth will fail if one or more of the following is true:
  26.  
  27.      [EINVAL]       bp is not a valid block file.
  28.      [EINVAL]       buf is NULL.
  29.      [BEBOUND]      End of file not on block boundary.
  30.      [BEEOF]        bp is empty.
  31.      [BENOPEN]      bp is not open for reading.
  32.  
  33. SEE ALSO
  34.      bgetb, bgethf, bputh.
  35.  
  36. DIAGNOSTICS
  37.      Upon successful completion, a value of 0 is returned.  Otherwise, a
  38.      value of -1 is returned, and errno set to indicate the error.
  39.  
  40. ------------------------------------------------------------------------------*/
  41. int bgeth(bp, buf)
  42. BLKFILE * bp;
  43. void *    buf;
  44. {
  45.     return bgethf(bp, (size_t)0, buf, bp->hdrsize);
  46. }
  47.