From 35b2268330964fce85f91c0f4caade091d0915f6 Mon Sep 17 00:00:00 2001 From: sandeep Date: Fri, 9 Nov 2001 20:41:50 +0000 Subject: [PATCH] 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 --- src/SDCChasht.c | 8 ++++++++ src/SDCChasht.h | 1 + 2 files changed, 9 insertions(+) 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. -- 2.47.2