69e476dcd5 2019-05-02 1: #include <xvfs-core.h>
69e476dcd5 2019-05-02 2: #include <tcl.h>
69e476dcd5 2019-05-02 3:
32b55a907b 2019-05-02 4: /*
32b55a907b 2019-05-02 5: * There are three (3) modes of operation for Xvfs_Register:
32b55a907b 2019-05-02 6: * 1. standalone -- We register our own Tcl_Filesystem
32b55a907b 2019-05-02 7: * and handle requests under `//xvfs:/<fsName>`
32b55a907b 2019-05-02 8: * 2. client -- A single Tcl_Filesystem is registered for the
32b55a907b 2019-05-02 9: * interp to handle requests under `//xvfs:/` which
32b55a907b 2019-05-02 10: * then dispatches to the appropriate registered
32b55a907b 2019-05-02 11: * handler
32b55a907b 2019-05-02 12: * 3. flexible -- Attempts to find a core Xvfs instance for the
32b55a907b 2019-05-02 13: * process at runtime, if found do #2, otherwise
32b55a907b 2019-05-02 14: * fallback to #1
32b55a907b 2019-05-02 15: *
32b55a907b 2019-05-02 16: */
32b55a907b 2019-05-02 17: static int Xvfs_Register_Standalone(Tcl_Interp *interp, const char *fsName, int protocolVersion, xvfs_proc_getChildren_t getChildrenProc, xvfs_proc_getData_t getDataProc) {
69e476dcd5 2019-05-02 18: Tcl_SetResult(interp, "Not implemented", NULL);
69e476dcd5 2019-05-02 19: return(TCL_ERROR);
32b55a907b 2019-05-02 20: }
32b55a907b 2019-05-02 21:
32b55a907b 2019-05-02 22: int Xvfs_Register(Tcl_Interp *interp, const char *fsName, int protocolVersion, xvfs_proc_getChildren_t getChildrenProc, xvfs_proc_getData_t getDataProc) {
32b55a907b 2019-05-02 23: return(Xvfs_Register_Standalone(interp, fsName, protocolVersion, getChildrenProc, getDataProc));
69e476dcd5 2019-05-02 24: }