void LibOMF::addSymbol(ObjModule *om, const char *name, int pickAny) { #if LOG printf("LibOMF::addSymbol(%s, %s, %d)\n", om->name, name, pickAny); #endif StringValue *s = tab.insert(name, strlen(name)); if (!s) { // already in table if (!pickAny) { s = tab.lookup(name, strlen(name)); assert(s); ObjSymbol *os = (ObjSymbol *)s->ptrvalue; error("multiple definition of %s: %s and %s: %s", om->name, name, os->om->name, os->name); } } else { ObjSymbol *os = new ObjSymbol(); os->name = strdup(name); os->om = om; s->ptrvalue = (void *)os; objsymbols.push(os); } }
void *trait_search_fp(void *arg, const char *seed) { //printf("trait_search_fp('%s')\n", seed); size_t len = strlen(seed); if (!len) return NULL; StringValue *sv = traitsStringTable.lookup(seed, len); return sv ? (void*)sv->ptrvalue : NULL; }