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 */
11 * @brief Internal declarations for namemap structure.
14 #include "lib/cc/compat_compiler.h"
19 /** Longest allowed name that's allowed in a namemap_t. */
20 #define MAX_NAMEMAP_NAME_LEN 128
22 /** An entry inside a namemap_t. Maps a string to a numeric identifier. */
23 typedef struct mapped_name_t
{
24 HT_ENTRY(mapped_name_t
) node
;
26 char name
[FLEXIBLE_ARRAY_MEMBER
];
29 /** A structure that allocates small numeric identifiers for names and maps
30 * back and forth between them. */
32 HT_HEAD(namemap_ht
, mapped_name_t
) ht
;
33 struct smartlist_t
*names
;
37 /** Macro to initialize a namemap. */
38 #define NAMEMAP_INIT() { HT_INITIALIZER(), NULL }
41 #endif /* !defined(NAMEMAP_ST_H) */