summaryrefslogtreecommitdiff
path: root/src/user/include/knob/file.h
blob: 60680775de5646a026bd0ae70ad957aa1d1a6efa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef KNOB_FILE_H
#define KNOB_FILE_H

#include <stdint.h>

struct file;

struct file *open_file(const char *path);
void close_file(struct file *f);

uint32_t read_from_file(struct file *f, uint32_t max, void *buf);
uint32_t seek_file_to(struct file *f, uint32_t to);
int32_t seek_file_by(struct file *f, int32_t by);

uint32_t file_size(struct file *f) __attribute__ ((pure));

#endif