1 /* Copyright (c) 2003-2004, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
12 * \brief Header for namemap.c
15 #include "lib/cc/compat_compiler.h"
20 typedef struct namemap_t namemap_t
;
22 /** Returned in place of an identifier when an error occurs. */
23 #define NAMEMAP_ERR UINT_MAX
25 void namemap_init(namemap_t
*map
);
26 const char *namemap_get_name(const namemap_t
*map
, unsigned id
);
27 const char *namemap_fmt_name(const namemap_t
*map
, unsigned id
);
28 unsigned namemap_get_id(const namemap_t
*map
,
30 unsigned namemap_get_or_create_id(namemap_t
*map
,
32 size_t namemap_get_size(const namemap_t
*map
);
33 void namemap_clear(namemap_t
*map
);
35 #endif /* !defined(TOR_NAMEMAP_H) */