Skip to content

lcKeyValueMap is a small libary that can store variable amounts of strings by name (call it associative array, dictionary key value map string to string)

License

Notifications You must be signed in to change notification settings

littleCdev/lcKeyValueMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small Key-Value map for C

lcKeyValueMap is a small libary that can store variable amounts of strings by name (call it associative array, dictionary key value map)

Requierements

  • nothing but gcc

Useage

include the header

#include "src/lcKeyValueMap.h"

create a new key value map

kvMapStringString kv = kvInitStringString();

add stuff to it!

kvSetStringString(&kv,"test","123345");
// add a second value
kvSetStringString(&kv,"test1","test2");

// overwrite values
kvSetStringString(&kv,"test","replaced test");

or remove stuff

kvUnsetStringString(&kv,"test1");

and get the values back

char *s = kvGetStringString(&kv,"test");
printf("key: test: %s\n",s);
// non existing values will return NULL
s = kvGetStringString(&kv,"test123"); // NULL
printf("key: test123: %s\n",s);

but don't forget to deinit after you're done

kvDeinitStringString(&kv);

About

lcKeyValueMap is a small libary that can store variable amounts of strings by name (call it associative array, dictionary key value map string to string)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published