1 Star 0 Fork 4.9K

Lin_bruin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
search-h.md 14.12 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

search.h

Overview

Related Modules:

UTILS

Description:

Provides functions and related data structures, such as creating, destroying, or searching for a hash table.

You can use the functions provided in this file to perform operations related to wide character types during development, such as, creating, destroying, or searching for a hash table, and creating or searching for a binary tree.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

entry

Defines a hash table entry.

qelem

Creates a queue from the doubly linked list for insque and remque.

hsearch_data

Defines a hash table.

Typedefs

Typedef Name

Description

ENTRY

typedef struct entry 

Defines a hash table entry.

Functions

Function Name

Description

hcreate (size_t nel)

int 

Creates a hash table based on the number of entries.

hdestroy (void)

void 

Destroys a hash table.

hsearch (ENTRY item, ACTION action)

ENTRY

Adds or searches for a hash entry.

hcreate_r (size_t nel, struct hsearch_data *htab)

int 

Creates a hash table based on the number of entries and its description.

hdestroy_r (struct hsearch_data *htab)

void 

Destroys a hash table.

hsearch_r (ENTRY item, ACTION action, ENTRY **retval, struct hsearch_data *htab)

int 

Searches for a hash table.

insque (void *element, void *pred)

void 

Adds an entry to a queue.

remque (void *elem)

void 

Removes an entry from a queue.

lsearch (const void *key, const void *base, size_t *nelp, size_t width, int(*compar)(const void *, const void *))

void * 

Performs a linear search for a key in the array and adds a key to the end of the array if the key is not found.

lfind (const void *key, const void *base, size_t *nelp, size_t width, int(*compar)(const void *, const void *))

void * 

Performs a linear search for a key in the array.

tdelete (const void *key, void **rootp, int(*compar)(const void *, const void *))

void * 

Deletes a key from the binary tree.

tfind (const void *key, void *const *rootp, int(*compar)(const void *, const void *))

void * 

Searches for a key in the binary tree.

tsearch (const void *key, void *const *rootp, int(*compar)(const void *, const void *))

void * 

Searches for a key in the binary tree and adds a key to the tree if the key is not found.

twalk (const void *root, void(*action)(const void *nodep, VISIT which, int depth))

void 

Traverses a binary tree from left to right.

tdestroy (void *root, void(*free_node)(void *nodep))

void 

Releases all nodes in the binary tree.

1
https://gitee.com/dreaminghell/docs.git
git@gitee.com:dreaminghell/docs.git
dreaminghell
docs
docs
master

搜索帮助