summaryrefslogtreecommitdiff
path: root/libc/bios/io.h
blob: a098e0331b1fd0222c5576183fc7dd829baa13ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __io_h__
#define __io_h__

typedef struct {
    /*
     * both block_read/block_write should be defined as
     * int x(ioblock* iob, char* buffer, int blockno)
     * and it reads/writes 1k blocks
     *
     * close should be defined as int x(ioblock* ioblock);
     */
    int (*block_read)();        /* read routine */
    int (*block_write)();       /* write routine - not supported yet*/
    int (*close)();             /* close routine */
    long offset;                /* current offset in file to read/write */
    int flags;
    long amount_left;           /* amount left in buffer */
    char buffer[1024];
    void* context;
} ioblock;

#endif