Lines Matching refs:pH

26012 SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
26015 assert( pH!=0 );
26016 elem = pH->first;
26017 pH->first = 0;
26018 sqlite3_free(pH->ht);
26019 pH->ht = 0;
26020 pH->htsize = 0;
26026 pH->count = 0;
26046 Hash *pH, /* The complete hash table */
26062 else { pH->first = pNew; }
26065 pNew->next = pH->first;
26066 if( pH->first ){ pH->first->prev = pNew; }
26068 pH->first = pNew;
26079 static int rehash(Hash *pH, unsigned int new_size){
26087 if( new_size==pH->htsize ) return 0;
26103 sqlite3_free(pH->ht);
26104 pH->ht = new_ht;
26105 pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht);
26107 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
26110 insertElement(pH, &new_ht[h], elem);
26120 const Hash *pH, /* The pH to be searched */
26128 if( pH->ht ){
26130 h = strHash(pKey) % pH->htsize;
26131 pEntry = &pH->ht[h];
26136 elem = pH->first;
26137 count = pH->count;
26154 Hash *pH, /* The pH containing "elem" */
26162 pH->first = elem->next;
26167 if( pH->ht ){
26168 pEntry = &pH->ht[h];
26176 pH->count--;
26177 if( pH->count==0 ){
26178 assert( pH->first==0 );
26179 assert( pH->count==0 );
26180 sqlite3HashClear(pH);
26188 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){
26192 assert( pH!=0 );
26194 elem = findElementWithHash(pH, pKey, &h);
26212 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
26217 assert( pH!=0 );
26219 elem = findElementWithHash(pH,pKey,&h);
26223 removeElementGivenHash(pH,elem,h);
26235 pH->count++;
26236 if( pH->count>=10 && pH->count > 2*pH->htsize ){
26237 if( rehash(pH, pH->count*2) ){
26238 assert( pH->htsize>0 );
26239 h = strHash(pKey) % pH->htsize;
26242 insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem);
39742 static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
39745 proc = osGetProcAddressA((HANDLE)pH, zSym);
39747 (void*)pH, zSym, (void*)proc));
143719 SQLITE_PRIVATE void sqlite3Fts3HashClear(Fts3Hash *pH){
143722 assert( pH!=0 );
143723 elem = pH->first;
143724 pH->first = 0;
143725 fts3HashFree(pH->ht);
143726 pH->ht = 0;
143727 pH->htsize = 0;
143730 if( pH->copyKey && elem->pKey ){
143736 pH->count = 0;
143812 Fts3Hash *pH, /* The complete hash table */
143822 else { pH->first = pNew; }
143825 pNew->next = pH->first;
143826 if( pH->first ){ pH->first->prev = pNew; }
143828 pH->first = pNew;
143841 static int fts3Rehash(Fts3Hash *pH, int new_size){
143849 fts3HashFree(pH->ht);
143850 pH->ht = new_ht;
143851 pH->htsize = new_size;
143852 xHash = ftsHashFunction(pH->keyClass);
143853 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
143856 fts3HashInsertElement(pH, &new_ht[h], elem);
143866 const Fts3Hash *pH, /* The pH to be searched */
143875 if( pH->ht ){
143876 struct _fts3ht *pEntry = &pH->ht[h];
143879 xCompare = ftsCompareFunction(pH->keyClass);
143894 Fts3Hash *pH, /* The pH containing "elem" */
143902 pH->first = elem->next;
143907 pEntry = &pH->ht[h];
143915 if( pH->copyKey && elem->pKey ){
143919 pH->count--;
143920 if( pH->count<=0 ){
143921 assert( pH->first==0 );
143922 assert( pH->count==0 );
143923 fts3HashClear(pH);
143928 const Fts3Hash *pH,
143935 if( pH==0 || pH->ht==0 ) return 0;
143936 xHash = ftsHashFunction(pH->keyClass);
143939 assert( (pH->htsize & (pH->htsize-1))==0 );
143940 return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1));
143948 SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){
143951 pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey);
143971 Fts3Hash *pH, /* The hash table to insert into */
143982 assert( pH!=0 );
143983 xHash = ftsHashFunction(pH->keyClass);
143986 assert( (pH->htsize & (pH->htsize-1))==0 );
143987 h = hraw & (pH->htsize-1);
143988 elem = fts3FindElementByHash(pH,pKey,nKey,h);
143992 fts3RemoveElementByHash(pH,elem,h);
143999 if( (pH->htsize==0 && fts3Rehash(pH,8))
144000 || (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2))
144002 pH->count = 0;
144005 assert( pH->htsize>0 );
144008 if( pH->copyKey && pKey!=0 ){
144019 pH->count++;
144020 assert( pH->htsize>0 );
144021 assert( (pH->htsize & (pH->htsize-1))==0 );
144022 h = hraw & (pH->htsize-1);
144023 fts3HashInsertElement(pH, &pH->ht[h], new_elem);