Changeset 363 for trunk/include


Ignore:
Timestamp:
Oct 21, 2011, 1:08:28 AM (13 years ago)
Author:
katerina
Message:

Change zAVL implementation to allow integer keys.

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/sh_inotify.h

    r261 r363  
    66typedef struct
    77{
     8  /*
     9  void * list_of_watches;
     10  */
     11
    812  int    watch[SH_INOTIFY_MAX];
    913  int    flag[SH_INOTIFY_MAX];
    1014  char * file[SH_INOTIFY_MAX];
    11   int    count;
    1215
     16  int     count;
     17  int  max_count;
    1318} sh_watches;
     19
     20#define SH_INOTIFY_INITIALIZER { { 0 }, { 0 }, { NULL}, 0, 0 }
    1421
    1522int sh_inotify_wait_for_change(char * filename, sh_watches * watches,
  • trunk/include/zAVLTree.h

    r1 r363  
    3333
    3434/* typedef the keytype */
    35 typedef const char * zAVLKey;
     35typedef const void * zAVLKey;
    3636
    3737/* Comparison function for strings is strcmp(). */
    38 #define zAVLKey_cmp(tree, a, b) (strcmp((a), (b)))
     38/* #define zAVLKey_cmp(tree, a, b) (strcmp((a), (b))) */
     39
     40#define zAVL_KEY_STRING 0
     41#define zAVL_KEY_INT    1
    3942
    4043
     
    5356  long count;
    5457  zAVLKey (*getkey)(const void *item);
     58  int keytype;
    5559} zAVLTree;
    5660
     
    6266
    6367
    64 extern zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item));
     68extern zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item), int keytype);
    6569extern void zAVLFreeTree (zAVLTree *avltree, void (freeitem)(void *item));
    6670extern int zAVLInsert (zAVLTree *avltree, void *item);
Note: See TracChangeset for help on using the changeset viewer.