DLLEXPORT(const char*) lookupStr(const char *s) { StrItem *t; unsigned int h = hashStr(s); if ((t = strTbl[h]) != 0) { do { if (qstricmp(t->s,s) == 0) { t->refCnt++; return t->s; } t = t->next; } while (t); } s = dupStr(s,0); strTbl[h] = newStrItem(s,strTbl[h]); return s; }
const char* lookupStr(const char *s) { char *newS; StrItem *t; unsigned int h = hashStr(s); if ((t = strTbl[h]) != 0) { do { if (strcasecmp(t->s,s) == 0) { t->refCnt++; return t->s; } t = t->next; } while (t); } newS = dupStr(s,0); strTbl[h] = newStrItem(newS,strTbl[h]); return newS; }