From 22f703cab05b7cd368f4de9e03991b7664dc5022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 1 Sep 2014 13:56:46 +0200 Subject: Initial import of argyll version 1.5.1-8 --- numlib/aatree.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 numlib/aatree.h (limited to 'numlib/aatree.h') diff --git a/numlib/aatree.h b/numlib/aatree.h new file mode 100644 index 0000000..2a6df84 --- /dev/null +++ b/numlib/aatree.h @@ -0,0 +1,58 @@ +#ifndef AATREE_H +#define AATREE_H + +/* + Andersson binary balanced tree library + + > Created (Julienne Walker): September 10, 2005 + + This code is in the public domain. Anyone may + use it or change it in any way that they see + fit. The author assumes no responsibility for + damages incurred through use of the original + code or any variations thereof. + + It is requested, but not required, that due + credit is given to the original author and + anyone who has modified the code through + a header comment, such as this one. +*/ + +#ifdef __cplusplus +#include + +using std::size_t; + +extern "C" { +#else +#include +#endif + +/* Opaque types */ +typedef struct aat_atree aat_atree_t; +typedef struct aat_atrav aat_atrav_t; + +/* User-defined item handling */ +typedef int (*cmp_f) ( const void *p1, const void *p2 ); + +/* Andersson tree functions */ +aat_atree_t *aat_anew ( cmp_f cmp ); +void aat_adelete ( aat_atree_t *tree ); +void *aat_afind ( aat_atree_t *tree, void *data ); +int aat_ainsert ( aat_atree_t *tree, void *data ); +int aat_aerase ( aat_atree_t *tree, void *data ); +size_t aat_asize ( aat_atree_t *tree ); + +/* Traversal functions */ +aat_atrav_t *aat_atnew ( void ); +void aat_atdelete ( aat_atrav_t *trav ); +void *aat_atfirst ( aat_atrav_t *trav, aat_atree_t *tree ); +void *aat_atlast ( aat_atrav_t *trav, aat_atree_t *tree ); +void *aat_atnext ( aat_atrav_t *trav ); +void *aat_atprev ( aat_atrav_t *trav ); + +#ifdef __cplusplus +} +#endif + +#endif /* AATREE */ -- cgit v1.2.3