-/* $Id: bfile.h,v 1.2 2004-12-13 20:51:30 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
- Index Data Aps
+/* $Id: bfile.h,v 1.5 2005-05-17 08:50:48 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
#define BFILE_H
#include <yaz/yconfig.h>
-#include <idzebra/version.h>
+#include <idzebra/util.h>
YAZ_BEGIN_CDECL
YAZ_EXPORT
int bf_close (BFile);
+YAZ_EXPORT
+int bf_xclose (BFile bf, int version, const char *more_info);
+
/* bf_open: opens bfile.
opens bfile with name 'name' and with 'block_size' as block size.
returns bfile handle is successful; NULL otherwise
YAZ_EXPORT
BFile bf_open (BFiles bfs, const char *name, int block_size, int wflag);
+YAZ_EXPORT
+BFile bf_xopen(BFiles bfs, const char *name, int block_size, int wrflag,
+ const char *magic, int *read_version,
+ const char **more_info);
+
/* bf_read: reads bytes from bfile 'bf'.
reads 'nbytes' bytes (or whole block if 0) from offset 'offset' from
block 'no'. stores contents in buffer 'buf'.
/* bf_cache: enables bfile cache if spec is not NULL */
YAZ_EXPORT
-void bf_cache (BFiles bfs, const char *spec);
+ZEBRA_RES bf_cache (BFiles bfs, const char *spec);
/* bf_commitExists: returns 1 if commit is pending; 0 otherwise */
YAZ_EXPORT
YAZ_EXPORT
void bf_reset (BFiles bfs);
+/* bf_alloc: allocate one or more blocks */
+YAZ_EXPORT
+int bf_alloc(BFile bf, int no, zint *blocks);
+
+/* bf_alloc: allocate one or more blocks */
+YAZ_EXPORT
+int bf_free(BFile bf, int no, const zint *blocks);
+
YAZ_END_CDECL
#endif