diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-15 21:40:26 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-15 21:40:26 +0200 |
commit | 42015f0462e8f1b2292a48455ce740a627c14025 (patch) | |
tree | 78352fb16802115d5f16470e6aea1419c563f090 /src | |
parent | e60288d595ec405c5d416e5da54b516e65f8a8c5 (diff) | |
download | eclat-42015f0462e8f1b2292a48455ce740a627c14025.tar.gz eclat-42015f0462e8f1b2292a48455ce740a627c14025.tar.bz2 |
Implement map lookup functions in forlan.
* lib/forlan.c: New functions "has_map" and "lookup".
* lib/map.c (eclat_map_open): Don't issue error message
if failed to open the map. Leave that to the caller.
* src/util.c (translate_ids)
(translate_resource_ids): Issue an error message if
eclat_map_open fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -42,10 +42,11 @@ translate_ids(int argc, char **argv, const char *mapname) map = eclat_map_lookup(realname); if (!map) die(EX_UNAVAILABLE, "no such map: %s", realname); - free(realname); if (eclat_map_open(map) != eclat_map_ok) - exit(EX_UNAVAILABLE); + die(EX_UNAVAILABLE, "failed to open map %s", realname); + + free(realname); for (i = 0; i < argc; i++) { if (!strchr(argv[i], '=')) { @@ -101,7 +102,8 @@ translate_resource_ids(int argc, char **argv) die(EX_UNAVAILABLE, "no such map: %s", ws.ws_wordv[j]); if (eclat_map_open(map) != eclat_map_ok) - exit(EX_UNAVAILABLE); + die(EX_UNAVAILABLE, + "failed to open map %s", ws.ws_wordv[j]); rc = eclat_map_get(map, MAP_DIR, p, &val); if (rc != eclat_map_ok) { die(EX_UNAVAILABLE, |