Lines of
xvfs-core.h
from check-in daf25f5222
that are changed by the sequence of edits moving toward
check-in b8cca3a6b4:
1: #ifndef XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817
2: #define XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 1
3:
4: #include <tcl.h>
5:
6: #define XVFS_PROTOCOL_VERSION 1
7:
8: typedef const char **(*xvfs_proc_getChildren_t)(const char *path, Tcl_WideInt *count);
9: typedef const unsigned char *(*xvfs_proc_getData_t)(const char *path, Tcl_WideInt start, Tcl_WideInt *length);
10: typedef int (*xvfs_proc_getStat_t)(const char *path, Tcl_StatBuf *statBuf);
11:
12: struct Xvfs_FSInfo {
13: int protocolVersion;
14: const char *name;
15: xvfs_proc_getChildren_t getChildrenProc;
16: xvfs_proc_getData_t getDataProc;
17: xvfs_proc_getStat_t getStatProc;
18: };
19:
20: #define XVFS_REGISTER_INTERFACE(name) int name(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo);
21:
22: #if defined(XVFS_MODE_STANDALONE)
23: /*
24: * In standalone mode, we just redefine calls to
25: * Xvfs_Register() to go to the xvfs_standalone_register()
26: * function
27: */
28: # define Xvfs_Register xvfs_standalone_register
d92ba3d36d 2019-05-08 29: XVFS_REGISTER_INTERFACE(Xvfs_Register)
30:
31: #elif defined(XVFS_MODE_FLEXIBLE)
32: /*
d92ba3d36d 2019-05-08 33: * In flexible mode we declare an external symbol named
d92ba3d36d 2019-05-08 34: * Xvfs_Register(), as well as an internal symbol called
d92ba3d36d 2019-05-08 35: * xvfs_flexible_register(), which we redefine future
d92ba3d36d 2019-05-08 36: * calls to Xvfs_Register() to invoke
37: */
d92ba3d36d 2019-05-08 38: extern XVFS_REGISTER_INTERFACE(Xvfs_Register)
39: # define Xvfs_Register xvfs_flexible_register
d92ba3d36d 2019-05-08 40: XVFS_REGISTER_INTERFACE(Xvfs_Register)
41:
42: #elif defined(XVFS_MODE_CLIENT)
43: /*
44: * In client mode we declare an external symbol named
45: * Xvfs_Register() that must be provided by the environment
46: * we are loaded into
47: */
48: extern XVFS_REGISTER_INTERFACE(Xvfs_Register)
49:
50: #elif defined(XVFS_MODE_SERVER)
51: /*
52: * In server mode we are going to implementing Xvfs_Register()
53: * for flexible/client modes, just forward declare it
54: */
55: XVFS_REGISTER_INTERFACE(Xvfs_Register)
56:
57: #else
58: # error Unsupported XVFS_MODE
59: #endif
60:
61:
62: #endif