X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=lib%2Fjsw%2Fjsw_atree.h;h=6dccf07061a8b56e43d4bc6f5565e2c6f66417c2;hb=09490cd2433e3c37a0d85220b4f12f01e6740d46;hp=0faf528d86d751244c70570fdc1fc72d12fb42e9;hpb=d37d830611a8dc438b2de37f68bf2f9ae1230490;p=zpackage diff --git a/lib/jsw/jsw_atree.h b/lib/jsw/jsw_atree.h index 0faf528..6dccf07 100644 --- a/lib/jsw/jsw_atree.h +++ b/lib/jsw/jsw_atree.h @@ -17,32 +17,35 @@ anyone who has modified the code through a header comment, such as this one. */ -#ifdef __cplusplus -#include -using std::size_t; +/* code modified for inclusion in zpm */ -extern "C" { -#else #include -#endif /* Opaque types */ typedef struct jsw_atree jsw_atree_t; typedef struct jsw_atrav jsw_atrav_t; /* User-defined item handling */ +#if 0 typedef int (*cmp_f) ( const void *p1, const void *p2 ); +#endif typedef void *(*dup_f) ( void *p ); typedef void (*rel_f) ( void *p ); /* Andersson tree functions */ -jsw_atree_t *jsw_anew ( cmp_f cmp, dup_f dup, rel_f rel ); +jsw_atree_t *jsw_anew ( + int (*cmp)(const void *, const void *), + void *(dup)(void *), + void (*rel)(void *) + ); +jsw_atree_t *jsw_anew_str(void); void jsw_adelete ( jsw_atree_t *tree ); void *jsw_afind ( jsw_atree_t *tree, void *data ); int jsw_ainsert ( jsw_atree_t *tree, void *data ); int jsw_aerase ( jsw_atree_t *tree, void *data ); size_t jsw_asize ( jsw_atree_t *tree ); +int jsw_afind_strcmp(const void *a, const void *b); /* Traversal functions */ jsw_atrav_t *jsw_atnew ( void ); @@ -52,8 +55,4 @@ void *jsw_atlast ( jsw_atrav_t *trav, jsw_atree_t *tree ); void *jsw_atnext ( jsw_atrav_t *trav ); void *jsw_atprev ( jsw_atrav_t *trav ); -#ifdef __cplusplus -} -#endif - #endif