summaryrefslogtreecommitdiff
path: root/src/user/include/knob
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-19 14:53:29 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-19 14:53:29 -0400
commitde20d7430df08731d9108acb83e1234ba7f1fe16 (patch)
tree8646f3d1bae3d30391df34766e3e58c0c2af8aab /src/user/include/knob
parent20853582d5385d12421433d21910e783caa00764 (diff)
downloadportland-os-de20d7430df08731d9108acb83e1234ba7f1fe16.tar.gz
file manager
Diffstat (limited to 'src/user/include/knob')
-rw-r--r--src/user/include/knob/block.h3
-rw-r--r--src/user/include/knob/file.h5
-rw-r--r--src/user/include/knob/quit.h7
-rw-r--r--src/user/include/knob/user.h3
4 files changed, 10 insertions, 8 deletions
diff --git a/src/user/include/knob/block.h b/src/user/include/knob/block.h
index 4625577..43137e1 100644
--- a/src/user/include/knob/block.h
+++ b/src/user/include/knob/block.h
@@ -7,4 +7,7 @@
void blockcpy(void *to, const void *from, uint32_t size);
bool blockequ(const void *a, const void *b, uint32_t size) __attribute__ ((__pure__));
+//returns length without null-terminator
+uint32_t strcpy(char *to, const char *from);
+
#endif \ No newline at end of file
diff --git a/src/user/include/knob/file.h b/src/user/include/knob/file.h
index a0d084f..8862098 100644
--- a/src/user/include/knob/file.h
+++ b/src/user/include/knob/file.h
@@ -2,6 +2,7 @@
#define KNOB_FILE_H
#include <stdint.h>
+#include <pland/syscall.h>
struct file;
@@ -9,7 +10,6 @@ const char *remove_prefix(const char *path, uint8_t *dn_out);
struct file *open_file(const char *path);
void close_file(struct file *f);
-void _close_all_files();
uint32_t read_from_file(struct file *f, uint32_t max, void *buf);
//return value and max_length don't include null terminator
@@ -19,4 +19,7 @@ int32_t seek_file_by(struct file *f, int32_t by);
uint32_t file_size(struct file *f) __attribute__ ((pure));
+//return value must be manually freed, unless it is a null pointer
+_dir_info_entry_t *get_directory_info(const char *path, uint32_t *count_out);
+
#endif \ No newline at end of file
diff --git a/src/user/include/knob/quit.h b/src/user/include/knob/quit.h
deleted file mode 100644
index 7b10d09..0000000
--- a/src/user/include/knob/quit.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef KNOB_QUIT_H
-#define KNOB_QUIT_H
-
-void on_quit(void (*run_f)());
-void quit() __attribute__ ((noreturn));
-
-#endif \ No newline at end of file
diff --git a/src/user/include/knob/user.h b/src/user/include/knob/user.h
index 479a731..cd7676c 100644
--- a/src/user/include/knob/user.h
+++ b/src/user/include/knob/user.h
@@ -2,6 +2,9 @@
#define KNOB_USER_H
#include <stdint.h>
+#include <pland/syscall.h>
+
+char key_to_char(_key_code_t key) __attribute__ ((const));
void tell_user_sz(const char *sz);