summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-13 17:40:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-13 17:40:35 (GMT)
commit59a41732f410e4227a8de32025a882c26e825f9c (patch)
treeb3c7b61d3b06bf8eff9c3ada5da9ac440332a911
parent88d1478f11c909825177d31143fb0e99a2883eca (diff)
downloadtcl-59a41732f410e4227a8de32025a882c26e825f9c.zip
tcl-59a41732f410e4227a8de32025a882c26e825f9c.tar.gz
tcl-59a41732f410e4227a8de32025a882c26e825f9c.tar.bz2
Add TIP #139 API
-rw-r--r--generic/tcl.decls53
-rw-r--r--generic/tclDecls.h138
-rw-r--r--generic/tclStubInit.c24
3 files changed, 165 insertions, 50 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 9e7952c..991a6de 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -1763,10 +1763,59 @@ declare 493 {
Tcl_ChannelType *chanTypePtr)
}
-# Slots 494 to 553 are taken already by 8.5
+# Slots 494 to 505 are taken already by 8.5
# #111 - Dicts (494 ... 504)
# #59 - Config (505)
-# #139 - Namespace API (506 ... 517)
+
+# TIP #139 (partial exposure of namespace API - transferred from tclInt.decls)
+# dkf, API by Brent Welch?
+declare 506 {
+ Tcl_Namespace *Tcl_CreateNamespace(Tcl_Interp *interp, const char *name,
+ ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)
+}
+declare 507 {
+ void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr)
+}
+declare 508 {
+ int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+ Tcl_Obj *objPtr)
+}
+declare 509 {
+ int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+ const char *pattern, int resetListFirst)
+}
+declare 510 {
+ int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+ const char *pattern, int allowOverwrite)
+}
+declare 511 {
+ int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+ const char *pattern)
+}
+declare 512 {
+ Tcl_Namespace *Tcl_GetCurrentNamespace(Tcl_Interp *interp)
+}
+declare 513 {
+ Tcl_Namespace *Tcl_GetGlobalNamespace(Tcl_Interp *interp)
+}
+declare 514 {
+ Tcl_Namespace *Tcl_FindNamespace(Tcl_Interp *interp, const char *name,
+ Tcl_Namespace *contextNsPtr, int flags)
+}
+declare 515 {
+ Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name,
+ Tcl_Namespace *contextNsPtr, int flags)
+}
+declare 516 {
+ Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
+}
+declare 517 {
+ void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command,
+ Tcl_Obj *objPtr)
+}
+
+
+# Slots 518 to 553 are taken already by 8.5
# #137 - source -encoding (518)
# #121 - ExitProc (519)
# #121 - Resource Limits (520 ... 534)
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 0fc31d2..6eb8340 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1555,18 +1555,48 @@ EXTERN Tcl_DriverWideSeekProc * Tcl_ChannelWideSeekProc _ANSI_ARGS_((
/* Slot 503 is reserved */
/* Slot 504 is reserved */
/* Slot 505 is reserved */
-/* Slot 506 is reserved */
-/* Slot 507 is reserved */
-/* Slot 508 is reserved */
-/* Slot 509 is reserved */
-/* Slot 510 is reserved */
-/* Slot 511 is reserved */
-/* Slot 512 is reserved */
-/* Slot 513 is reserved */
-/* Slot 514 is reserved */
-/* Slot 515 is reserved */
-/* Slot 516 is reserved */
-/* Slot 517 is reserved */
+/* 506 */
+EXTERN Tcl_Namespace * Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
+ CONST char *name, ClientData clientData,
+ Tcl_NamespaceDeleteProc *deleteProc));
+/* 507 */
+EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((
+ Tcl_Namespace *nsPtr));
+/* 508 */
+EXTERN int Tcl_AppendExportList _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Namespace *nsPtr, Tcl_Obj *objPtr));
+/* 509 */
+EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Namespace *nsPtr, CONST char *pattern,
+ int resetListFirst));
+/* 510 */
+EXTERN int Tcl_Import _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Namespace *nsPtr, CONST char *pattern,
+ int allowOverwrite));
+/* 511 */
+EXTERN int Tcl_ForgetImport _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Namespace *nsPtr, CONST char *pattern));
+/* 512 */
+EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace _ANSI_ARGS_((
+ Tcl_Interp *interp));
+/* 513 */
+EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace _ANSI_ARGS_((
+ Tcl_Interp *interp));
+/* 514 */
+EXTERN Tcl_Namespace * Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
+ CONST char *name,
+ Tcl_Namespace *contextNsPtr, int flags));
+/* 515 */
+EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
+ CONST char *name,
+ Tcl_Namespace *contextNsPtr, int flags));
+/* 516 */
+EXTERN Tcl_Command Tcl_GetCommandFromObj _ANSI_ARGS_((
+ Tcl_Interp *interp, Tcl_Obj *objPtr));
+/* 517 */
+EXTERN void Tcl_GetCommandFullName _ANSI_ARGS_((
+ Tcl_Interp *interp, Tcl_Command command,
+ Tcl_Obj *objPtr));
/* Slot 518 is reserved */
/* Slot 519 is reserved */
/* Slot 520 is reserved */
@@ -2235,18 +2265,18 @@ typedef struct TclStubs {
VOID *reserved503;
VOID *reserved504;
VOID *reserved505;
- VOID *reserved506;
- VOID *reserved507;
- VOID *reserved508;
- VOID *reserved509;
- VOID *reserved510;
- VOID *reserved511;
- VOID *reserved512;
- VOID *reserved513;
- VOID *reserved514;
- VOID *reserved515;
- VOID *reserved516;
- VOID *reserved517;
+ Tcl_Namespace * (*tcl_CreateNamespace) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)); /* 506 */
+ void (*tcl_DeleteNamespace) _ANSI_ARGS_((Tcl_Namespace *nsPtr)); /* 507 */
+ int (*tcl_AppendExportList) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr)); /* 508 */
+ int (*tcl_Export) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr, CONST char *pattern, int resetListFirst)); /* 509 */
+ int (*tcl_Import) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr, CONST char *pattern, int allowOverwrite)); /* 510 */
+ int (*tcl_ForgetImport) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr, CONST char *pattern)); /* 511 */
+ Tcl_Namespace * (*tcl_GetCurrentNamespace) _ANSI_ARGS_((Tcl_Interp *interp)); /* 512 */
+ Tcl_Namespace * (*tcl_GetGlobalNamespace) _ANSI_ARGS_((Tcl_Interp *interp)); /* 513 */
+ Tcl_Namespace * (*tcl_FindNamespace) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_Namespace *contextNsPtr, int flags)); /* 514 */
+ Tcl_Command (*tcl_FindCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_Namespace *contextNsPtr, int flags)); /* 515 */
+ Tcl_Command (*tcl_GetCommandFromObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* 516 */
+ void (*tcl_GetCommandFullName) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr)); /* 517 */
VOID *reserved518;
VOID *reserved519;
VOID *reserved520;
@@ -4382,18 +4412,54 @@ extern TclStubs *tclStubsPtr;
/* Slot 503 is reserved */
/* Slot 504 is reserved */
/* Slot 505 is reserved */
-/* Slot 506 is reserved */
-/* Slot 507 is reserved */
-/* Slot 508 is reserved */
-/* Slot 509 is reserved */
-/* Slot 510 is reserved */
-/* Slot 511 is reserved */
-/* Slot 512 is reserved */
-/* Slot 513 is reserved */
-/* Slot 514 is reserved */
-/* Slot 515 is reserved */
-/* Slot 516 is reserved */
-/* Slot 517 is reserved */
+#ifndef Tcl_CreateNamespace
+#define Tcl_CreateNamespace \
+ (tclStubsPtr->tcl_CreateNamespace) /* 506 */
+#endif
+#ifndef Tcl_DeleteNamespace
+#define Tcl_DeleteNamespace \
+ (tclStubsPtr->tcl_DeleteNamespace) /* 507 */
+#endif
+#ifndef Tcl_AppendExportList
+#define Tcl_AppendExportList \
+ (tclStubsPtr->tcl_AppendExportList) /* 508 */
+#endif
+#ifndef Tcl_Export
+#define Tcl_Export \
+ (tclStubsPtr->tcl_Export) /* 509 */
+#endif
+#ifndef Tcl_Import
+#define Tcl_Import \
+ (tclStubsPtr->tcl_Import) /* 510 */
+#endif
+#ifndef Tcl_ForgetImport
+#define Tcl_ForgetImport \
+ (tclStubsPtr->tcl_ForgetImport) /* 511 */
+#endif
+#ifndef Tcl_GetCurrentNamespace
+#define Tcl_GetCurrentNamespace \
+ (tclStubsPtr->tcl_GetCurrentNamespace) /* 512 */
+#endif
+#ifndef Tcl_GetGlobalNamespace
+#define Tcl_GetGlobalNamespace \
+ (tclStubsPtr->tcl_GetGlobalNamespace) /* 513 */
+#endif
+#ifndef Tcl_FindNamespace
+#define Tcl_FindNamespace \
+ (tclStubsPtr->tcl_FindNamespace) /* 514 */
+#endif
+#ifndef Tcl_FindCommand
+#define Tcl_FindCommand \
+ (tclStubsPtr->tcl_FindCommand) /* 515 */
+#endif
+#ifndef Tcl_GetCommandFromObj
+#define Tcl_GetCommandFromObj \
+ (tclStubsPtr->tcl_GetCommandFromObj) /* 516 */
+#endif
+#ifndef Tcl_GetCommandFullName
+#define Tcl_GetCommandFullName \
+ (tclStubsPtr->tcl_GetCommandFullName) /* 517 */
+#endif
/* Slot 518 is reserved */
/* Slot 519 is reserved */
/* Slot 520 is reserved */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index f0f5e08..a80ebf2 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -1138,18 +1138,18 @@ TclStubs tclStubs = {
NULL, /* 503 */
NULL, /* 504 */
NULL, /* 505 */
- NULL, /* 506 */
- NULL, /* 507 */
- NULL, /* 508 */
- NULL, /* 509 */
- NULL, /* 510 */
- NULL, /* 511 */
- NULL, /* 512 */
- NULL, /* 513 */
- NULL, /* 514 */
- NULL, /* 515 */
- NULL, /* 516 */
- NULL, /* 517 */
+ Tcl_CreateNamespace, /* 506 */
+ Tcl_DeleteNamespace, /* 507 */
+ Tcl_AppendExportList, /* 508 */
+ Tcl_Export, /* 509 */
+ Tcl_Import, /* 510 */
+ Tcl_ForgetImport, /* 511 */
+ Tcl_GetCurrentNamespace, /* 512 */
+ Tcl_GetGlobalNamespace, /* 513 */
+ Tcl_FindNamespace, /* 514 */
+ Tcl_FindCommand, /* 515 */
+ Tcl_GetCommandFromObj, /* 516 */
+ Tcl_GetCommandFullName, /* 517 */
NULL, /* 518 */
NULL, /* 519 */
NULL, /* 520 */