OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc2/] [newlib/] [libc/] [include/] [search.h] - Diff between revs 207 and 520

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 520
/*      $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $     */
/*      $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $     */
/* $FreeBSD: src/include/search.h,v 1.4 2002/03/23 17:24:53 imp Exp $ */
/* $FreeBSD: src/include/search.h,v 1.4 2002/03/23 17:24:53 imp Exp $ */
 
 
/*
/*
 * Written by J.T. Conklin <jtc@netbsd.org>
 * Written by J.T. Conklin <jtc@netbsd.org>
 * Public domain.
 * Public domain.
 */
 */
 
 
#ifndef _SEARCH_H_
#ifndef _SEARCH_H_
#define _SEARCH_H_
#define _SEARCH_H_
 
 
#include <sys/cdefs.h>
#include <sys/cdefs.h>
#include <machine/ansi.h>
#include <machine/ansi.h>
#include <sys/types.h>
#include <sys/types.h>
 
 
typedef struct entry {
typedef struct entry {
        char *key;
        char *key;
        void *data;
        void *data;
} ENTRY;
} ENTRY;
 
 
typedef enum {
typedef enum {
        FIND, ENTER
        FIND, ENTER
} ACTION;
} ACTION;
 
 
typedef enum {
typedef enum {
        preorder,
        preorder,
        postorder,
        postorder,
        endorder,
        endorder,
        leaf
        leaf
} VISIT;
} VISIT;
 
 
#ifdef _SEARCH_PRIVATE
#ifdef _SEARCH_PRIVATE
typedef struct node {
typedef struct node {
        char         *key;
        char         *key;
        struct node  *llink, *rlink;
        struct node  *llink, *rlink;
} node_t;
} node_t;
#endif
#endif
 
 
struct hsearch_data
struct hsearch_data
{
{
  struct internal_head *htable;
  struct internal_head *htable;
  size_t htablesize;
  size_t htablesize;
};
};
 
 
__BEGIN_DECLS
__BEGIN_DECLS
int      hcreate(size_t);
int      hcreate(size_t);
void     hdestroy(void);
void     hdestroy(void);
ENTRY   *hsearch(ENTRY, ACTION);
ENTRY   *hsearch(ENTRY, ACTION);
int      hcreate_r(size_t, struct hsearch_data *);
int      hcreate_r(size_t, struct hsearch_data *);
void     hdestroy_r(struct hsearch_data *);
void     hdestroy_r(struct hsearch_data *);
int     hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
int     hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
void    *tdelete(const void *, void **, int (*)(const void *, const void *));
void    *tdelete(const void *, void **, int (*)(const void *, const void *));
void    tdestroy (void *, void (*)(void *));
void    tdestroy (void *, void (*)(void *));
void    *tfind(const void *, void **, int (*)(const void *, const void *));
void    *tfind(const void *, void **, int (*)(const void *, const void *));
void    *tsearch(const void *, void **, int (*)(const void *, const void *));
void    *tsearch(const void *, void **, int (*)(const void *, const void *));
void      twalk(const void *, void (*)(const void *, VISIT, int));
void      twalk(const void *, void (*)(const void *, VISIT, int));
__END_DECLS
__END_DECLS
 
 
#endif /* !_SEARCH_H_ */
#endif /* !_SEARCH_H_ */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.