Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/src/rbtree.h
Henrik Hautakoski f46ae1970b Change indentation to follow the updated standard.
Alot of mixed indentation. use 4 chars wide soft tabs.
2011-03-19 12:28:48 +02:00

36 lines
925 B
C

/* rbtree.h
*
* Copyright (C) 2010-2011 Henrik Hautakoski <henrik@fiktivkod.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#ifndef __RBTREE_H
#define __RBTREE_H
#include <stddef.h>
typedef struct {
struct _rbn *root;
/* user defined operations */
int (*cmp_fn)(const void *, const void *);
} rbtree;
#define RBTREE_INIT(cmp) { NULL, cmp }
int rbtree_is_empty(rbtree *tree);
void* rbtree_search(rbtree *tree, const void *key);
void rbtree_walk(rbtree *tree, void (*action)(const void *));
void rbtree_free(rbtree *tree, void (*free_fn)(void *));
int rbtree_insert(rbtree *tree, const void *key);
void* rbtree_delete(rbtree *tree, const void *key);
#endif /* __RBTREE_H */