Compiles cleanly (still only dummy.
[idzebra-moved-to-github.git] / bfile / bfile.c
1 /*
2  * Copyright (C) 1994, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: bfile.c,v $
7  * Revision 1.2  1994-08-17 14:09:32  quinn
8  * Compiles cleanly (still only dummy.
9  *
10  * Revision 1.1  1994/08/17  13:55:08  quinn
11  * New blocksystem. dummy only
12  *
13  */
14
15 #include <util.h>
16 #include <bfile.h>
17 #include <sys/types.h>
18 #include <fcntl.h>
19 #include <unistd.h>
20
21 int bf_close (BFile bf)
22 {
23     close(bf->fd);
24     xfree(bf);
25     return(0);
26 }
27
28 BFile bf_open (const char *name, int block_size, int wflag)
29 {
30     BFile tmp = xmalloc(sizeof(BFile_struct));
31
32     if ((tmp->fd = open(name, wflag ? O_RDWR : O_RDONLY, 0666)) < 0)
33     {
34         log(LOG_FATAL, "open: %s"); 
35         return(0);
36     }
37     return(tmp);
38 }
39
40 int bf_read (BFile bf, int no, int offset, int num, void *buf)
41 {
42 }
43
44 int bf_write (BFile bf, int no, int offset, int num, const void *buf)
45 {
46 }