示例#1
0
 /* Link pNew element into the hash table pH.  If pEntry!=0 then also
 ** insert pNew into the pEntry hash bucket.
 */
 static void insertElement(
     Hash pH,              /* The complete hash table */
     _ht pEntry,           /* The entry into which pNew is inserted */
     HashElem pNew         /* The element to be inserted */
     )
 {
     HashElem pHead;       /* First element already in pEntry */
       if ( pEntry != null )
       {
     pHead = pEntry.count != 0 ? pEntry.chain : null;
     pEntry.count++;
     pEntry.chain = pNew;
       }
       else
       {
     pHead = null;
       }
       if ( pHead != null )
       {
     pNew.next = pHead;
     pNew.prev = pHead.prev;
     if ( pHead.prev != null )
     {
       pHead.prev.next = pNew;
     }
     else
     {
       pH.first = pNew;
     }
     pHead.prev = pNew;
       }
       else
       {
     pNew.next = pH.first;
     if ( pH.first != null )
     {
       pH.first.prev = pNew;
     }
     pNew.prev = null;
     pH.first = pNew;
       }
 }
示例#2
0
 //#define sqliteHashData(E)   ((E).data)
 static object sqliteHashData( HashElem E )
 {
   return E.data;
 }
示例#3
0
 //#define sqliteHashNext(E)   ((E).next)
 static HashElem sqliteHashNext( HashElem E )
 {
   return E.next;
 }
示例#4
0
文件: Hash_h.cs 项目: VSecLab/asim0v
 //#define sqliteHashData(E)   ((E).data)
 static object sqliteHashData(HashElem E)
 {
     return(E.data);
 }
示例#5
0
文件: Hash_h.cs 项目: VSecLab/asim0v
 //#define sqliteHashNext(E)   ((E).next)
 static HashElem sqliteHashNext(HashElem E)
 {
     return(E.next);
 }