summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-08 08:42:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-08 08:42:38 (GMT)
commitf9350ae5e07eadaf60aac2772b1198a08f210327 (patch)
treeab86b677e431c45ca8295c1e9986bc78c3cb032c /generic
parent4f8d20cba26646028a0110f0cdb6549ba65e8e1d (diff)
parent1245809b52cec711dfb790483fd30a997a28a37b (diff)
downloadtcl-f9350ae5e07eadaf60aac2772b1198a08f210327.zip
tcl-f9350ae5e07eadaf60aac2772b1198a08f210327.tar.gz
tcl-f9350ae5e07eadaf60aac2772b1198a08f210327.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls8
-rw-r--r--generic/tclDecls.h10
-rw-r--r--generic/tclInterp.c2
-rw-r--r--generic/tclZipfs.c44
4 files changed, 32 insertions, 32 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 6517c8f..6ca10c0 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2395,8 +2395,8 @@ declare 631 {
# TIP #430
declare 632 {
- int TclZipfs_Mount(Tcl_Interp *interp, const char *mountPoint,
- const char *zipname, const char *passwd)
+ int TclZipfs_Mount(Tcl_Interp *interp, const char *zipname,
+ const char *mountPoint, const char *passwd)
}
declare 633 {
int TclZipfs_Unmount(Tcl_Interp *interp, const char *mountPoint)
@@ -2405,8 +2405,8 @@ declare 634 {
Tcl_Obj *TclZipfs_TclLibrary(void)
}
declare 635 {
- int TclZipfs_MountBuffer(Tcl_Interp *interp, const char *mountPoint,
- unsigned char *data, size_t datalen, int copy)
+ int TclZipfs_MountBuffer(Tcl_Interp *interp, const void *data,
+ size_t datalen, const char *mountPoint, int copy)
}
# TIP #445
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 31c59df..25a11d8 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1696,7 +1696,7 @@ EXTERN Tcl_Channel Tcl_OpenTcpServerEx(Tcl_Interp *interp,
void *callbackData);
/* 632 */
EXTERN int TclZipfs_Mount(Tcl_Interp *interp,
- const char *mountPoint, const char *zipname,
+ const char *zipname, const char *mountPoint,
const char *passwd);
/* 633 */
EXTERN int TclZipfs_Unmount(Tcl_Interp *interp,
@@ -1705,8 +1705,8 @@ EXTERN int TclZipfs_Unmount(Tcl_Interp *interp,
EXTERN Tcl_Obj * TclZipfs_TclLibrary(void);
/* 635 */
EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp,
- const char *mountPoint, unsigned char *data,
- size_t datalen, int copy);
+ const void *data, size_t datalen,
+ const char *mountPoint, int copy);
/* 636 */
EXTERN void Tcl_FreeInternalRep(Tcl_Obj *objPtr);
/* 637 */
@@ -2511,10 +2511,10 @@ typedef struct TclStubs {
int (*tcl_FSUnloadFile) (Tcl_Interp *interp, Tcl_LoadHandle handlePtr); /* 629 */
void (*tcl_ZlibStreamSetCompressionDictionary) (Tcl_ZlibStream zhandle, Tcl_Obj *compressionDictionaryObj); /* 630 */
Tcl_Channel (*tcl_OpenTcpServerEx) (Tcl_Interp *interp, const char *service, const char *host, unsigned int flags, int backlog, Tcl_TcpAcceptProc *acceptProc, void *callbackData); /* 631 */
- int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *mountPoint, const char *zipname, const char *passwd); /* 632 */
+ int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *zipname, const char *mountPoint, const char *passwd); /* 632 */
int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
- int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */
+ int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const void *data, size_t datalen, const char *mountPoint, int copy); /* 635 */
void (*tcl_FreeInternalRep) (Tcl_Obj *objPtr); /* 636 */
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, TCL_HASH_TYPE numBytes); /* 637 */
Tcl_ObjInternalRep * (*tcl_FetchInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 79b4634..bd79497 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -401,12 +401,12 @@ Tcl_Init(
"if {$tail eq [info tclversion]} continue\n"
"file join [file dirname $env(TCL_LIBRARY)] tcl[info tclversion]}\n"
" }\n"
+" lappend scripts {::tcl::zipfs::tcl_library_init}\n"
" if {[info exists tclDefaultLibrary]} {\n"
" lappend scripts {set tclDefaultLibrary}\n"
" } else {\n"
" lappend scripts {::tcl::pkgconfig get scriptdir,runtime}\n"
" }\n"
-" lappend scripts {::tcl::zipfs::tcl_library_init}\n"
" lappend scripts {\n"
"set parentDir [file dirname [file dirname [info nameofexecutable]]]\n"
"set grandParentDir [file dirname $parentDir]\n"
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 2df7705..ba2471d 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -1966,9 +1966,9 @@ DescribeMounted(
int
TclZipfs_Mount(
Tcl_Interp *interp, /* Current interpreter. NULLable. */
- const char *mountPoint, /* Mount point path. */
const char *zipname, /* Path to ZIP file to mount; should be
* normalized. */
+ const char *mountPoint, /* Mount point path. */
const char *passwd) /* Password for opening the ZIP, or NULL if
* the ZIP is unprotected. */
{
@@ -2044,9 +2044,9 @@ TclZipfs_Mount(
int
TclZipfs_MountBuffer(
Tcl_Interp *interp, /* Current interpreter. NULLable. */
- const char *mountPoint, /* Mount point path. */
- unsigned char *data,
+ const void *data,
size_t datalen,
+ const char *mountPoint, /* Mount point path. */
int copy)
{
ZipFile *zf;
@@ -2098,7 +2098,7 @@ TclZipfs_MountBuffer(
memcpy(zf->data, data, datalen);
zf->ptrToFree = zf->data;
} else {
- zf->data = data;
+ zf->data = (unsigned char *) data;
zf->ptrToFree = NULL;
}
if (ZipFSFindTOC(interp, 0, zf) != TCL_OK) {
@@ -2222,14 +2222,11 @@ ZipFSMountObjCmd(
if (objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
- "?mountpoint? ?zipfile? ?password?");
+ "?zipfile? ?mountpoint? ?password?");
return TCL_ERROR;
}
if (objc > 1) {
- mountPoint = TclGetString(objv[1]);
- }
- if (objc > 2) {
- zipFileObj = Tcl_FSGetNormalizedPath(interp, objv[2]);
+ zipFileObj = Tcl_FSGetNormalizedPath(interp, objv[1]);
if (!zipFileObj) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"could not normalize zip filename", -1));
@@ -2239,11 +2236,14 @@ ZipFSMountObjCmd(
Tcl_IncrRefCount(zipFileObj);
zipFile = TclGetString(zipFileObj);
}
+ if (objc > 2) {
+ mountPoint = TclGetString(objv[2]);
+ }
if (objc > 3) {
password = TclGetString(objv[3]);
}
- result = TclZipfs_Mount(interp, mountPoint, zipFile, password);
+ result = TclZipfs_Mount(interp, zipFile, mountPoint, password);
if (zipFileObj != NULL) {
Tcl_DecrRefCount(zipFileObj);
}
@@ -2278,7 +2278,7 @@ ZipFSMountBufferObjCmd(
Tcl_Size length;
if (objc > 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?");
+ Tcl_WrongNumArgs(interp, 1, objv, "?data? ?mountpoint?");
return TCL_ERROR;
}
if (objc < 2) {
@@ -2290,19 +2290,19 @@ ZipFSMountBufferObjCmd(
return ret;
}
- mountPoint = TclGetString(objv[1]);
if (objc < 3) {
ReadLock();
- DescribeMounted(interp, mountPoint);
+ DescribeMounted(interp, TclGetString(objv[1]));
Unlock();
return TCL_OK;
}
- data = Tcl_GetBytesFromObj(interp, objv[2], &length);
+ data = Tcl_GetBytesFromObj(interp, objv[1], &length);
+ mountPoint = TclGetString(objv[2]);
if (data == NULL) {
return TCL_ERROR;
}
- return TclZipfs_MountBuffer(interp, mountPoint, data, length, 1);
+ return TclZipfs_MountBuffer(interp, data, length, mountPoint, 1);
}
/*
@@ -2356,7 +2356,7 @@ ZipFSUnmountObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "zipfile");
+ Tcl_WrongNumArgs(interp, 1, objv, "mountpoint");
return TCL_ERROR;
}
return TclZipfs_Unmount(interp, TclGetString(objv[1]));
@@ -5701,7 +5701,7 @@ ZipfsAppHookFindTclInit(
if (zipfs_literal_tcl_library) {
return TCL_ERROR;
}
- if (TclZipfs_Mount(NULL, ZIPFS_ZIP_MOUNT, archive, NULL)) {
+ if (TclZipfs_Mount(NULL, archive, ZIPFS_ZIP_MOUNT, NULL)) {
/* Either the file doesn't exist or it is not a zip archive */
return TCL_ERROR;
}
@@ -5815,7 +5815,7 @@ TclZipfs_AppHook(
* function.
*/
- if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) {
+ if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
int found;
Tcl_Obj *vfsInitScript;
@@ -5877,7 +5877,7 @@ TclZipfs_AppHook(
Tcl_SetStartupScript(vfsInitScript, NULL);
}
return result;
- } else if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) {
+ } else if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
int found;
Tcl_Obj *vfsInitScript;
@@ -5926,8 +5926,8 @@ TclZipfs_AppHook(
int
TclZipfs_Mount(
Tcl_Interp *interp, /* Current interpreter. */
- TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(const char *), /* Path to ZIP file to mount. */
+ TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(const char *)) /* Password for opening the ZIP, or NULL if
* the ZIP is unprotected. */
{
@@ -5939,9 +5939,9 @@ TclZipfs_Mount(
int
TclZipfs_MountBuffer(
Tcl_Interp *interp, /* Current interpreter. NULLable. */
- TCL_UNUSED(const char *), /* Mount point path. */
- TCL_UNUSED(unsigned char *),
+ TCL_UNUSED(const void *),
TCL_UNUSED(size_t),
+ TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(int))
{
ZIPFS_ERROR(interp, "no zlib available");