summaryrefslogtreecommitdiff
path: root/src/main/kotlin/ProtocolTranslator.kt
diff options
context:
space:
mode:
authorEdoardo La Greca2025-08-09 19:30:21 +0200
committerEdoardo La Greca2025-08-09 19:30:21 +0200
commit31c4a211c483363bd254d41c3451e98116b05c4a (patch)
treed15d4b77d65fe6a250b113ee5b5be395ba8bf6c4 /src/main/kotlin/ProtocolTranslator.kt
parent5316ed0c6e4200195c6031651e285f61bb1424ab (diff)
remove fid and qid management from Connection and return them in ProtocolTranslator methods
Diffstat (limited to 'src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r--src/main/kotlin/ProtocolTranslator.kt10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt
index b3674f1..c023dd6 100644
--- a/src/main/kotlin/ProtocolTranslator.kt
+++ b/src/main/kotlin/ProtocolTranslator.kt
@@ -9,7 +9,7 @@ TODO:
* Every method that can fail, that is, every request that can receive a response with `Rerror` type instead of the same
* type as itself, returns a non-null `String` that contains the error message received in the response.
*
- * Tags, FIDs, QIDs, and the `msize` value are supposed to be managed internally by the implementing class.
+ * Tags and the `msize` value are supposed to be managed internally by the implementing class.
*
* When compared to 9P's formal message descriptions, like those which can be read in Plan 9's manual pages, some of the
* methods might lack parameters. Those which can be inferred from the existing parameters are purposefully omitted. An
@@ -55,10 +55,11 @@ interface ProtocolTranslator {
* @param afid A FID previously established by an auth message.
* @param uname A user identifier.
* @param aname The desired file tree to access.
+ * @return The QID of the file tree's root.
* @throws except.InvalidMessageException if the received message is invalid.
* @throws except.RErrorException if the received message is an R-error message.
*/
- fun attach(fid: UInt, afid: UInt, uname: String, aname: String)
+ fun attach(fid: UInt, afid: UInt, uname: String, aname: String): QID
/**
* Descend a directory hierarchy.
@@ -67,11 +68,12 @@ interface ProtocolTranslator {
* @param newfid The proposed FID, which is going to be associated with the result of walking the hierarchy. It must
* be not in use, unless it is the same as [fid].
* @param wname The successive path name elements which describe the file to walk to.
+ * @return The QID of each path element that has been walked through.
* @throws except.InvalidMessageException if the received message is invalid.
* @throws except.RErrorException if the received message is an R-error message.
- * @throws except.UnaccessibleFileException if [wname] contains one or more files that do not exist.
+ * @throws except.UnaccessibleFileException if [wname] contains one or more path elements that do not exist.
*/
- fun walk(fid: UInt, newfid: UInt, wname: List<String>)
+ fun walk(fid: UInt, newfid: UInt, wname: List<String>): List<QID>
/**
* Prepare an FID for I/O on an existing file.