Lines Matching refs:table

72 void rtl_hashtable_destroy(RTL_HASHTABLE* table)  in rtl_hashtable_destroy()  argument
76 if (!table) in rtl_hashtable_destroy()
79 size = table->Size; in rtl_hashtable_destroy()
83 if (table->Table[size - 1]) in rtl_hashtable_destroy()
84 rtl_hashentry_destroy(table->Table[size - 1]); in rtl_hashtable_destroy()
88 rtl_freeMemory(table->Table); in rtl_hashtable_destroy()
89 rtl_freeMemory(table); in rtl_hashtable_destroy()
92 void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) in rtl_hashtable_init() argument
96 if (*table) in rtl_hashtable_init()
97 rtl_hashtable_destroy(*table); in rtl_hashtable_init()
99 *table = (RTL_HASHTABLE*)rtl_allocateMemory( sizeof(RTL_HASHTABLE) ); in rtl_hashtable_init()
101 (*table)->iSize = sizeIndex; in rtl_hashtable_init()
102 (*table)->Size = nSize; in rtl_hashtable_init()
103 (*table)->Elements = 0; in rtl_hashtable_init()
104 … (*table)->Table = (RTL_HASHENTRY**)rtl_allocateMemory( (*table)->Size * sizeof(RTL_HASHENTRY*) ); in rtl_hashtable_init()
108 (*table)->Table[nSize - 1] = NULL; in rtl_hashtable_init()
113 sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key) in rtl_hashfunc() argument
115 return ( (sal_uInt32) key % table->Size); in rtl_hashfunc()
118 sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table);
120 rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value) in rtl_hashtable_add() argument
124 if (!(*table)) in rtl_hashtable_add()
127 if ((*table)->Elements > ((*table)->Size / 2)) in rtl_hashtable_add()
128 rtl_hashtable_grow(table); in rtl_hashtable_add()
130 key = rtl_hashfunc(*table, value->HashCode); in rtl_hashtable_add()
132 if (!(*table)->Table[key]) in rtl_hashtable_add()
137 (*table)->Table[key] = newEntry; in rtl_hashtable_add()
138 (*table)->Elements++; in rtl_hashtable_add()
142 RTL_HASHENTRY *pEntry = (*table)->Table[key]; in rtl_hashtable_add()
160 (*table)->Elements++; in rtl_hashtable_add()
165 sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table) in rtl_hashtable_grow() argument
170 rtl_hashtable_init(&pNewTable, (sal_Int8)((*table)->iSize + 1)); in rtl_hashtable_grow()
172 while (i < (*table)->Size) in rtl_hashtable_grow()
174 if ((*table)->Table[i]) in rtl_hashtable_grow()
177 RTL_HASHENTRY *pEntry = (*table)->Table[i]; in rtl_hashtable_grow()
194 rtl_freeMemory((*table)->Table); in rtl_hashtable_grow()
195 rtl_freeMemory((*table)); in rtl_hashtable_grow()
196 (*table) = pNewTable; in rtl_hashtable_grow()
201 sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** … in rtl_hashtable_find() argument
203 if (!table) in rtl_hashtable_find()
206 if (table->Table[key]) in rtl_hashtable_find()
208 RTL_HASHENTRY *pEntry = table->Table[key]; in rtl_hashtable_find()