~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to system/include/libc/search.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $     */
2
 
/* $FreeBSD: src/include/search.h,v 1.4 2002/03/23 17:24:53 imp Exp $ */
3
 
 
4
 
/*
5
 
 * Written by J.T. Conklin <jtc@netbsd.org>
6
 
 * Public domain.
7
 
 */
8
 
 
9
 
#ifndef _SEARCH_H_
10
 
#define _SEARCH_H_
11
 
 
12
 
#include <sys/cdefs.h>
13
 
#include <machine/ansi.h>
14
 
#include <sys/types.h>
15
 
 
16
 
typedef struct entry {
 
1
#ifndef _SEARCH_H
 
2
#define _SEARCH_H
 
3
 
 
4
#ifdef __cplusplus
 
5
extern "C" {
 
6
#endif
 
7
 
 
8
#include <features.h>
 
9
 
 
10
#define __NEED_size_t
 
11
#include <bits/alltypes.h>
 
12
 
 
13
typedef enum { FIND, ENTER } ACTION;
 
14
typedef enum { preorder, postorder, endorder, leaf } VISIT;
 
15
 
 
16
typedef struct {
17
17
        char *key;
18
18
        void *data;
19
19
} ENTRY;
20
20
 
21
 
typedef enum {
22
 
        FIND, ENTER
23
 
} ACTION;
24
 
 
25
 
typedef enum {
26
 
        preorder,
27
 
        postorder,
28
 
        endorder,
29
 
        leaf
30
 
} VISIT;
31
 
 
32
 
#ifdef _SEARCH_PRIVATE
33
 
typedef struct node {
34
 
        char         *key;
35
 
        struct node  *llink, *rlink;
36
 
} node_t;
37
 
#endif
38
 
 
39
 
struct hsearch_data
40
 
{
41
 
  struct internal_head *htable;
42
 
  size_t htablesize;
 
21
int hcreate(size_t);
 
22
void hdestroy(void);
 
23
ENTRY *hsearch(ENTRY, ACTION);
 
24
 
 
25
void insque(void *, void *);
 
26
void remque(void *);
 
27
 
 
28
void *lsearch(const void *, void *, size_t *, size_t,
 
29
        int (*)(const void *, const void *));
 
30
void *lfind(const void *, const void *, size_t *, size_t,
 
31
        int (*)(const void *, const void *));
 
32
 
 
33
void *tdelete(const void *__restrict, void **__restrict, int(*)(const void *, const void *));
 
34
void *tfind(const void *, void *const *, int(*)(const void *, const void *));
 
35
void *tsearch(const void *, void **, int (*)(const void *, const void *));
 
36
void twalk(const void *, void (*)(const void *, VISIT, int));
 
37
 
 
38
#ifdef _GNU_SOURCE
 
39
struct qelem {
 
40
        struct qelem *q_forw, *q_back;
 
41
        char q_data[1];
43
42
};
44
43
 
45
 
__BEGIN_DECLS
46
 
int      hcreate(size_t);
47
 
void     hdestroy(void);
48
 
ENTRY   *hsearch(ENTRY, ACTION);
49
 
int      hcreate_r(size_t, struct hsearch_data *);
50
 
void     hdestroy_r(struct hsearch_data *);
51
 
int     hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
52
 
void    *tdelete(const void *, void **, int (*)(const void *, const void *));
53
 
void    tdestroy (void *, void (*)(void *));
54
 
void    *tfind(const void *, void **, int (*)(const void *, const void *));
55
 
void    *tsearch(const void *, void **, int (*)(const void *, const void *));
56
 
void      twalk(const void *, void (*)(const void *, VISIT, int));
57
 
__END_DECLS
58
 
 
59
 
#endif /* !_SEARCH_H_ */
 
44
void tdestroy(void *, void (*)(void *));
 
45
#endif
 
46
 
 
47
#ifdef __cplusplus
 
48
}
 
49
#endif
 
50
 
 
51
#endif