mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-29 01:42:32 +01:00
- Preliminary tree code
- added a key enumerator to hashtables (similar to value enumerator, just that it enumerates all keys in the hash)
This commit is contained in:
@@ -120,6 +120,9 @@ enum {
|
||||
typedef struct W_Array WMArray;
|
||||
typedef struct W_Bag WMBag;
|
||||
typedef struct W_Data WMData;
|
||||
typedef struct W_TreeNode WMTreeNode;
|
||||
typedef struct W_TreeNode WMTree;
|
||||
typedef struct W_HashTable WMDictionary;
|
||||
typedef struct W_HashTable WMHashTable;
|
||||
typedef struct W_UserDefaults WMUserDefaults;
|
||||
typedef struct W_Notification WMNotification;
|
||||
@@ -128,7 +131,6 @@ typedef struct W_Host WMHost;
|
||||
typedef struct W_Connection WMConnection;
|
||||
|
||||
|
||||
|
||||
typedef int WMCompareDataProc(const void *item1, const void *item2);
|
||||
|
||||
typedef void WMFreeDataProc(void *data);
|
||||
@@ -307,6 +309,8 @@ WMHashEnumerator WMEnumerateHashTable(WMHashTable *table);
|
||||
|
||||
void* WMNextHashEnumeratorItem(WMHashEnumerator *enumerator);
|
||||
|
||||
void* WMNextHashEnumeratorKey(WMHashEnumerator *enumerator);
|
||||
|
||||
unsigned WMCountHashTable(WMHashTable *table);
|
||||
|
||||
|
||||
@@ -568,6 +572,38 @@ unsigned WMGetDataFormat(WMData *aData);
|
||||
/* Storing data */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/* Generic Tree and TreeNode */
|
||||
|
||||
WMTreeNode* WMCreateTreeNode(void *data);
|
||||
|
||||
WMTreeNode* WMCreateTreeNodeWithDestructor(void *data, WMFreeDataProc *destructor);
|
||||
|
||||
WMTreeNode* WMInsertItemInTree(WMTreeNode *parent, int index, void *item);
|
||||
|
||||
WMTreeNode* WMAddItemToTree(WMTreeNode *parent, void *item);
|
||||
|
||||
WMTreeNode* WMInsertNodeInTree(WMTreeNode *parent, int index, WMTreeNode *node);
|
||||
|
||||
WMTreeNode* WMAddNodeToTree(WMTreeNode *parent, WMTreeNode *node);
|
||||
|
||||
int WMGetTreeNodeDepth(WMTreeNode *node);
|
||||
|
||||
void WMDestroyTreeNode(WMTreeNode *node);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/* Dictionaries */
|
||||
/*
|
||||
WMDictionary* WMCreateDictionaryFromElements(void *key, void *value, ...);
|
||||
|
||||
#define WMGetDictionaryEntryForKey(dict, key) WMHashGet(dict, key)
|
||||
|
||||
WMArray* WMGetAllDictionaryKeys(WMDictionary *dPtr);
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user