当前位置: 首页>>代码示例>>C++>>正文


C++ Tcl_DeleteHashEntry函数代码示例

本文整理汇总了C++中Tcl_DeleteHashEntry函数的典型用法代码示例。如果您正苦于以下问题:C++ Tcl_DeleteHashEntry函数的具体用法?C++ Tcl_DeleteHashEntry怎么用?C++ Tcl_DeleteHashEntry使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Tcl_DeleteHashEntry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FreeCursor

static void
FreeCursor(
    TkCursor *cursorPtr)	/* Cursor to be released. */
{
    TkCursor *prevPtr;

    cursorPtr->resourceRefCount--;
    if (cursorPtr->resourceRefCount > 0) {
	return;
    }

    Tcl_DeleteHashEntry(cursorPtr->idHashPtr);
    prevPtr = (TkCursor *) Tcl_GetHashValue(cursorPtr->hashPtr);
    if (prevPtr == cursorPtr) {
	if (cursorPtr->nextPtr == NULL) {
	    Tcl_DeleteHashEntry(cursorPtr->hashPtr);
	} else {
	    Tcl_SetHashValue(cursorPtr->hashPtr, cursorPtr->nextPtr);
	}
    } else {
	while (prevPtr->nextPtr != cursorPtr) {
	    prevPtr = prevPtr->nextPtr;
	}
	prevPtr->nextPtr = cursorPtr->nextPtr;
    }
    TkpFreeCursor(cursorPtr);
    if (cursorPtr->objRefCount == 0) {
	ckfree((char *) cursorPtr);
    }
}
开发者ID:AbaqusPowerUsers,项目名称:AbaqusPythonScripts,代码行数:30,代码来源:tkCursor.c

示例2: TkGCCleanup

void
TkGCCleanup(
    TkDisplay *dispPtr)		/* display to clean up resources in */
{
    Tcl_HashEntry *entryPtr;
    Tcl_HashSearch search;
    TkGC *gcPtr;

    for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search);
	    entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
	gcPtr = Tcl_GetHashValue(entryPtr);

	/*
	 * This call is not needed, as it is only used on Unix to restore the
	 * Id to the stack pool, and we don't want to use them anymore.
	 *   Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
	 */

	XFreeGC(gcPtr->display, gcPtr->gc);
	Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
	Tcl_DeleteHashEntry(entryPtr);
	ckfree(gcPtr);
    }
    Tcl_DeleteHashTable(&dispPtr->gcValueTable);
    Tcl_DeleteHashTable(&dispPtr->gcIdTable);
    dispPtr->gcInit = -1;
}
开发者ID:AlexShiLucky,项目名称:bitkeeper,代码行数:27,代码来源:tkGC.c

示例3: DBus_SignalCleanup

int DBus_SignalCleanup(Tcl_Interp *interp, Tcl_HashTable *members)
{
   Tcl_HashTable *interps;
   Tcl_HashEntry *memberPtr, *interpPtr;
   Tcl_HashSearch search;
   Tcl_DBusSignalData *signal;

   for (memberPtr = Tcl_FirstHashEntry(members, &search);
	memberPtr != NULL; memberPtr = Tcl_NextHashEntry(&search)) {
      interps = Tcl_GetHashValue(memberPtr);
      interpPtr = Tcl_FindHashEntry(interps, (char *) interp);
      if (interpPtr != NULL) {
	 signal = Tcl_GetHashValue(interpPtr);
	 Tcl_DecrRefCount(signal->script);
	 ckfree((char *) signal);
	 Tcl_DeleteHashEntry(interpPtr);
	 if (Tcl_CheckHashEmpty(interps)) {
	    Tcl_DeleteHashTable(interps);
	    ckfree((char *) interps);
	    Tcl_DeleteHashEntry(memberPtr);
	 }
      }
   }
   return Tcl_CheckHashEmpty(members);
}
开发者ID:recri,项目名称:keyer,代码行数:25,代码来源:dbusMain.c

示例4: FreeBitmap

static void
FreeBitmap(
    TkBitmap *bitmapPtr)	/* Bitmap to be released. */
{
    TkBitmap *prevPtr;

    bitmapPtr->resourceRefCount--;
    if (bitmapPtr->resourceRefCount > 0) {
	return;
    }

    Tk_FreePixmap(bitmapPtr->display, bitmapPtr->bitmap);
    Tcl_DeleteHashEntry(bitmapPtr->idHashPtr);
    prevPtr = Tcl_GetHashValue(bitmapPtr->nameHashPtr);
    if (prevPtr == bitmapPtr) {
	if (bitmapPtr->nextPtr == NULL) {
	    Tcl_DeleteHashEntry(bitmapPtr->nameHashPtr);
	} else {
	    Tcl_SetHashValue(bitmapPtr->nameHashPtr, bitmapPtr->nextPtr);
	}
    } else {
	while (prevPtr->nextPtr != bitmapPtr) {
	    prevPtr = prevPtr->nextPtr;
	}
	prevPtr->nextPtr = bitmapPtr->nextPtr;
    }
    if (bitmapPtr->objRefCount == 0) {
	ckfree(bitmapPtr);
    }
}
开发者ID:afmayer,项目名称:tcl-tk,代码行数:30,代码来源:tkBitmap.c

示例5: DeleteImage

static void
DeleteImage(
    ImageMaster *masterPtr)	/* Pointer to main data structure for image. */
{
    Image *imagePtr;
    Tk_ImageType *typePtr;

    typePtr = masterPtr->typePtr;
    masterPtr->typePtr = NULL;
    if (typePtr != NULL) {
	for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
		imagePtr = imagePtr->nextPtr) {
	    typePtr->freeProc(imagePtr->instanceData, imagePtr->display);
	    imagePtr->changeProc(imagePtr->widgetClientData, 0, 0,
		    masterPtr->width, masterPtr->height, masterPtr->width,
		    masterPtr->height);
	}
	typePtr->deleteProc(masterPtr->masterData);
    }
    if (masterPtr->instancePtr == NULL) {
	if (masterPtr->hPtr != NULL) {
	    Tcl_DeleteHashEntry(masterPtr->hPtr);
	}
	Tcl_Release(masterPtr->winPtr);
	ckfree(masterPtr);
    } else {
	masterPtr->deleted = 1;
    }
}
开发者ID:tcltk,项目名称:tk,代码行数:29,代码来源:tkImage.c

示例6: XOTclProfilePrintTable

void
XOTclProfilePrintTable(Tcl_HashTable* table) {
  Tcl_HashEntry* topValueHPtr;
  long int* topValue;

  do {
    Tcl_HashSearch hSrch;
    Tcl_HashEntry* hPtr = table ?
      Tcl_FirstHashEntry(table, &hSrch) : 0;
    char* topKey = 0;

    topValueHPtr = 0;
    topValue = 0;

    for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) {
      long int *val = (long int*) Tcl_GetHashValue(hPtr);
      if (val && (!topValue || (topValue && *val >= *topValue))) {
	topValue = val;
	topValueHPtr = hPtr;
	topKey =  Tcl_GetHashKey(table, hPtr);
      }
    }

    if (topValueHPtr) {
      fprintf(stderr, "  %15ld   %s\n", *topValue, topKey);
      ckfree((char*) topValue);
      Tcl_DeleteHashEntry(topValueHPtr);
    }
  } while (topValueHPtr);
}
开发者ID:aosm,项目名称:tcl,代码行数:30,代码来源:xotclProfile.c

示例7: bonjour_register_cleanup

////////////////////////////////////////////////////
// cleanup any leftover registration
////////////////////////////////////////////////////
static int bonjour_register_cleanup(
   ClientData clientData
) {
   Tcl_HashTable *registerRegistrations = 
      (Tcl_HashTable *)clientData;
   Tcl_HashEntry *hashEntry = NULL;
   Tcl_HashSearch searchToken;
   active_registration *activeRegister = NULL;

   // run through the remaining entries in the hash table
   for(hashEntry = Tcl_FirstHashEntry(registerRegistrations,
                                      &searchToken);
       hashEntry != NULL;
       hashEntry = Tcl_NextHashEntry(&searchToken)) {

      activeRegister = (active_registration *)Tcl_GetHashValue(hashEntry);

      // deallocate the service reference
      DNSServiceRefDeallocate(activeRegister->sdRef);

      // clean up the memory used by activeRegister
      ckfree(activeRegister->regtype);
      ckfree((void *)activeRegister);

      // deallocate the hash entry
      Tcl_DeleteHashEntry(hashEntry);
   }

   Tcl_DeleteHashTable(registerRegistrations);

   return(TCL_OK);
}
开发者ID:dongola7,项目名称:tcl_bonjour,代码行数:35,代码来源:register.c

示例8: tcl_delete

static AP_Result tcl_delete(AP_World *w, AP_Obj interp_name)
{
	Tcl_HashEntry *entry;
	Tcl_Interp *interp;

	if (AP_ObjType(w, interp_name) != AP_ATOM) {
		return AP_SetStandardError(w, AP_TYPE_ERROR,
					AP_NewSymbolFromStr(w, "atom"), interp_name);
	}
	
	entry = Tcl_FindHashEntry(&tcl_interp_name_table, AP_GetAtomStr(w, interp_name));
	
	if (!entry) {
		return AP_SetStandardError(w, AP_DOMAIN_ERROR,
					AP_NewSymbolFromStr(w, "tcl_interpreter"), interp_name);
	}
	
	interp = Tcl_GetHashValue(entry);
	
	Tcl_DeleteInterp(interp);
	
	Tcl_DeleteHashEntry(entry);
	
	return AP_SUCCESS;
}
开发者ID:AppliedLogicSystems,项目名称:ALSProlog,代码行数:25,代码来源:tcl_interface.c

示例9: EmbWinStructureProc

static void
EmbWinStructureProc(
    ClientData clientData,	/* Pointer to record describing window item. */
    XEvent *eventPtr)		/* Describes what just happened. */
{
    TkTextEmbWindowClient *client = clientData;
    TkTextSegment *ewPtr = client->parent;
    TkTextIndex index;
    Tcl_HashEntry *hPtr;

    if (eventPtr->type != DestroyNotify) {
	return;
    }

    hPtr = Tcl_FindHashEntry(&ewPtr->body.ew.sharedTextPtr->windowTable,
	    Tk_PathName(client->tkwin));
    if (hPtr != NULL) {
	/*
	 * This may not exist if the entire widget is being deleted.
	 */

	Tcl_DeleteHashEntry(hPtr);
    }

    ewPtr->body.ew.tkwin = NULL;
    client->tkwin = NULL;
    index.tree = ewPtr->body.ew.sharedTextPtr->tree;
    index.linePtr = ewPtr->body.ew.linePtr;
    index.byteIndex = TkTextSegToOffset(ewPtr, ewPtr->body.ew.linePtr);
    TkTextChanged(ewPtr->body.ew.sharedTextPtr, NULL, &index, &index);
    TkTextInvalidateLineMetrics(ewPtr->body.ew.sharedTextPtr, NULL,
	    index.linePtr, 0, TK_TEXT_INVALIDATE_ONLY);
}
开发者ID:das,项目名称:tcltk,代码行数:33,代码来源:tkTextWind.c

示例10: Tk_FreeColor

void
Tk_FreeColor(
    XColor *colorPtr)		/* Color to be released. Must have been
				 * allocated by Tk_GetColor or
				 * Tk_GetColorByValue. */
{
    TkColor *tkColPtr = (TkColor *) colorPtr;
    Screen *screen = tkColPtr->screen;
    TkColor *prevPtr;

    /*
     * Do a quick sanity check to make sure this color was really allocated by
     * Tk_GetColor.
     */

    if (tkColPtr->magic != COLOR_MAGIC) {
        Tcl_Panic("Tk_FreeColor called with bogus color");
    }

    tkColPtr->resourceRefCount--;
    if (tkColPtr->resourceRefCount > 0) {
        return;
    }

    /*
     * This color is no longer being actively used, so free the color
     * resources associated with it and remove it from the hash table. No
     * longer any objects referencing it.
     */

    if (tkColPtr->gc != None) {
        XFreeGC(DisplayOfScreen(screen), tkColPtr->gc);
        tkColPtr->gc = None;
    }
    TkpFreeColor(tkColPtr);

    prevPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
    if (prevPtr == tkColPtr) {
        if (tkColPtr->nextPtr == NULL) {
            Tcl_DeleteHashEntry(tkColPtr->hashPtr);
        } else {
            Tcl_SetHashValue(tkColPtr->hashPtr, tkColPtr->nextPtr);
        }
    } else {
        while (prevPtr->nextPtr != tkColPtr) {
            prevPtr = prevPtr->nextPtr;
        }
        prevPtr->nextPtr = tkColPtr->nextPtr;
    }

    /*
     * Free the TkColor structure if there are no objects referencing it.
     * However, if there are objects referencing it then keep the structure
     * around; it will get freed when the last reference is cleared
     */

    if (tkColPtr->objRefCount == 0) {
        ckfree((char *) tkColPtr);
    }
}
开发者ID:arazaq,项目名称:ns2,代码行数:60,代码来源:tkColor.c

示例11: IvyAppCB

static void
IvyAppCB(IvyClientPtr	app,
	 void		*user_data, /* script a appeler */
	 IvyApplicationEvent event)
{
  static const char	*app_event_str[] = {
    "Connected", "Disconnected" };
  filter_struct	*filter = (filter_struct *) user_data;
  int		result, size, dummy;
  char		*script_to_call;
  Tcl_HashEntry	*entry;
  
  entry = Tcl_FindHashEntry(&app_table, IvyGetApplicationName(app));
  if (event == IvyApplicationConnected) {
    if (!entry) {
      entry = Tcl_CreateHashEntry(&app_table, IvyGetApplicationName(app), &dummy);
      Tcl_SetHashValue(entry, (ClientData) app);
    }
  }

  size = strlen(filter->script) + INTEGER_SPACE;
  if (entry) {
    size += strlen(IvyGetApplicationName(app)) + 3;
  }
  else {
    size += 4;
  }
  script_to_call = ckalloc(size);
  strcpy(script_to_call, filter->script);
  strcat(script_to_call, " ");
  if (entry) {
	strcat(script_to_call, " \"");
    strcat(script_to_call, IvyGetApplicationName(app));
	strcat(script_to_call, "\"");
  }
  else {
    strcat(script_to_call, "???");
  }
  strcat(script_to_call, " \"");
  strcat(script_to_call, app_event_str[event%2]);
  strcat(script_to_call, "\"");
  
  Tcl_Preserve(filter->interp);
  result = Tcl_GlobalEval(filter->interp, script_to_call);
  ckfree(script_to_call);

  if (result != TCL_OK) {
    Tcl_BackgroundError(filter->interp);
  }
  Tcl_Release(filter->interp);

  if (event == IvyApplicationDisconnected) {
    if (entry) {
      Tcl_DeleteHashEntry(entry);
    }
  }
}
开发者ID:ArchAssault-Project,项目名称:ivy-c,代码行数:57,代码来源:ivytcl.c

示例12: Tcl_FindHashEntry

void
ObjToRepMap::erase (Tcl_Obj *pObj)
{
    Tcl_HashEntry *pEntry = Tcl_FindHashEntry(
        &m_objMap, reinterpret_cast<char *>(pObj));
    if (pEntry != 0) {
        Tcl_DeleteHashEntry(pEntry);
    }
}
开发者ID:jbroll,项目名称:tcom,代码行数:9,代码来源:HandleSupport.cpp

示例13: SWIG_Tcl_Disown

SWIG_Tcl_Disown(void *ptr) {
  Tcl_HashEntry *entryPtr;
  if (!swigobjectTableinit) return 0;
  entryPtr = Tcl_FindHashEntry(&swigobjectTable, (char *) ptr);
  if (entryPtr) {
    Tcl_DeleteHashEntry(entryPtr);
    return 1;
  }
  return 0;
}
开发者ID:gzoppetti,项目名称:ExscitechVmd,代码行数:10,代码来源:psfcheck_wrap.C

示例14: Tfp_ArrayDelete

void                
Tfp_ArrayDelete( Tfp_ArrayType *arr, char *key )
{
    Tcl_HashEntry   *p;
    
    p = Tcl_FindHashEntry( arr->table, key );
    if (p == (Tcl_HashEntry *) NULL) {
        return;
    }    
    (*arr->cleanProc) ( Tcl_GetHashValue( p ) );
    Tcl_DeleteHashEntry( p );
}
开发者ID:aosm,项目名称:tcl,代码行数:12,代码来源:Tfp_Arrays.c

示例15: PkguaDeleteTokens

static void
PkguaDeleteTokens(
    Tcl_Interp *interp)
{
    Tcl_HashEntry *entryPtr =
	    Tcl_FindHashEntry(&interpTokenMap, (char *) interp);

    if (entryPtr) {
	Tcl_Free((char *) Tcl_GetHashValue(entryPtr));
	Tcl_DeleteHashEntry(entryPtr);
    }
}
开发者ID:AlexShiLucky,项目名称:bitkeeper,代码行数:12,代码来源:pkgua.c


注:本文中的Tcl_DeleteHashEntry函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。