Check-in [d92ba3d36d]
Overview
Comment:Cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d92ba3d36d72343cdf4ebaa042b3b8df7eee05cb51eb79bc3dc71c49705b84a0
User & Date: rkeene on 2019-05-08 16:46:36
Other Links: manifest | tags
Context
2019-05-08
16:47
Fixed incomplete rename check-in: b586d5b0a1 user: rkeene tags: trunk
16:46
Cleanup check-in: d92ba3d36d user: rkeene tags: trunk
16:26
Use Tcl filesystem data to pass around a pointer to the central register proc check-in: 9bcf758fef user: rkeene tags: trunk
Changes

Modified xvfs-core.c from [c526fca0fb] to [61701b79db].

1
2
3










4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20



+
+
+
+
+
+
+
+
+
+







#include <xvfs-core.h>
#include <string.h>
#include <tcl.h>

#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 {
	struct Xvfs_FSInfo *fsInfo;
	Tcl_Obj            *mountpoint;
180
181
182
183
184
185
186
187
188

189
190
191
192
193
194
195
196
197
198
199
200
201
190
191
192
193
194
195
196


197






198
199
200
201
202
203
204







-
-
+
-
-
-
-
-
-







		}
		
		return(tcl_ret);
	}
	
	return(TCL_OK);
}
#endif

#endif /* XVFS_MODE_STANDALONE || XVFS_MODE_FLEXIBLE */
#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

#if defined(XVFS_MODE_FLEXIBLE)
int xvfs_flexible_register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) {
	ClientData fsHandlerDataRaw;
	struct xvfs_tclfs_server_info *fsHandlerData;
	const Tcl_Filesystem *fsHandler;
	int (*xvfs_register)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo);
229
230
231
232
233
234
235
236

237
238
239
240
241
242

232
233
234
235
236
237
238

239
240
241
242
243
244

245







-
+





-
+
	 */
	if (memcmp(fsHandlerData->magic, XVFS_PROTOCOL_SERVER_MAGIC, sizeof(fsHandlerData->magic)) == 0) {
		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 */

Modified xvfs-core.h from [21ceadd8e9] to [490b145452].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6


7
8
9
10
11
12
13






-
-







#ifndef XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817
#define XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 1

#include <tcl.h>

#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);

struct Xvfs_FSInfo {
	int                      protocolVersion;