const char* strresGetString(const STR_RES* psRes, const char* ID) { const char * string; ASSERT(psRes != NULL, "Invalid string resource pointer"); string = treapFind(psRes->psIDTreap, ID); ASSERT(string, "Could not find string for id \"%s\"", ID); return string; }
/* Store a string */ bool strresStoreString(STR_RES *psRes, const char* pID, const char* pString) { ASSERT(psRes != NULL, "Invalid string res pointer"); // Make sure that this ID string hasn't been used before if (treapFind(psRes->psIDTreap, pID) != NULL) { debug(LOG_FATAL, "Duplicate string for id: \"%s\"", pID); abort(); return false; } return treapAdd(psRes->psIDTreap, pID, pString); }
const char* strresGetString(const STR_RES* psRes, const char* ID) { ASSERT(psRes != NULL, "Invalid string resource pointer"); return treapFind(psRes->psIDTreap, ID); }