X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fidzebra%2Fbfile.h;fp=include%2Fidzebra%2Fbfile.h;h=de1acc692ba9782206f5f77d728729ea48645569;hb=91c31916bd40829afa20cd4e104ffc764ea116bf;hp=3161f044b9c8867ff87d842e9df94224d2fb7d6b;hpb=a9b4e41c61e30e376528b83aa87955fe9594423a;p=idzebra-moved-to-github.git diff --git a/include/idzebra/bfile.h b/include/idzebra/bfile.h index 3161f04..de1acc6 100644 --- a/include/idzebra/bfile.h +++ b/include/idzebra/bfile.h @@ -1,4 +1,4 @@ -/* $Id: bfile.h,v 1.10 2006-08-14 10:40:14 adam Exp $ +/* $Id: bfile.h,v 1.11 2006-11-08 22:08:26 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -101,6 +101,18 @@ BFile bf_xopen(BFiles bfs, const char *name, int block_size, int wflag, const char *magic, int *read_version, const char **more_info); +/** \brief read from block file (may call exit) + \param bf block file handle + \param no block no (first block is 0, second is 1..) + \param offset offset within block to be read + \param nbytes number of bytes to read (0 for whole block) + \param buf raw bytes with content (at least nbytes of size) + \retval 1 whole block could be read + \retval 0 whole block could not be read + */ +YAZ_EXPORT +int bf_read(BFile bf, zint no, int offset, int nbytes, void *buf); + /** \brief read from block file \param bf block file handle \param no block no (first block is 0, second is 1..) @@ -109,9 +121,26 @@ BFile bf_xopen(BFiles bfs, const char *name, int block_size, int wflag, \param buf raw bytes with content (at least nbytes of size) \retval 1 whole block could be read \retval 0 whole block could not be read + \retval -1 error + */ +YAZ_EXPORT +int bf_read2(BFile bf, zint no, int offset, int nbytes, void *buf); + + +/** \brief writes block of bytes to file (may call exit) + \param bf block file handle + \param no block no + \param offset within block + \param nbytes number of bytes to write + \param buf buffer to write + \retval 0 success (block could be written) + + This function can not return a failure. System calls exit(1) + if write failed. */ YAZ_EXPORT -int bf_read (BFile bf, zint no, int offset, int nbytes, void *buf); +int bf_write(BFile bf, zint no, int offset, int nbytes, const void *buf); + /** \brief writes block of bytes to file \param bf block file handle @@ -119,13 +148,15 @@ int bf_read (BFile bf, zint no, int offset, int nbytes, void *buf); \param offset within block \param nbytes number of bytes to write \param buf buffer to write - \retval 0 succes (block could be written) + \retval 0 success (block written) + \retval -1 error This function can not return a failure. System calls exit(1) if write failed. */ YAZ_EXPORT -int bf_write (BFile bf, zint no, int offset, int nbytes, const void *buf); +int bf_write2(BFile bf, zint no, int offset, int nbytes, const void *buf); + /** \brief enables or disables shadow for block files \param bfs block files