chage PL_ObjectForKey to take a plitem directly and typecheck the item

This commit is contained in:
Bill Currie 2002-12-18 16:09:47 +00:00
parent f03cc28b7d
commit 637de7b687
2 changed files with 9 additions and 3 deletions

View file

@ -81,7 +81,7 @@ typedef struct plbinary_s plbinary_t;
struct hashtab_s;
plitem_t *PL_GetPropertyList (const char *);
plitem_t *PL_ObjectForKey (struct hashtab_s *, const char *);
plitem_t *PL_ObjectForKey (plitem_t *, const char *);
void PL_FreeItem (struct plitem_s *);
typedef struct pldata_s { // Unparsed property list string

View file

@ -93,9 +93,15 @@ dict_free (void *i, void *unused)
}
plitem_t *
PL_ObjectForKey (hashtab_t *table, const char *key)
PL_ObjectForKey (plitem_t *item, const char *key)
{
dictkey_t *k = (dictkey_t *) Hash_Find (table, key);
hashtab_t *table = (hashtab_t *) item->data;
dictkey_t *k;
if (item->type != QFDictionary)
return NULL;
k = (dictkey_t *) Hash_Find (table, key);
return k ? k->value : NULL;
}