summaryrefslogtreecommitdiff
path: root/cmd/srv9p/static9p.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-12 17:53:05 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-12 17:53:05 -0600
commiteb4e0bc7dd140b356a62071bf8e0427fc0cee816 (patch)
treec71d7daf1dfccf7e261c2fe22d7d5a0bd55bf34d /cmd/srv9p/static9p.h
parent7508de2e4ec10baf46c7cde6e7774051ac19e95a (diff)
get read working correctly
Diffstat (limited to 'cmd/srv9p/static9p.h')
-rw-r--r--cmd/srv9p/static9p.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/cmd/srv9p/static9p.h b/cmd/srv9p/static9p.h
new file mode 100644
index 0000000..2d77138
--- /dev/null
+++ b/cmd/srv9p/static9p.h
@@ -0,0 +1,41 @@
+#ifndef _STATIC9P_H_
+#define _STATIC9P_H_
+
+#include <lib9p/srv.h>
+
+struct static_metadata {
+ struct lib9p_srv_file header;
+
+ char *u_name;
+ uint32_t u_num;
+ char *g_name;
+ uint32_t g_num;
+ char *m_name;
+ uint32_t m_num;
+
+ uint64_t pathnum;
+ char *name;
+ lib9p_dm_t perm;
+ uint32_t atime, mtime;
+};
+
+struct static_dir {
+ struct static_metadata metadata;
+
+ /* NULL-terminated */
+ struct lib9p_srv_file *members[];
+};
+
+
+struct static_file {
+ struct static_metadata metadata;
+
+ char *data_start; /* must not be NULL */
+ char *data_end; /* may be NULL, in which case data_size is used */
+ size_t data_size; /* only used if .data_end==NULL */
+};
+
+extern struct lib9p_srv_file_vtable static_dir_vtable;
+extern struct lib9p_srv_file_vtable static_file_vtable;
+
+#endif /* _STATIC9P_H_ */