Lines of
xvfs-core.h
from check-in b8cca3a6b4
that are changed by the sequence of edits moving toward
check-in 149aa89b7d:
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
29: static XVFS_REGISTER_INTERFACE(Xvfs_Register)
30:
31: #elif defined(XVFS_MODE_FLEXIBLE)
32: /*
33: * In flexible mode, we just redefine calls to
34: * Xvfs_Register() to go to the xvfs_flexible_register()
35: * function which will either dispatch to a common
36: * core XVFS or use the xvfs_standalone_register()
37: * function as a standalone would.
38: */
39: # define Xvfs_Register xvfs_flexible_register
40: static 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: * In flexible or standalone mode, directly include what
63: * would otherwise be a separate translation unit, to
64: * avoid symbols leaking
65: */
66: #if defined(XVFS_MODE_FLEXIBLE) || defined(XVFS_MODE_STANDALONE)
67: #include <xvfs-core.c>
68: #endif
69:
70: #endif