src/cx/map.h

changeset 563
69a83fad8a35
parent 558
9b767b07602c
child 564
5d8ad7a0ff71
     1.1 --- a/src/cx/map.h	Fri May 27 17:40:27 2022 +0200
     1.2 +++ b/src/cx/map.h	Wed Jun 08 21:33:31 2022 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  #include "common.h"
     1.5  #include "allocator.h"
     1.6  #include "iterator.h"
     1.7 +#include "hash_key.h"
     1.8  
     1.9  #ifdef    __cplusplus
    1.10  extern "C" {
    1.11 @@ -87,7 +88,7 @@
    1.12      __attribute__((__nonnull__))
    1.13      int (*put)(
    1.14              CxMap *map,
    1.15 -            CxDataPtr key,
    1.16 +            CxHashKey key,
    1.17              void *value
    1.18      );
    1.19  
    1.20 @@ -97,7 +98,7 @@
    1.21      __attribute__((__nonnull__, __warn_unused_result__))
    1.22      void *(*get)(
    1.23              CxMap const *map,
    1.24 -            CxDataPtr key
    1.25 +            CxHashKey key
    1.26      );
    1.27  
    1.28      /**
    1.29 @@ -106,7 +107,7 @@
    1.30      __attribute__((__nonnull__, __warn_unused_result__))
    1.31      void *(*remove)(
    1.32              CxMap *map,
    1.33 -            CxDataPtr key
    1.34 +            CxHashKey key
    1.35      );
    1.36  
    1.37      /**
    1.38 @@ -135,7 +136,7 @@
    1.39      /**
    1.40       * A pointer to the key.
    1.41       */
    1.42 -    CxDataPtr const *key;
    1.43 +    CxHashKey const *key;
    1.44      /**
    1.45       * A pointer to the value.
    1.46       */
    1.47 @@ -176,7 +177,7 @@
    1.48  __attribute__((__nonnull__))
    1.49  static inline int cxMapPut(
    1.50          CxMap *map,
    1.51 -        CxDataPtr key,
    1.52 +        CxHashKey key,
    1.53          void *value
    1.54  ) {
    1.55      return map->cl->put(map, key, value);
    1.56 @@ -192,7 +193,7 @@
    1.57  __attribute__((__nonnull__, __warn_unused_result__))
    1.58  static inline void *cxMapGet(
    1.59          CxMap const *map,
    1.60 -        CxDataPtr key
    1.61 +        CxHashKey key
    1.62  ) {
    1.63      return map->cl->get(map, key);
    1.64  }
    1.65 @@ -207,7 +208,7 @@
    1.66  __attribute__((__nonnull__, __warn_unused_result__))
    1.67  static inline void *cxMapRemove(
    1.68          CxMap *map,
    1.69 -        CxDataPtr key
    1.70 +        CxHashKey key
    1.71  ) {
    1.72      return map->cl->remove(map, key);
    1.73  }
    1.74 @@ -262,15 +263,6 @@
    1.75      return map->cl->iterator(map);
    1.76  }
    1.77  
    1.78 -/**
    1.79 - * Convenience function to make a key from a NULL-terminated string.
    1.80 - *
    1.81 - * @param str the NULL-terminated string
    1.82 - * @return the string wrapped to be used as a map key
    1.83 - */
    1.84 -__attribute__((__nonnull__, __warn_unused_result__))
    1.85 -CxDataPtr cxMapKeyStr(char const *str);
    1.86 -
    1.87  #ifdef    __cplusplus
    1.88  }
    1.89  #endif

mercurial