Index: xvfs-core.c ================================================================== --- xvfs-core.c +++ xvfs-core.c @@ -1,8 +1,18 @@ #include #include #include + +#if defined(XVFS_MODE_FLEXIBLE) || defined(XVFS_MODE_SERVER) +#define XVFS_INTERNAL_SERVER_MAGIC "\xD4\xF3\x05\x96\x25\xCF\xAF\xFE" +#define XVFS_INTERNAL_SERVER_MAGIC_LEN 8 + +struct xvfs_tclfs_server_info { + char magic[XVFS_PROTOCOL_SERVER_MAGIC_LEN]; + int (*registerProc)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo); +}; +#endif /* XVFS_MODE_FLEXIBLE || XVFS_MODE_SERVER */ #if defined(XVFS_MODE_SERVER) || defined(XVFS_MODE_STANDALONE) || defined(XVFS_MODE_FLEXIBLE) #define XVFS_ROOT_MOUNTPOINT "//xvfs:/" struct xvfs_tclfs_instance_info { @@ -182,18 +192,11 @@ return(tcl_ret); } return(TCL_OK); } -#endif - -#if defined(XVFS_MODE_FLEXIBLE) || defined(XVFS_MODE_SERVER) -struct xvfs_tclfs_server_info { - char magic[XVFS_PROTOCOL_SERVER_MAGIC_LEN]; - int (*registerProc)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo); -}; -#endif +#endif /* XVFS_MODE_STANDALONE || XVFS_MODE_FLEXIBLE */ #if defined(XVFS_MODE_FLEXIBLE) int xvfs_flexible_register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) { ClientData fsHandlerDataRaw; struct xvfs_tclfs_server_info *fsHandlerData; @@ -231,12 +234,12 @@ xvfs_register = fsHandlerData->registerProc; } return(xvfs_register(interp, fsInfo)); } -#endif +#endif /* XVFS_MODE_FLEXIBLE */ #if defined(XVFS_MODE_SERVER) int Xvfs_Register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) { return(TCL_ERROR); } -#endif +#endif /* XVFS_MODE_SERVER */ Index: xvfs-core.h ================================================================== --- xvfs-core.h +++ xvfs-core.h @@ -2,12 +2,10 @@ #define XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 1 #include #define XVFS_PROTOCOL_VERSION 1 -#define XVFS_PROTOCOL_SERVER_MAGIC "\xD4\xF3\x05\x96\x25\xCF\xAF\xFE" -#define XVFS_PROTOCOL_SERVER_MAGIC_LEN 8 typedef const char **(*xvfs_proc_getChildren_t)(const char *path, Tcl_WideInt *count); typedef const unsigned char *(*xvfs_proc_getData_t)(const char *path, Tcl_WideInt start, Tcl_WideInt *length); typedef int (*xvfs_proc_getStat_t)(const char *path, Tcl_StatBuf *statBuf);