From: sandeep Date: Fri, 9 Nov 2001 20:41:50 +0000 (+0000) Subject: Added function hTabMaxKey returns Max key size in a hashTable X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=35b2268330964fce85f91c0f4caade091d0915f6;p=fw%2Fsdcc Added function hTabMaxKey returns Max key size in a hashTable git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1539 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCChasht.c b/src/SDCChasht.c index cc467afd..d7551c04 100644 --- a/src/SDCChasht.c +++ b/src/SDCChasht.c @@ -513,6 +513,14 @@ hTabItemWithKey (hTab * htab, int key) return htip->item; } +/*-----------------------------------------------------------------*/ +/* hTabMaxKey - return the maxKey of item in the hashTable */ +/*-----------------------------------------------------------------*/ +int hTabMaxKey (hTab *htab) +{ + return (htab ? htab->maxKey : 0); +} + /*-----------------------------------------------------------------*/ /*hTabAddItemIfNotP - adds an item with nothing found with key */ /*-----------------------------------------------------------------*/ diff --git a/src/SDCChasht.h b/src/SDCChasht.h index 4afcabec..89013cc5 100644 --- a/src/SDCChasht.h +++ b/src/SDCChasht.h @@ -106,6 +106,7 @@ void hTabDeleteAll (hTab *); void *hTabFirstItemWK (hTab * htab, int wk); void *hTabNextItemWK (hTab * htab); void hTabClearAll (hTab * htab); +int hTabMaxKey (hTab *htab); /** Find the first item that either is 'item' or which according to 'compareFunc' is the same as item.