From ccc6ddac22ab174e2d5ea0561643f2894b4bce41 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Fri, 9 Feb 2007 05:33:18 +0000 Subject: [PATCH] Allow removing key/value pairs from the master resource map git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2704 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/reslib.h | 2 ++ sc2/src/sc2code/libs/resource/mapres.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/sc2/src/sc2code/libs/reslib.h b/sc2/src/sc2code/libs/reslib.h index a33166e7f..23c28f99a 100644 --- a/sc2/src/sc2code/libs/reslib.h +++ b/sc2/src/sc2code/libs/reslib.h @@ -142,5 +142,7 @@ BOOLEAN res_IsBoolean (const char *key); BOOLEAN res_GetBoolean (const char *key); void res_PutBoolean (const char *key, BOOLEAN value); +BOOLEAN res_Remove (const char *key); + #endif /* _RESLIB_H */ diff --git a/sc2/src/sc2code/libs/resource/mapres.c b/sc2/src/sc2code/libs/resource/mapres.c index bf07e4b49..3c61389c1 100644 --- a/sc2/src/sc2code/libs/resource/mapres.c +++ b/sc2/src/sc2code/libs/resource/mapres.c @@ -42,6 +42,12 @@ res_ClearTables (void) } } +BOOLEAN +res_Remove (const char *key) +{ + return (Alist_RemoveString (map, key) != NULL); +} + /* Type conversion routines. */ static const char * bool2str (BOOLEAN b)