2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.13 1996-10-29 13:43:07 adam
8 * Added a few comments.
10 * Revision 1.12 1996/03/26 16:00:44 adam
11 * The directory of the shadow table can be specified by the new
14 * Revision 1.11 1995/12/08 16:20:39 adam
15 * New commit utilities - used for 'save' update.
17 * Revision 1.10 1995/12/01 16:24:33 adam
18 * Commit files use separate meta file area.
20 * Revision 1.9 1995/12/01 11:37:46 adam
21 * Cached/commit files implemented as meta-files.
23 * Revision 1.8 1995/11/30 08:33:29 adam
24 * Started work on commit facility.
26 * Revision 1.7 1995/09/04 12:33:35 adam
27 * Various cleanup. YAZ util used instead.
29 * Revision 1.6 1994/09/14 13:10:35 quinn
32 * Revision 1.5 1994/08/24 08:45:52 quinn
35 * Revision 1.4 1994/08/17 15:38:28 adam
38 * Revision 1.3 1994/08/17 14:09:47 quinn
48 #define bf_blocksize(bf) mf_blocksize(bf->mf)
50 typedef struct BFile_struct
53 struct CFile_struct *cf;
54 } *BFile, BFile_struct;
56 /* bf_close: closes bfile.
57 returns 0 if successful; non-zero otherwise
61 /* bf_open: opens bfile.
62 opens bfile with name 'name' and with 'block_size' as block size.
63 returns bfile handle is successful; NULL otherwise
65 BFile bf_open (const char *name, int block_size, int wflag);
67 /* bf_read: reads bytes from bfile 'bf'.
68 reads 'num' bytes (or whole block if 0) from offset 'offset' from
69 block 'no'. stores contents in buffer 'buf'.
70 returns 1 if whole block could be read; 0 otherwise.
72 int bf_read (BFile bf, int no, int offset, int num, void *buf);
74 /* bf_write: writes bytes to bfile 'bf'.
75 writes 'num' bytes (or whole block if 0) at offset 'offset' to
76 block 'no'. retrieves contents from buffer 'buf'.
77 returns 0 if successful; non-zero otherwise.
79 int bf_write (BFile bf, int no, int offset, int num, const void *buf);
81 /* bf_cache: enables/disables bfile cache */
82 void bf_cache (int enableFlag);
84 /* bf_lockDir: specifies locking directory for the cache system */
85 void bf_lockDir (const char *lockDir);
87 /* bf_commitExists: returns 1 if commit is pending; 0 otherwise */
88 int bf_commitExists (void);
90 /* bf_commitExec: executes commit */
91 void bf_commitExec (void);
93 /* bf_commitClean: cleans commit files, etc */
94 void bf_commitClean (void);