From 51bf37c337fbd49b59d9b6039b1722818dde8491 Mon Sep 17 00:00:00 2001 From: graydon Date: Sat, 13 Aug 2005 01:36:41 +0000 Subject: [ChangeLog] 2005-08-12 Graydon Hoare * translate.cxx (c_tmpcounter::visit_array_in): Implement. (c_unparser::visit_array_in): Likewise. (mapvar::exists): New method. [runtime/ChangeLog] 2005-08-12 Graydon Hoare * map-values.c (_stp_map_entry_exists): New function. * map.h (_stp_map_entry_exists): Declare it. --- runtime/ChangeLog | 5 +++++ runtime/map-values.c | 9 +++++++++ runtime/map.h | 2 ++ 3 files changed, 16 insertions(+) (limited to 'runtime') diff --git a/runtime/ChangeLog b/runtime/ChangeLog index c0e2ac65..69864f19 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,8 @@ +2005-08-12 Graydon Hoare + + * map-values.c (_stp_map_entry_exists): New function. + * map.h (_stp_map_entry_exists): Declare it. + 2005-08-12 Frank Ch. Eigler * arith.c: New file to contain arithmetic helper functions. diff --git a/runtime/map-values.c b/runtime/map-values.c index f0df9563..32cfb59d 100644 --- a/runtime/map-values.c +++ b/runtime/map-values.c @@ -51,5 +51,14 @@ void _stp_map_add_int64 (MAP map, int64_t val) } #endif +unsigned _stp_map_entry_exists (MAP map) +{ + struct map_node *m; + if (map == NULL || map->create || map->key == NULL) + return 0; + return 1; +} + + #endif /* _MAP_VALUES_C_ */ diff --git a/runtime/map.h b/runtime/map.h index 2a31fa8e..857751d2 100644 --- a/runtime/map.h +++ b/runtime/map.h @@ -241,5 +241,7 @@ void _stp_list_add_string(MAP, String); void _stp_map_key_int64(MAP, int64_t); void _stp_map_set_int64(MAP, int64_t); int64_t _stp_map_get_int64(MAP); + +unsigned _stp_map_entry_exists(MAP); /** @endcond */ #endif /* _MAP_H_ */ -- cgit