logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

wofi - Map API functions and documentation

Description

       The  functions  documented  here are used for interacting with wofi's config and map. They are defined in
       map.h.

Map Functions

       The following functions are used to interact with a structmap*structmap*map_init(void)
              Allocates and returns a new string map. String maps only support string values.

       structmap*map_init_void(void)
              Allocates and returns a new void map. A void map supports values of any type.

       voidmap_free(structmap*map)
              Frees the provided map and all it's keys. Values are only freed if it is a string map.

       boolmap_put(structmap*map,constchar*key,char*value)
              Returns true if the given map is a string map, otherwise returns false and  prints  a  message  to
              stderr.

              structmap*map - The map to insert into.

              constchar*key  -  The key to store the value under. This key is given to strdup() before being
              saved and will be freed when running map_free().

              char*value - The value to store. This value is given to strdup() before being saved and  will  be
              freed when running map_free(). If the value is NULL it will not be given to strdup().

       boolmap_put_void(structmap*map,constchar*key,void*value)
              Returns  true  if  the  given  map  is a void map, otherwise returns false and prints a message to
              stderr.

              structmap*map - The map to insert into.

              constchar*key - The key to store the value under. This key is given  to  strdup()  before  being
              saved and will be freed when running map_free().

              void*value  - The value to store. This pointer is stored in the map, it is on the caller to free
              this and it will not be freed when running map_free().

       void*map_get(structmap*map,constchar*key)
              Returns the value stored under key or NULL if no key exists. NULL can also be returned if  it  was
              stored there with map_put() or map_put_void().

              structmap*map - The map to get the value from.

              constchar*key - The key to lookup.

       boolmap_contains(structmap*map,constchar*key)
              Returns true if the key exists, false otherwise. This is implemented as a value!=NULL check so a
              NULL value is considered to not exist.

              structmap*map - The map to check against.

              constchar*key - The key to check for.

       size_tmap_size(structmap*map)
              Returns the number of entries in this map.

              structmap*map - The map to get the size of.

                                                                                                     wofi-map(3)

Name

       wofi - Map API functions and documentation

See Also