Add hash map routines
This commit is contained in:
@@ -36,7 +36,8 @@ void *XmdBufferBreak (XmdBuffer *buffer);
|
||||
/* XmdBufferLength returns the amount of elements stored in a buffer. */
|
||||
Cardinal XmdBufferLength (XmdBuffer *buffer);
|
||||
|
||||
/* XmdBufferFree frees the buffer and any data associated with it. */
|
||||
/* XmdBufferFree frees the buffer and any data associated with it. Note that if
|
||||
the buffer contains pointers, the values they point to will not be freed. */
|
||||
void XmdBufferFree (XmdBuffer *buffer);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef _XmdLauncher_h
|
||||
#define _XmdLauncher_h
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/* TODO */
|
||||
|
||||
#endif
|
||||
39
libXmd/include/Xmd/Map.h
Normal file
39
libXmd/include/Xmd/Map.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef _XmdMap_h
|
||||
#define _XmdMap_h
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/* XmdMapKey is used to key XmdMap. */
|
||||
typedef long unsigned int XmdMapKey;
|
||||
|
||||
/* XmdMap is a hash map that is keyed by an integer and can store any type of
|
||||
element. */
|
||||
typedef struct _XmdMap XmdMap;
|
||||
|
||||
/* XmdMapIterator is a function that can iterate over a map. */
|
||||
typedef Bool (*XmdMapIterator) (XmdMap *map, XmdMapKey key, void *value);
|
||||
|
||||
/* XmdMapNew creates a new map.*/
|
||||
XmdMap *XmdMapNew ();
|
||||
|
||||
/* XmdMapGet retrieves a value from a map. */
|
||||
void *XmdMapGet (XmdMap *map, XmdMapKey key);
|
||||
|
||||
/* XmdMapSet sets a value in a map. The previous value associated with the key,
|
||||
if it exists, is overwritten by the new value. If the value is set to NULL,
|
||||
the key/value combination is deleted from the map. This function returns
|
||||
the previous value associated with the key so it can be free'd if necessary.
|
||||
*/
|
||||
void *XmdMapSet (XmdMap *map, XmdMapKey key, void *value);
|
||||
|
||||
/* XmdMapIterate calls iterator for each key/value pair in a map. */
|
||||
void XmdMapIterate (XmdMap *map, XmdMapIterator iterator);
|
||||
|
||||
/* XmdMapLength returns the number of key/value entries stored in a map. */
|
||||
Cardinal XmdMapLength (XmdMap *map);
|
||||
|
||||
/* XmdMapFree frees the map and any data associated with it. Note that this will
|
||||
not free any of the map's values. */
|
||||
void XmdMapFree (XmdMap *map);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user