X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fidzebra%2Fbfile.h;h=de1acc692ba9782206f5f77d728729ea48645569;hb=91c31916bd40829afa20cd4e104ffc764ea116bf;hp=9a4ff6790892df5a1de90e04eb31dead56ba67c0;hpb=ecb3935e78cd9bcfdebafdee0834cfb1060d7b5e;p=idzebra-moved-to-github.git diff --git a/include/idzebra/bfile.h b/include/idzebra/bfile.h index 9a4ff67..de1acc6 100644 --- a/include/idzebra/bfile.h +++ b/include/idzebra/bfile.h @@ -1,4 +1,4 @@ -/* $Id: bfile.h,v 1.9 2006-05-10 08:13:20 adam Exp $ +/* $Id: bfile.h,v 1.11 2006-11-08 22:08:26 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ /** \file bfile.h @@ -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_read (BFile bf, zint no, int offset, int nbytes, void *buf); +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_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