diff options
author | dgp <dgp@noemail.net> | 2011-04-18 18:31:18 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-04-18 18:31:18 (GMT) |
commit | 85569bece28a67fb36aa388e7940ab94283ff653 (patch) | |
tree | e3a65c3f98e799650f4c4afb7abef6c94662c81e /generic/tclInt.h | |
parent | be49ba9beac70f6e9e1b38aa9257a15b5a0a97f0 (diff) | |
download | tcl-85569bece28a67fb36aa388e7940ab94283ff653.zip tcl-85569bece28a67fb36aa388e7940ab94283ff653.tar.gz tcl-85569bece28a67fb36aa388e7940ab94283ff653.tar.bz2 |
Define and use macros that test whether a Tcl list value is canonical.
FossilOrigin-Name: 13ac6c8c7b55fc9a2bdfb05efdca85459a613ef6
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index b8a4dfa..ca565dd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2207,6 +2207,9 @@ typedef struct List { #define ListObjLength(listPtr, len) \ ((len) = ListRepPtr(listPtr)->elemCount) +#define ListObjIsCanonical(listPtr) \ + (((listPtr)->bytes == NULL) || ListRepPtr(listPtr)->canonicalFlag) + #define TclListObjGetElements(interp, listPtr, objcPtr, objvPtr) \ (((listPtr)->typePtr == &tclListType) \ ? ((ListObjGetElements((listPtr), *(objcPtr), *(objvPtr))), TCL_OK)\ @@ -2217,6 +2220,9 @@ typedef struct List { ? ((ListObjLength((listPtr), *(lenPtr))), TCL_OK)\ : Tcl_ListObjLength((interp), (listPtr), (lenPtr))) +#define TclListObjIsCanonical(listPtr) \ + (((listPtr)->typePtr == &tclListType) ? ListObjIsCanonical((listPtr)) : 0) + /* * Macros providing a faster path to integers: Tcl_GetLongFromObj everywhere, * Tcl_GetIntFromObj and TclGetIntForIndex on platforms where longs are ints. |