summaryrefslogtreecommitdiff
path: root/src/main/kotlin/NinePTranslator.kt
diff options
context:
space:
mode:
authorEdoardo La Greca2025-06-18 19:14:50 +0200
committerEdoardo La Greca2025-06-18 19:14:50 +0200
commit5a2c35806d78d12d60d49511af2da6a21a91964b (patch)
tree2f1d2d9cd11976e6b488a022ec1d0c5f322a48dd /src/main/kotlin/NinePTranslator.kt
parent13421c537773cae59a4ca1fcc798ed3820634139 (diff)
add all source code
Diffstat (limited to 'src/main/kotlin/NinePTranslator.kt')
-rw-r--r--src/main/kotlin/NinePTranslator.kt77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/main/kotlin/NinePTranslator.kt b/src/main/kotlin/NinePTranslator.kt
new file mode 100644
index 0000000..c976cd9
--- /dev/null
+++ b/src/main/kotlin/NinePTranslator.kt
@@ -0,0 +1,77 @@
+/*
+TODO:
+ - add arguments to methods
+*/
+
+/**
+ * The [NinePTranslator] interface provides methods that coincide 1:1 with each request and response type in the 9P
+ * protocol, except for `Rerror` which is handled at occurrence.
+ *
+ * Trivia: comments for each method are taken from each message type's manual page in section 5.
+ */
+interface NinePTranslator {
+ /**
+ * Negotiate protocol version.
+ */
+ fun version()
+
+ /**
+ * Perform authentication.
+ */
+ fun auth()
+
+ /**
+ * Abort a message.
+ */
+ fun flush()
+
+ /**
+ * Establish a connection.
+ */
+ fun attach()
+
+ /**
+ * Descend a directory hierarchy.
+ */
+ fun walk(path: String)
+
+ /**
+ * Prepare an FID for I/O on an existing file.
+ */
+ fun open(path: String)
+
+ /**
+ * Prepare an FID for I/O on a new file.
+ */
+ fun create(path: String)
+
+ /**
+ * Transfer data from file.
+ */
+ fun read(path: String)
+
+ /**
+ * Transfer data to file.
+ */
+ fun write(path: String)
+
+ /**
+ * Forget about an FID.
+ */
+ fun clunk(path: String)
+
+ /**
+ * Remove a file from a server.
+ */
+ fun remove(path: String)
+
+ /**
+ * Inquire file attributes.
+ */
+ fun stat(path: String)
+
+ /**
+ * Change file attributes.
+ */
+ fun wstat(path: String)
+} \ No newline at end of file