libwget-stringmap(3)

✨ libwget-stringmap β€” Stringmap functions ✨

okay bestie, gather round, because this one is genuinely iconic and also kind of a flex πŸ’… it's the libwget-stringmap page from the Library Functions Manual, and it's basically the stringmap glow-up of the hashmap API. no cap.


🌸 NAME 🌸

libwget-stringmap β€” Stringmap functions


πŸŽ€ SYNOPSIS πŸŽ€

πŸ¦‹ Functions

wget_stringmap * wget_stringmap_create (int max)
wget_stringmap * wget_stringmap_create_nocase (int max)
typedef wget_hashmap wget_stringmap
  • typedef wget_hashmap wget_stringmap β€” this is literally the Type of the stringmap. that's it, that's the tea β˜• it's a typedef, a lil nickname, a rebrand.

πŸ’– Detailed Description πŸ’–

Stringmaps are key/value stores that perform at O(1) for insertion, searching and removing. yes bestie, constant time, every single one of them, the whole trio ate πŸ”₯

The key is a C string.

These functions are a wrapper around the Hashmap API. so like, if you already know the Hashmap API, this is that but wearing a cute lil string-colored jacket πŸ§₯✨


πŸ‘‘ Function Documentation πŸ‘‘

🫢 wget_stringmap * wget_stringmap_create (int max)

Parameters

  • max β€” Initial number of pre-allocated entries

Returns

  • New stringmap instance

Create a new stringmap instance with initial size max. It should be free'd after use with wget_stringmap_free(). okay so like, don't ghost it, free it, that's the polite thing to do πŸ₯Ί

The hash function is an efficient string hash algorithm originally researched by Paul Larson. shoutout Paul, the blueprint, the original main character πŸ’œ

The compare function is strcmp(). The key strings are compared case-sensitive. so "Hello" and "hello" are NOT the same key here, they are two different girls entirely, do not confuse them πŸ’€


🧚 wget_stringmap * wget_stringmap_create_nocase (int max)

Parameters

  • max β€” Initial number of pre-allocated entries

Returns

  • New stringmap instance

Create a new stringmap instance with initial size max. It should be free'd after use with wget_stringmap_free(). same deal bestie, wget_stringmap_free() it, it deserves closure 🫢

The hash function is an efficient string hash algorithm originally researched by Paul Larson, using lowercase'd keys. yes the legend returns, and this time he's lowercase-ing everything first, lowkey a mood πŸ’…

The compare function is strcasecmp() (case-insensitive). so "Hello" and "hello"? same key. same girl. no drama, no distinguishing, we're all just vibing case-insensitively 🌈


⭐ Author ⭐

Generated automatically by Doxygen for wget2 from the source code. so like, nobody hand-wrote this, the machine did it, and honestly? it ate πŸŽ€


and that's the page bestie, we're done!! this came to you from wget2, Version 2.3.0, and it lives at libwget-stringmap(3). go build something cute with it πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from