mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 04:05:05 +00:00
41 lines
919 B
C
41 lines
919 B
C
#ifndef _SEARCH_H
|
|
#define _SEARCH_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define __NEED_size_t
|
|
#include <bits/alltypes.h>
|
|
|
|
typedef enum { FIND, ENTER } ACTION;
|
|
typedef enum { preorder, postorder, endorder, leaf } VISIT;
|
|
|
|
typedef struct {
|
|
char *key;
|
|
void *data;
|
|
} ENTRY;
|
|
|
|
int hcreate(size_t);
|
|
void hdestroy(void);
|
|
ENTRY *hsearch(ENTRY, ACTION);
|
|
|
|
void insque(void *, void *);
|
|
void remque(void *);
|
|
|
|
void *lsearch(const void *, void *, size_t *, size_t,
|
|
int (*)(const void *, const void *));
|
|
void *lfind(const void *, const void *, size_t *, size_t,
|
|
int (*)(const void *, const void *));
|
|
|
|
void *tdelete(const void *, void **, int(*)(const void *, const void *));
|
|
void *tfind(const void *, void *const *, int(*)(const void *, const void *));
|
|
void *tsearch(const void *, void **, int (*)(const void *, const void *));
|
|
void twalk(const void *, void (*)(const void *, VISIT, int));
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|