]> git.ipfire.org Git - thirdparty/git.git/commit - Makefile
strmap: new utility functions
authorElijah Newren <newren@gmail.com>
Mon, 2 Nov 2020 18:55:06 +0000 (18:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Nov 2020 20:15:50 +0000 (12:15 -0800)
commitae20bf1ad98bdc716879a8da99e7f329e3cc2730
tree51464c9f9ae8ad2f3e538d324f44ca62dd638c0c
parent6da1a258142ac2422c8c57c54b92eaed3c86226e
strmap: new utility functions

Add strmap as a new struct and associated utility functions,
specifically for hashmaps that map strings to some value.  The API is
taken directly from Peff's proposal at
https://lore.kernel.org/git/20180906191203.GA26184@sigill.intra.peff.net/

Note that similar string-list, I have a strdup_strings setting.
However, unlike string-list, strmap_init() does not take a parameter for
this setting and instead automatically sets it to 1; callers who want to
control this detail need to instead call strmap_init_with_options().
(Future patches will add additional parameters to
strmap_init_with_options()).

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
strmap.c [new file with mode: 0644]
strmap.h [new file with mode: 0644]