added search.h

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24091 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-02-24 13:41:01 +00:00
parent f9bbab8848
commit 6213408838

45
headers/posix/search.h Normal file
View File

@ -0,0 +1,45 @@
/*
* Copyright 2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SEARCH_H_
#define _SEARCH_H_
typedef enum {
FIND,
ENTER
} ACTION;
typedef struct entry {
char *keyr;
void *data;
} ENTRY;
typedef enum {
preorder,
postorder,
endorder,
leaf
} VISIT;
extern int hcreate(size_t);
extern void hdestroy(void);
extern ENTRY *hsearch(ENTRY, ACTION);
extern void insque(void *, void *);
extern void *lfind(const void *, const void *, size_t *,
size_t, int (*)(const void *, const void *));
extern void *lsearch(const void *, void *, size_t *,
size_t, int (*)(const void *, const void *));
extern void remque(void *);
extern void *tdelete(const void *restrict, void **restrict,
int(*)(const void *, const void *));
extern void *tfind(const void *, void *const *,
int(*)(const void *, const void *));
extern void *tsearch(const void *, void **,
int(*)(const void *, const void *));
extern void twalk(const void *,
void (*)(const void *, VISIT, int ));
#endif /* _SEARCH_H_ */