musl/include/search.h
Rich Felker c1a9658bd1 default features: make musl usable without feature test macros
the old behavior of exposing nothing except plain ISO C can be
obtained by defining __STRICT_ANSI__ or using a compiler option (such
as -std=c99) that predefines it. the new default featureset is POSIX
with XSI plus _BSD_SOURCE. any explicit feature test macros will
inhibit the default.

installation docs have also been updated to reflect this change.
2012-09-07 23:13:55 -04:00

52 lines
1.1 KiB
C

#ifndef _SEARCH_H
#define _SEARCH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#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 *__restrict, void **__restrict, 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 _GNU_SOURCE
struct qelem {
struct qelem *q_forw, *q_back;
char q_data[1];
};
void tdestroy(void *, void (*)(void *));
#endif
#ifdef __cplusplus
}
#endif
#endif