summaryrefslogtreecommitdiffstats
path: root/generic/zipfs.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-22 08:45:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-22 08:45:38 (GMT)
commitc3e9d3205f97172484ecb5386d05c27c019493fa (patch)
tree28ba723230978a5938a1b0845d3646a1e42f7667 /generic/zipfs.c
parent227fbec0fc99d718ac822a26a9e5154296609e80 (diff)
parent3aa54d6d7a548114a22128c5db532be5cc40ef09 (diff)
downloadtcl-c3e9d3205f97172484ecb5386d05c27c019493fa.zip
tcl-c3e9d3205f97172484ecb5386d05c27c019493fa.tar.gz
tcl-c3e9d3205f97172484ecb5386d05c27c019493fa.tar.bz2
Add "zipfs" ensemble.
Diffstat (limited to 'generic/zipfs.c')
-rw-r--r--generic/zipfs.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/generic/zipfs.c b/generic/zipfs.c
index b626e1b..8db1ac1 100644
--- a/generic/zipfs.c
+++ b/generic/zipfs.c
@@ -3958,6 +3958,27 @@ static int
Zipfs_doInit(Tcl_Interp *interp, int safe)
{
#ifdef HAVE_ZLIB
+ static const EnsembleImplMap initMap[] = {
+ {"mount", ZipFSMountObjCmd, NULL, NULL, NULL, 0},
+ {"unmount", ZipFSUnmountObjCmd, NULL, NULL, NULL, 0},
+ {"mkkey", ZipFSMkKeyObjCmd, NULL, NULL, NULL, 0},
+ {"mkimg", ZipFSMkImgObjCmd, NULL, NULL, NULL, 0},
+ {"mkzip", ZipFSMkZipObjCmd, NULL, NULL, NULL, 0},
+ {"lmkimg", ZipFSLMkImgObjCmd, NULL, NULL, NULL, 0},
+ {"lmkzip", ZipFSLMkZipObjCmd, NULL, NULL, NULL, 0},
+ {"exists", ZipFSExistsObjCmd, NULL, NULL, NULL, 0},
+ {"info", ZipFSInfoObjCmd, NULL, NULL, NULL, 0},
+ {"list", ZipFSListObjCmd, NULL, NULL, NULL, 0},
+ {NULL, NULL, NULL, NULL, NULL, 0}
+ };
+
+ static const EnsembleImplMap initSafeMap[] = {
+ {"exists", ZipFSExistsObjCmd, NULL, NULL, NULL, 0},
+ {"info", ZipFSInfoObjCmd, NULL, NULL, NULL, 0},
+ {"list", ZipFSListObjCmd, NULL, NULL, NULL, 0},
+ {NULL, NULL, NULL, NULL, NULL, 0}
+ };
+
static const char findproc[] =
"proc ::zipfs::find dir {\n"
" set result {}\n"
@@ -4018,6 +4039,9 @@ Zipfs_doInit(Tcl_Interp *interp, int safe)
Tcl_LinkVar(interp, "::zipfs::wrmax", (char *) &ZipFS.wrmax,
TCL_LINK_INT);
}
+
+ TclMakeEnsemble(interp, "zipfs", safe ? initSafeMap : initMap);
+
return TCL_OK;
#else
if (interp != NULL) {