Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include
File: search.h
/* Declarations for System V style searching functions.
[0] Fix | Delete
Copyright (C) 1995-2018 Free Software Foundation, Inc.
[1] Fix | Delete
This file is part of the GNU C Library.
[2] Fix | Delete
[3] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[4] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[5] Fix | Delete
License as published by the Free Software Foundation; either
[6] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[7] Fix | Delete
[8] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[9] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[10] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[11] Fix | Delete
Lesser General Public License for more details.
[12] Fix | Delete
[13] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[14] Fix | Delete
License along with the GNU C Library; if not, see
[15] Fix | Delete
<http://www.gnu.org/licenses/>. */
[16] Fix | Delete
[17] Fix | Delete
#ifndef _SEARCH_H
[18] Fix | Delete
#define _SEARCH_H 1
[19] Fix | Delete
[20] Fix | Delete
#include <features.h>
[21] Fix | Delete
[22] Fix | Delete
#define __need_size_t
[23] Fix | Delete
#include <stddef.h>
[24] Fix | Delete
[25] Fix | Delete
__BEGIN_DECLS
[26] Fix | Delete
[27] Fix | Delete
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
[28] Fix | Delete
/* Prototype structure for a linked-list data structure.
[29] Fix | Delete
This is the type used by the `insque' and `remque' functions. */
[30] Fix | Delete
[31] Fix | Delete
# ifdef __USE_GNU
[32] Fix | Delete
struct qelem
[33] Fix | Delete
{
[34] Fix | Delete
struct qelem *q_forw;
[35] Fix | Delete
struct qelem *q_back;
[36] Fix | Delete
char q_data[1];
[37] Fix | Delete
};
[38] Fix | Delete
# endif
[39] Fix | Delete
[40] Fix | Delete
[41] Fix | Delete
/* Insert ELEM into a doubly-linked list, after PREV. */
[42] Fix | Delete
extern void insque (void *__elem, void *__prev) __THROW;
[43] Fix | Delete
[44] Fix | Delete
/* Unlink ELEM from the doubly-linked list that it is in. */
[45] Fix | Delete
extern void remque (void *__elem) __THROW;
[46] Fix | Delete
#endif
[47] Fix | Delete
[48] Fix | Delete
[49] Fix | Delete
/* For use with hsearch(3). */
[50] Fix | Delete
#ifndef __COMPAR_FN_T
[51] Fix | Delete
# define __COMPAR_FN_T
[52] Fix | Delete
typedef int (*__compar_fn_t) (const void *, const void *);
[53] Fix | Delete
[54] Fix | Delete
# ifdef __USE_GNU
[55] Fix | Delete
typedef __compar_fn_t comparison_fn_t;
[56] Fix | Delete
# endif
[57] Fix | Delete
#endif
[58] Fix | Delete
[59] Fix | Delete
/* Action which shall be performed in the call the hsearch. */
[60] Fix | Delete
typedef enum
[61] Fix | Delete
{
[62] Fix | Delete
FIND,
[63] Fix | Delete
ENTER
[64] Fix | Delete
}
[65] Fix | Delete
ACTION;
[66] Fix | Delete
[67] Fix | Delete
typedef struct entry
[68] Fix | Delete
{
[69] Fix | Delete
char *key;
[70] Fix | Delete
void *data;
[71] Fix | Delete
}
[72] Fix | Delete
ENTRY;
[73] Fix | Delete
[74] Fix | Delete
/* Opaque type for internal use. */
[75] Fix | Delete
struct _ENTRY;
[76] Fix | Delete
[77] Fix | Delete
/* Family of hash table handling functions. The functions also
[78] Fix | Delete
have reentrant counterparts ending with _r. The non-reentrant
[79] Fix | Delete
functions all work on a signle internal hashing table. */
[80] Fix | Delete
[81] Fix | Delete
/* Search for entry matching ITEM.key in internal hash table. If
[82] Fix | Delete
ACTION is `FIND' return found entry or signal error by returning
[83] Fix | Delete
NULL. If ACTION is `ENTER' replace existing data (if any) with
[84] Fix | Delete
ITEM.data. */
[85] Fix | Delete
extern ENTRY *hsearch (ENTRY __item, ACTION __action) __THROW;
[86] Fix | Delete
[87] Fix | Delete
/* Create a new hashing table which will at most contain NEL elements. */
[88] Fix | Delete
extern int hcreate (size_t __nel) __THROW;
[89] Fix | Delete
[90] Fix | Delete
/* Destroy current internal hashing table. */
[91] Fix | Delete
extern void hdestroy (void) __THROW;
[92] Fix | Delete
[93] Fix | Delete
#ifdef __USE_GNU
[94] Fix | Delete
/* Data type for reentrant functions. */
[95] Fix | Delete
struct hsearch_data
[96] Fix | Delete
{
[97] Fix | Delete
struct _ENTRY *table;
[98] Fix | Delete
unsigned int size;
[99] Fix | Delete
unsigned int filled;
[100] Fix | Delete
};
[101] Fix | Delete
[102] Fix | Delete
/* Reentrant versions which can handle multiple hashing tables at the
[103] Fix | Delete
same time. */
[104] Fix | Delete
extern int hsearch_r (ENTRY __item, ACTION __action, ENTRY **__retval,
[105] Fix | Delete
struct hsearch_data *__htab) __THROW;
[106] Fix | Delete
extern int hcreate_r (size_t __nel, struct hsearch_data *__htab) __THROW;
[107] Fix | Delete
extern void hdestroy_r (struct hsearch_data *__htab) __THROW;
[108] Fix | Delete
#endif
[109] Fix | Delete
[110] Fix | Delete
[111] Fix | Delete
/* The tsearch routines are very interesting. They make many
[112] Fix | Delete
assumptions about the compiler. It assumes that the first field
[113] Fix | Delete
in node must be the "key" field, which points to the datum.
[114] Fix | Delete
Everything depends on that. */
[115] Fix | Delete
/* For tsearch */
[116] Fix | Delete
typedef enum
[117] Fix | Delete
{
[118] Fix | Delete
preorder,
[119] Fix | Delete
postorder,
[120] Fix | Delete
endorder,
[121] Fix | Delete
leaf
[122] Fix | Delete
}
[123] Fix | Delete
VISIT;
[124] Fix | Delete
[125] Fix | Delete
/* Search for an entry matching the given KEY in the tree pointed to
[126] Fix | Delete
by *ROOTP and insert a new element if not found. */
[127] Fix | Delete
extern void *tsearch (const void *__key, void **__rootp,
[128] Fix | Delete
__compar_fn_t __compar);
[129] Fix | Delete
[130] Fix | Delete
/* Search for an entry matching the given KEY in the tree pointed to
[131] Fix | Delete
by *ROOTP. If no matching entry is available return NULL. */
[132] Fix | Delete
extern void *tfind (const void *__key, void *const *__rootp,
[133] Fix | Delete
__compar_fn_t __compar);
[134] Fix | Delete
[135] Fix | Delete
/* Remove the element matching KEY from the tree pointed to by *ROOTP. */
[136] Fix | Delete
extern void *tdelete (const void *__restrict __key,
[137] Fix | Delete
void **__restrict __rootp,
[138] Fix | Delete
__compar_fn_t __compar);
[139] Fix | Delete
[140] Fix | Delete
#ifndef __ACTION_FN_T
[141] Fix | Delete
# define __ACTION_FN_T
[142] Fix | Delete
typedef void (*__action_fn_t) (const void *__nodep, VISIT __value,
[143] Fix | Delete
int __level);
[144] Fix | Delete
#endif
[145] Fix | Delete
[146] Fix | Delete
/* Walk through the whole tree and call the ACTION callback for every node
[147] Fix | Delete
or leaf. */
[148] Fix | Delete
extern void twalk (const void *__root, __action_fn_t __action);
[149] Fix | Delete
[150] Fix | Delete
#ifdef __USE_GNU
[151] Fix | Delete
/* Callback type for function to free a tree node. If the keys are atomic
[152] Fix | Delete
data this function should do nothing. */
[153] Fix | Delete
typedef void (*__free_fn_t) (void *__nodep);
[154] Fix | Delete
[155] Fix | Delete
/* Destroy the whole tree, call FREEFCT for each node or leaf. */
[156] Fix | Delete
extern void tdestroy (void *__root, __free_fn_t __freefct);
[157] Fix | Delete
#endif
[158] Fix | Delete
[159] Fix | Delete
[160] Fix | Delete
/* Perform linear search for KEY by comparing by COMPAR in an array
[161] Fix | Delete
[BASE,BASE+NMEMB*SIZE). */
[162] Fix | Delete
extern void *lfind (const void *__key, const void *__base,
[163] Fix | Delete
size_t *__nmemb, size_t __size, __compar_fn_t __compar);
[164] Fix | Delete
[165] Fix | Delete
/* Perform linear search for KEY by comparing by COMPAR function in
[166] Fix | Delete
array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */
[167] Fix | Delete
extern void *lsearch (const void *__key, void *__base,
[168] Fix | Delete
size_t *__nmemb, size_t __size, __compar_fn_t __compar);
[169] Fix | Delete
[170] Fix | Delete
__END_DECLS
[171] Fix | Delete
[172] Fix | Delete
#endif /* search.h */
[173] Fix | Delete
[174] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function