summaryrefslogtreecommitdiff
path: root/src/user/knob/file.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-11 22:00:22 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-11 22:00:22 -0500
commit5fcf57739e68a8b5053e03778aaee0eed445babd (patch)
treee7a8bab18668d112e58b1b48190195035c71fa8a /src/user/knob/file.c
parent0f2398d1f622cce37925f52d978d92e6cce1c7a9 (diff)
downloadportland-os-5fcf57739e68a8b5053e03778aaee0eed445babd.tar.gz
settings editor, and lots of changes in service of that
Diffstat (limited to 'src/user/knob/file.c')
-rw-r--r--src/user/knob/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/user/knob/file.c b/src/user/knob/file.c
index db38e52..999778e 100644
--- a/src/user/knob/file.c
+++ b/src/user/knob/file.c
@@ -73,7 +73,7 @@ uint32_t read_from_file(struct file *f, uint32_t max, void *buf) {
return read;
}
-uint32_t write_to_file(struct file *f, uint32_t max, void *buf) {
+uint32_t write_to_file(struct file *f, uint32_t max, const void *buf) {
if (f->position + max > f->length)
_set_file_size(f->handle, f->length = f->position + max);
@@ -110,6 +110,11 @@ int32_t seek_file_by(struct file *f, int32_t by) {
}
__attribute__ ((pure))
+uint32_t get_file_pos(struct file *f) {
+ return f->position;
+}
+
+__attribute__ ((pure))
uint32_t file_size(struct file *f) {
return f->length;
}