diff --git a/tools/qfcc/include/strpool.h b/tools/qfcc/include/strpool.h index 6cdc8eb83..fbb4bc049 100644 --- a/tools/qfcc/include/strpool.h +++ b/tools/qfcc/include/strpool.h @@ -42,6 +42,7 @@ strpool_t *strpool_new (void); strpool_t *strpool_build (const char *strings, int size); void strpool_delete (strpool_t *strpool); int strpool_addstr (strpool_t *strpool, const char *str); +int strpool_findstr (strpool_t *strpool, const char *str); /** Smart strdup. diff --git a/tools/qfcc/source/strpool.c b/tools/qfcc/source/strpool.c index 0f10f81ee..d3ab07a1c 100644 --- a/tools/qfcc/source/strpool.c +++ b/tools/qfcc/source/strpool.c @@ -121,6 +121,14 @@ strpool_addstr (strpool_t *strpool, const char *str) return s; } +int +strpool_findstr (strpool_t *strpool, const char *str) +{ + if (!str) + return 0; + return (intptr_t) Hash_Find (strpool->str_tab, str); +} + static const char * ss_get_key (const void *s, void *unused) {