1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-13 12:25:53 +01:00

replaced linked lists with WMBag, added progress indicator

This commit is contained in:
kojima
1999-09-16 02:55:56 +00:00
parent 54c54401d4
commit 052ab01c84
20 changed files with 889 additions and 444 deletions

View File

@@ -92,13 +92,14 @@ typedef enum {
typedef struct W_Bag WMBag; /* equivalent to a linked list or array */
typedef struct W_HashTable WMHashTable;
typedef struct W_UserDefaults WMUserDefaults;
typedef struct W_Notification WMNotification;
typedef struct W_NotificationQueue WMNotificationQueue;
/* DO NOT ACCESS THE CONTENTS OF THIS STRUCT */
typedef struct {
void *table;
@@ -118,6 +119,7 @@ typedef struct {
void (*releaseKey)(const void *);
} WMHashTableCallbacks;
#if 0
typedef struct {
@@ -126,6 +128,7 @@ typedef struct {
} WMSEscapes;
#endif
typedef void WMNotificationObserverAction(void *observerData,
WMNotification *notification);
@@ -223,6 +226,46 @@ extern const WMHashTableCallbacks WMStringHashCallbacks;
extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
/* keys are strings, bug they are not copied */
/*......................................................................*/
WMBag *WMCreateBag(int size);
int WMGetBagItemCount(WMBag *bag);
void WMAppendBag(WMBag *bag, WMBag *appendedBag);
void WMPutInBag(WMBag *bag, void *item);
void WMInsertInBag(WMBag *bag, int index, void *item);
int WMGetFirstInBag(WMBag *bag, void *item);
int WMGetLastInBag(WMBag *bag, void *item);
void WMRemoveFromBag(WMBag *bag, void *item);
void WMDeleteFromBag(WMBag *bag, int index);
void *WMGetFromBag(WMBag *bag, int index);
int WMCountInBag(WMBag *bag, void *item);
/* comparer must return:
* < 0 if a < b
* > 0 if a > b
* = 0 if a = b
*/
void WMSortBag(WMBag *bag, int (*comparer)(void*,void*));
void WMEmptyBag(WMBag *bag);
void WMFreeBag(WMBag *bag);
WMBag *WMMapBag(WMBag *bag, void* (*function)(void*));
/*......................................................................*/
WMNotification *WMCreateNotification(char *name, void *object, void *clientData);