21 lines
476 B
C
21 lines
476 B
C
#ifndef TAPE_H_
|
|
#define TAPE_H_
|
|
|
|
#include <stdio.h>
|
|
#include "record.h"
|
|
#include "io.h"
|
|
|
|
typedef struct {
|
|
file_t *file;
|
|
offset_t end;
|
|
} tape_t;
|
|
|
|
tape_t* tape_open(const char* filename, const char* mode);
|
|
void tape_close(tape_t* tape);
|
|
|
|
void* tape_read(tape_t* tape, offset_t offset, void* record, size_t size);
|
|
offset_t tape_write(tape_t* tape, offset_t offet, void* record, size_t size);
|
|
offset_t tape_append(tape_t* tape, void* record, size_t size);
|
|
|
|
#endif
|