本文整理汇总了C++中Tcl_GetHashValue函数的典型用法代码示例。如果您正苦于以下问题:C++ Tcl_GetHashValue函数的具体用法?C++ Tcl_GetHashValue怎么用?C++ Tcl_GetHashValue使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Tcl_GetHashValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NextSigMapEntry
ClientData
NextSigMapEntry (
SignalMapSearch *searchPtr)
{
Tcl_HashEntry *entryPtr;
entryPtr = Tcl_NextHashEntry(searchPtr);
if (entryPtr != NULL) {
return Tcl_GetHashValue(entryPtr);
} else {
return NULL;
}
}
示例2: while
/*
* Ttk_StyleMap --
* Look up state-specific option value from specified style.
*/
Tcl_Obj *Ttk_StyleMap(Ttk_Style style, const char *optionName, Ttk_State state)
{
while (style) {
Tcl_HashEntry *entryPtr =
Tcl_FindHashEntry(&style->settingsTable, optionName);
if (entryPtr) {
Ttk_StateMap stateMap = Tcl_GetHashValue(entryPtr);
return Ttk_StateMapLookup(NULL, stateMap, state);
}
style = style->parentStyle;
}
return 0;
}
示例3: GetBitmapFromObj
static TkBitmap *
GetBitmapFromObj(
Tk_Window tkwin, /* Window in which the bitmap will be used. */
Tcl_Obj *objPtr) /* The object that describes the desired
* bitmap. */
{
TkBitmap *bitmapPtr;
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (objPtr->typePtr != &tkBitmapObjType) {
InitBitmapObj(objPtr);
}
bitmapPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (bitmapPtr != NULL) {
if ((bitmapPtr->resourceRefCount > 0)
&& (Tk_Display(tkwin) == bitmapPtr->display)) {
return bitmapPtr;
}
hashPtr = bitmapPtr->nameHashPtr;
FreeBitmapObj(objPtr);
} else {
hashPtr = Tcl_FindHashEntry(&dispPtr->bitmapNameTable,
Tcl_GetString(objPtr));
if (hashPtr == NULL) {
goto error;
}
}
/*
* At this point we've got a hash table entry, off of which hang one or
* more TkBitmap structures. See if any of them will work.
*/
for (bitmapPtr = Tcl_GetHashValue(hashPtr); bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
if (Tk_Display(tkwin) == bitmapPtr->display) {
objPtr->internalRep.twoPtrValue.ptr1 = bitmapPtr;
bitmapPtr->objRefCount++;
return bitmapPtr;
}
}
error:
Tcl_Panic("GetBitmapFromObj called with non-existent bitmap!");
/*
* The following code isn't reached; it's just there to please compilers.
*/
return NULL;
}
示例4: get_material
/* Get material pointer from material name */
int
get_material(const char *mat_name, material_t **mat )
{
Tcl_HashEntry *entry;
entry = Tcl_FindHashEntry(&g_hier_material_table, mat_name);
if (0 == entry) {
return TCL_ERROR;
} else {
*mat = (material_t*)Tcl_GetHashValue(entry);
}
return TCL_OK;
}
示例5: Delete_RR_Hash
/* Destroy the RR hash for a sender, and all its associated values. */
void Delete_RR_Hash(member *the_member)
{
Tcl_HashTable *the_table = &the_member->RR_Hash;
Tcl_HashEntry *the_entry;
Tcl_HashSearch the_search;
the_entry = Tcl_FirstHashEntry(the_table, &the_search);
while (the_entry != NULL) {
free(Tcl_GetHashValue(the_entry));
the_entry = Tcl_NextHashEntry(&the_search);
}
Tcl_DeleteHashTable(the_table);
}
示例6: tn_delete
void
tn_delete (TNPtr n)
{
T* t = n->tree;
/* We assume that the node either has no parent or siblings anymore,
* or that their presence does not matter. The node may still have
* children. They are deleted recursively. That is the situation
* where the parent/sibling information does not matter anymore, and
* can be ignored.
*/
tn_notleaf (n);
tn_notnode (n);
Tcl_DecrRefCount (n->name); n->name = NULL;
Tcl_DeleteHashEntry (n->he); n->he = NULL;
if (n->child) {
int i;
for (i = 0; i < n->nchildren; i++) {
ASSERT_BOUNDS (i, n->nchildren);
tn_delete (n->child [i]);
n->child [i] = NULL;
}
ckfree ((char*) n->child);
n->child = NULL;
n->nchildren = 0;
n->maxchildren = 0;
}
if (n->attr) {
Tcl_HashSearch hs;
Tcl_HashEntry* he;
for(he = Tcl_FirstHashEntry(n->attr, &hs);
he != NULL;
he = Tcl_NextHashEntry(&hs)) {
Tcl_DecrRefCount ((Tcl_Obj*) Tcl_GetHashValue(he));
}
Tcl_DeleteHashTable(n->attr);
ckfree ((char*) n->attr);
n->attr = NULL;
}
ckfree ((char*) n);
}
示例7: TclpThreadDataKeyGet
void *
TclpThreadDataKeyGet(
Tcl_ThreadDataKey *keyPtr) /* Identifier for the data chunk, really
* (int**) */
{
Tcl_HashTable *hashTablePtr =
ThreadStorageGetHashTable(Tcl_GetCurrentThread());
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(hashTablePtr, (char *) keyPtr);
if (hPtr == NULL) {
return NULL;
}
return Tcl_GetHashValue(hPtr);
}
示例8: FuzzyVoteAccumSet
static void
FuzzyVoteAccumSet (Tcl_HashTable *accum, List<AccumElement> *bins,
int x, int y, int scale, int val)
{
int loc[3];
loc[0] = x; loc[1] = y; loc[2] = scale;
Tcl_HashEntry *entry = Tcl_FindHashEntry(accum,(char*)loc);
AccumElement *elem = (AccumElement*)(Tcl_GetHashValue(entry));
bins[elem->value].unchain(elem);
if (val>255)
val = 255;
bins[val].addLast(elem);
elem->value = val;
}
示例9: Ttk_DeleteTagTable
void Ttk_DeleteTagTable(Ttk_TagTable tagTable)
{
Tcl_HashSearch search;
Tcl_HashEntry *entryPtr;
entryPtr = Tcl_FirstHashEntry(&tagTable->tags, &search);
while (entryPtr != NULL) {
DeleteTag(tagTable, Tcl_GetHashValue(entryPtr));
entryPtr = Tcl_NextHashEntry(&search);
}
Tcl_DeleteHashTable(&tagTable->tags);
ckfree((void*)tagTable);
}
示例10: FirstSigMapEntry
ClientData
FirstSigMapEntry (
SignalMap *sigmapPtr,
SignalMapSearch *searchPtr)
{
Tcl_HashEntry *entryPtr;
entryPtr = Tcl_FirstHashEntry(sigmapPtr, searchPtr);
if (entryPtr != NULL) {
return Tcl_GetHashValue(entryPtr);
} else {
return NULL;
}
}
示例11: FuzzyVoteAccumZero
static void
FuzzyVoteAccumZero (Tcl_HashTable *accum, List<AccumElement> *bins,
int x, int y, int scale)
{
int loc[3];
loc[0] = x; loc[1] = y; loc[2] = scale;
Tcl_HashEntry *entry = Tcl_FindHashEntry(accum,(char*)loc);
if (entry == NULL)
return;
AccumElement *elem = (AccumElement*)(Tcl_GetHashValue(entry));
bins[elem->value].unchain(elem);
bins[0].addLast(elem);
elem->value = 0;
}
示例12: TkDeleteAllImages
void
TkDeleteAllImages(
TkMainInfo *mainPtr) /* Structure describing application that is
* going away. */
{
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
for (hPtr = Tcl_FirstHashEntry(&mainPtr->imageTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
EventuallyDeleteImage(Tcl_GetHashValue(hPtr), 1);
}
Tcl_DeleteHashTable(&mainPtr->imageTable);
}
示例13: Tcl_FindHashEntry
Tcl_DBusBus *DBus_GetConnection(Tcl_Interp *interp, Tcl_Obj *const name)
{
Tcl_HashEntry *entry;
Tcl_DBusBus *dbus;
entry = Tcl_FindHashEntry(&bus, (char *) name);
if (entry == NULL) return NULL;
dbus = (Tcl_DBusBus *) Tcl_GetHashValue(entry);
entry = Tcl_FindHashEntry(dbus->snoop, (char *) interp);
if (entry != NULL)
return dbus;
else
return NULL;
}
示例14: HTUTree_replaceNode_tcl
int HTUTree_replaceNode_tcl(ClientData clientData, Tcl_Interp *interp,
int argc, char **argv) {
if (argc == 5) {
char *tree_key = argv[1];
const char *realm = argv[2];
const char *path = argv[3];
char *void_key = argv[4];
if ( tree_key && realm && path) {
Tcl_HashEntry *tree_entry = Tcl_FindHashEntry(&HTableUTree, tree_key);
Tcl_HashEntry *void_entry = Tcl_FindHashEntry(&HTableVoid, void_key);
if ( tree_entry && void_entry ) {
HTUTree *tree = Tcl_GetHashValue(tree_entry);
void *context = Tcl_GetHashValue(void_entry);
BOOL result = HTUTree_replaceNode(tree, realm, path, context);
Tcl_AppendResult(interp, result ? "YES" : "NO", NULL);
return TCL_OK;
}
}
Tcl_AppendResult(interp, bad_vars, NULL);
return TCL_ERROR;
}
Tcl_AppendResult(interp, bad_vars, NULL);
return TCL_ERROR;
}
示例15: Nsf_PointerTypeLookup
void *
Nsf_PointerTypeLookup(const char* typeName) {
const Tcl_HashEntry *hPtr;
nonnull_assert(typeName != NULL);
NsfMutexLock(&pointerMutex);
hPtr = Tcl_CreateHashEntry(pointerHashTablePtr, typeName, NULL);
NsfMutexUnlock(&pointerMutex);
if (hPtr != NULL) {
return Tcl_GetHashValue(hPtr);
}
return NULL;
}