X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fhmapx.h;h=345836192a2195e682343f3eb1b3c5127743f35d;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=32a4452fe2417d58157ca8da27e079f2052fcc88;hpb=c1e75ee809efd2f4bfd9ebcc1c2b0689c1da0e4c;p=pspp-builds.git diff --git a/src/libpspp/hmapx.h b/src/libpspp/hmapx.h index 32a4452f..34583619 100644 --- a/src/libpspp/hmapx.h +++ b/src/libpspp/hmapx.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -115,7 +115,7 @@ } */ -#include +#include "libpspp/hmap.h" #include /* Hash table node. */ @@ -143,6 +143,7 @@ struct hmapx /* Creation and destruction. */ static inline void hmapx_init (struct hmapx *); static inline void hmapx_swap (struct hmapx *, struct hmapx *); +void hmapx_clear (struct hmapx *); void hmapx_destroy (struct hmapx *); /* Storage management. */ @@ -165,6 +166,7 @@ static inline struct hmapx_node *hmapx_next (const struct hmapx *, const struct hmapx_node *); /* Counting. */ +static inline bool hmapx_is_empty (const struct hmapx *); static inline size_t hmapx_count (const struct hmapx *); static inline size_t hmapx_capacity (const struct hmapx *); @@ -404,6 +406,14 @@ hmapx_next (const struct hmapx *map, const struct hmapx_node *node) return HMAP_NEXT (node, struct hmapx_node, hmap_node, &map->hmap); } +/* Returns true if MAP currently contains no data items, false + otherwise. */ +static inline bool +hmapx_is_empty (const struct hmapx *map) +{ + return hmap_is_empty (&map->hmap); +} + /* Returns the number of data items currently in MAP. */ static inline size_t hmapx_count (const struct hmapx *map)