rem: if (!hostCache) hostCache = WMCreateHashTable(WMStringPointerHashCallbacks);  hPtr = WMHashGet(hostCache, name); if (hPtr) { WMRetainHost(hPtr); return hPtr;
add: if (hostCacheEnabled) { if ((hPtr = getHostFromCache(name)) != NULL) { WMRetainHost(hPtr); return hPtr; }
context: WMGetHostWithName(char* name){    struct hostent *host;    struct in_addr in;    WMHost *hPtr;    int i;    if (name == NULL) {        wwarning("NULL host name in 'WMGetHostWithName()'");        return NULL;    }    if (!hostCache)        hostCache = WMCreateHashTable(WMStringPointerHashCallbacks);    hPtr = WMHashGet(hostCache, name);    if (hPtr) {        WMRetainHost(hPtr);        return hPtr;    }    host = gethostbyname(name);    if (host == NULL) {        wwarning("Invalid host name/address '%s'", name);        return NULL;    }    hPtr = (WMHost*)wmalloc(sizeof(WMHost));    memset(hPtr, 0, sizeof(WMHost));    hPtr->names = WMCreateBag(1);    hPtr->addresses = WMCreateBag(1);    WMPutInBag(hPtr->names, wstrdup(host->h_name));    for (i=0; host->h_aliases[i]!=NULL; i++) {        WMPutInBag(hPtr->names, wstrdup(host->h_aliases[i]));    }    hPtr->nameCount = WMGetBagItemCount(hPtr->names);    for (i=0; host->h_addr_list[i]!=NULL; i++) {        memcpy((void*)&in.s_addr, (const void*)host->h_addr_list[i],               host->h_length);        WMPutInBag(hPtr->addresses, wstrdup(inet_ntoa(in)));    }    hPtr->addressCount = WMGetBagItemCount(hPtr->addresses);    hPtr->refCount = 1;    if (hostCacheEnabled) {        hPtr->name = wstrdup(name);        wassertr(WMHashInsert(hostCache, hPtr->name, hPtr)==NULL);        hPtr->refCount++;    }    return hPtr;}