From ad24d78a8ea574457accd30663a366f6502be5bc Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 5 Apr 2003 01:41:21 +0000 Subject: Final stage of getting dictionaries into the core. Test suite should work now! --- ChangeLog | 7 +++++++ generic/tclBasic.c | 4 +++- generic/tclDictObj.c | 41 +---------------------------------------- generic/tclInt.h | 5 ++++- generic/tclObj.c | 3 ++- 5 files changed, 17 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fcd996..b643b60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-04-05 Donal K. Fellows + * generic/tclDictObj.c: Removed commented out notes on + declarations to be moved to elsewhere in the Tcl core. + + * generic/tclInt.h: Final stages of plumbing in. + * generic/tclBasic.c: + * generic/tclObj.c (TclInitObjSubsystem): + * unix/Makefile.in, win/Makefile.in, win/makefile.[bv]c: Build support. * generic/tcl.decls: Added dict public API to stubs table. * generic/tcl.h (Tcl_DictSearch): Added declaration of structure diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5315494..c7c990d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.77 2003/03/13 02:48:52 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.78 2003/04/05 01:41:22 dkf Exp $ */ #include "tclInt.h" @@ -88,6 +88,8 @@ static CmdInfo builtInCmds[] = { (CompileProc *) NULL, 1}, {"continue", (Tcl_CmdProc *) NULL, Tcl_ContinueObjCmd, TclCompileContinueCmd, 1}, + {"dict", (Tcl_CmdProc *) NULL, Tcl_DictObjCmd, + (CompileProc *) NULL, 1}, {"encoding", (Tcl_CmdProc *) NULL, Tcl_EncodingObjCmd, (CompileProc *) NULL, 0}, {"error", (Tcl_CmdProc *) NULL, Tcl_ErrorObjCmd, diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index c59be73..ef88609 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -9,50 +9,11 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDictObj.c,v 1.1 2003/04/05 01:03:20 dkf Exp $ + * RCS: @(#) $Id: tclDictObj.c,v 1.2 2003/04/05 01:41:23 dkf Exp $ */ #include "tclInt.h" -#if 0 -/* - * Declarations to go to tcl.h - */ -typedef struct { - Tcl_HashSearch search; - int epoch; - Dict *dictionaryPtr; -} Tcl_DictSearch; -/* - * Prototypes to be moved to tcl.decls... - */ -int Tcl_DictObjPut(Tcl_Interp *interp, Tcl_Obj *dictPtr, - Tcl_Obj *keyPtr, Tcl_Obj *valuePtr); -int Tcl_DictObjGet(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, - Tcl_Obj **valuePtrPtr); -int Tcl_DictObjRemove(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr); -int Tcl_DictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr); -int Tcl_DictObjFirst(Tcl_Interp *interp, Tcl_Obj *dictPtr, - Tcl_DictSearch *searchPtr, - Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); -void Tcl_DictObjNext(Tcl_DictSearch *searchPtr, - Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); -void Tcl_DictObjDone(Tcl_DictSearch *searchPtr); -int Tcl_DictObjPutKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr, - int keyc, Tcl_Obj *CONST *keyv, Tcl_Obj *valuePtr); -int Tcl_DictObjRemoveKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr, - int keyc, Tcl_Obj *CONST *keyv); -Tcl_Obj *Tcl_NewDictObj(void); -Tcl_Obj *Tcl_DbNewDictObj(CONST char *file, int line); -/* - * Prototypes to be moved to tclInt.h - */ -int Tcl_DictObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST *objv); -#endif - -/*----------------------------------------------------------------------*/ - /* * Prototypes for procedures defined later in this file: */ diff --git a/generic/tclInt.h b/generic/tclInt.h index af2bf4e..02290fa 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.122 2003/03/21 03:23:24 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.123 2003/04/05 01:41:23 dkf Exp $ */ #ifndef _TCLINT @@ -1555,6 +1555,7 @@ extern Tcl_ObjType tclDoubleType; extern Tcl_ObjType tclEndOffsetType; extern Tcl_ObjType tclIntType; extern Tcl_ObjType tclListType; +extern Tcl_ObjType tclDictType; extern Tcl_ObjType tclProcBodyType; extern Tcl_ObjType tclStringType; extern Tcl_ObjType tclArraySearchType; @@ -1817,6 +1818,8 @@ EXTERN int Tcl_ConcatObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_ContinueObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); +EXTERN int Tcl_DictObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_EncodingObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_EofObjCmd _ANSI_ARGS_((ClientData clientData, diff --git a/generic/tclObj.c b/generic/tclObj.c index f9cee12..1a9307e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclObj.c,v 1.42 2003/01/17 22:11:02 mdejong Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.43 2003/04/05 01:41:23 dkf Exp $ */ #include "tclInt.h" @@ -238,6 +238,7 @@ TclInitObjSubsystem() #endif Tcl_RegisterObjType(&tclStringType); Tcl_RegisterObjType(&tclListType); + Tcl_RegisterObjType(&tclDictType); Tcl_RegisterObjType(&tclByteCodeType); Tcl_RegisterObjType(&tclProcBodyType); Tcl_RegisterObjType(&tclArraySearchType); -- cgit v0.12