Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/bind9/isc
File: ht.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* SPDX-License-Identifier: MPL-2.0
[3] Fix | Delete
*
[4] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[5] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[6] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[7] Fix | Delete
*
[8] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[9] Fix | Delete
* information regarding copyright ownership.
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
/* ! \file */
[13] Fix | Delete
[14] Fix | Delete
#pragma once
[15] Fix | Delete
[16] Fix | Delete
#include <inttypes.h>
[17] Fix | Delete
#include <string.h>
[18] Fix | Delete
[19] Fix | Delete
#include <isc/result.h>
[20] Fix | Delete
#include <isc/types.h>
[21] Fix | Delete
[22] Fix | Delete
typedef struct isc_ht isc_ht_t;
[23] Fix | Delete
typedef struct isc_ht_iter isc_ht_iter_t;
[24] Fix | Delete
[25] Fix | Delete
enum { ISC_HT_CASE_SENSITIVE = 0x00, ISC_HT_CASE_INSENSITIVE = 0x01 };
[26] Fix | Delete
[27] Fix | Delete
/*%
[28] Fix | Delete
* Initialize hashtable at *htp, using memory context and size of (1<<bits)
[29] Fix | Delete
*
[30] Fix | Delete
* If 'options' contains ISC_HT_CASE_INSENSITIVE, then upper- and lower-case
[31] Fix | Delete
* letters in key values will generate the same hash values; this can be used
[32] Fix | Delete
* when the key for a hash table is a DNS name.
[33] Fix | Delete
*
[34] Fix | Delete
* Requires:
[35] Fix | Delete
*\li 'htp' is not NULL and '*htp' is NULL.
[36] Fix | Delete
*\li 'mctx' is a valid memory context.
[37] Fix | Delete
*\li 'bits' >=1 and 'bits' <=32
[38] Fix | Delete
*
[39] Fix | Delete
*/
[40] Fix | Delete
void
[41] Fix | Delete
isc_ht_init(isc_ht_t **htp, isc_mem_t *mctx, uint8_t bits,
[42] Fix | Delete
unsigned int options);
[43] Fix | Delete
[44] Fix | Delete
/*%
[45] Fix | Delete
* Destroy hashtable, freeing everything
[46] Fix | Delete
*
[47] Fix | Delete
* Requires:
[48] Fix | Delete
* \li '*htp' is valid hashtable
[49] Fix | Delete
*/
[50] Fix | Delete
void
[51] Fix | Delete
isc_ht_destroy(isc_ht_t **htp);
[52] Fix | Delete
[53] Fix | Delete
/*%
[54] Fix | Delete
* Add a node to hashtable, pointed by binary key 'key' of size 'keysize';
[55] Fix | Delete
* set its value to 'value'
[56] Fix | Delete
*
[57] Fix | Delete
* Requires:
[58] Fix | Delete
*\li 'ht' is a valid hashtable
[59] Fix | Delete
*\li write-lock
[60] Fix | Delete
*
[61] Fix | Delete
* Returns:
[62] Fix | Delete
*\li #ISC_R_NOMEMORY -- not enough memory to create pool
[63] Fix | Delete
*\li #ISC_R_EXISTS -- node of the same key already exists
[64] Fix | Delete
*\li #ISC_R_SUCCESS -- all is well.
[65] Fix | Delete
*/
[66] Fix | Delete
isc_result_t
[67] Fix | Delete
isc_ht_add(isc_ht_t *ht, const unsigned char *key, const uint32_t keysize,
[68] Fix | Delete
void *value);
[69] Fix | Delete
[70] Fix | Delete
/*%
[71] Fix | Delete
* Find a node matching 'key'/'keysize' in hashtable 'ht';
[72] Fix | Delete
* if found, set '*valuep' to its value. (If 'valuep' is NULL,
[73] Fix | Delete
* then simply return SUCCESS or NOTFOUND to indicate whether the
[74] Fix | Delete
* key exists in the hashtable.)
[75] Fix | Delete
*
[76] Fix | Delete
* Requires:
[77] Fix | Delete
* \li 'ht' is a valid hashtable
[78] Fix | Delete
* \li read-lock
[79] Fix | Delete
*
[80] Fix | Delete
* Returns:
[81] Fix | Delete
* \li #ISC_R_SUCCESS -- success
[82] Fix | Delete
* \li #ISC_R_NOTFOUND -- key not found
[83] Fix | Delete
*/
[84] Fix | Delete
isc_result_t
[85] Fix | Delete
isc_ht_find(const isc_ht_t *ht, const unsigned char *key,
[86] Fix | Delete
const uint32_t keysize, void **valuep);
[87] Fix | Delete
[88] Fix | Delete
/*%
[89] Fix | Delete
* Delete node from hashtable
[90] Fix | Delete
*
[91] Fix | Delete
* Requires:
[92] Fix | Delete
*\li ht is a valid hashtable
[93] Fix | Delete
*\li write-lock
[94] Fix | Delete
*
[95] Fix | Delete
* Returns:
[96] Fix | Delete
*\li #ISC_R_NOTFOUND -- key not found
[97] Fix | Delete
*\li #ISC_R_SUCCESS -- all is well
[98] Fix | Delete
*/
[99] Fix | Delete
isc_result_t
[100] Fix | Delete
isc_ht_delete(isc_ht_t *ht, const unsigned char *key, const uint32_t keysize);
[101] Fix | Delete
[102] Fix | Delete
/*%
[103] Fix | Delete
* Create an iterator for the hashtable; point '*itp' to it.
[104] Fix | Delete
*
[105] Fix | Delete
* Requires:
[106] Fix | Delete
*\li 'ht' is a valid hashtable
[107] Fix | Delete
*\li 'itp' is non NULL and '*itp' is NULL.
[108] Fix | Delete
*/
[109] Fix | Delete
void
[110] Fix | Delete
isc_ht_iter_create(isc_ht_t *ht, isc_ht_iter_t **itp);
[111] Fix | Delete
[112] Fix | Delete
/*%
[113] Fix | Delete
* Destroy the iterator '*itp', set it to NULL
[114] Fix | Delete
*
[115] Fix | Delete
* Requires:
[116] Fix | Delete
*\li 'itp' is non NULL and '*itp' is non NULL.
[117] Fix | Delete
*/
[118] Fix | Delete
void
[119] Fix | Delete
isc_ht_iter_destroy(isc_ht_iter_t **itp);
[120] Fix | Delete
[121] Fix | Delete
/*%
[122] Fix | Delete
* Set an iterator to the first entry.
[123] Fix | Delete
*
[124] Fix | Delete
* Requires:
[125] Fix | Delete
*\li 'it' is non NULL.
[126] Fix | Delete
*
[127] Fix | Delete
* Returns:
[128] Fix | Delete
* \li #ISC_R_SUCCESS -- success
[129] Fix | Delete
* \li #ISC_R_NOMORE -- no data in the hashtable
[130] Fix | Delete
*/
[131] Fix | Delete
isc_result_t
[132] Fix | Delete
isc_ht_iter_first(isc_ht_iter_t *it);
[133] Fix | Delete
[134] Fix | Delete
/*%
[135] Fix | Delete
* Set an iterator to the next entry.
[136] Fix | Delete
*
[137] Fix | Delete
* Requires:
[138] Fix | Delete
*\li 'it' is non NULL.
[139] Fix | Delete
*
[140] Fix | Delete
* Returns:
[141] Fix | Delete
* \li #ISC_R_SUCCESS -- success
[142] Fix | Delete
* \li #ISC_R_NOMORE -- end of hashtable reached
[143] Fix | Delete
*/
[144] Fix | Delete
isc_result_t
[145] Fix | Delete
isc_ht_iter_next(isc_ht_iter_t *it);
[146] Fix | Delete
[147] Fix | Delete
/*%
[148] Fix | Delete
* Delete current entry and set an iterator to the next entry.
[149] Fix | Delete
*
[150] Fix | Delete
* Requires:
[151] Fix | Delete
*\li 'it' is non NULL.
[152] Fix | Delete
*
[153] Fix | Delete
* Returns:
[154] Fix | Delete
* \li #ISC_R_SUCCESS -- success
[155] Fix | Delete
* \li #ISC_R_NOMORE -- end of hashtable reached
[156] Fix | Delete
*/
[157] Fix | Delete
isc_result_t
[158] Fix | Delete
isc_ht_iter_delcurrent_next(isc_ht_iter_t *it);
[159] Fix | Delete
[160] Fix | Delete
/*%
[161] Fix | Delete
* Set 'value' to the current value under the iterator
[162] Fix | Delete
*
[163] Fix | Delete
* Requires:
[164] Fix | Delete
*\li 'it' is non NULL.
[165] Fix | Delete
*\li 'valuep' is non NULL and '*valuep' is NULL.
[166] Fix | Delete
*/
[167] Fix | Delete
void
[168] Fix | Delete
isc_ht_iter_current(isc_ht_iter_t *it, void **valuep);
[169] Fix | Delete
[170] Fix | Delete
/*%
[171] Fix | Delete
* Set 'key' and 'keysize to the current key and keysize for the value
[172] Fix | Delete
* under the iterator
[173] Fix | Delete
*
[174] Fix | Delete
* Requires:
[175] Fix | Delete
*\li 'it' is non NULL.
[176] Fix | Delete
*\li 'key' is non NULL and '*key' is NULL.
[177] Fix | Delete
*\li 'keysize' is non NULL.
[178] Fix | Delete
*/
[179] Fix | Delete
void
[180] Fix | Delete
isc_ht_iter_currentkey(isc_ht_iter_t *it, unsigned char **key, size_t *keysize);
[181] Fix | Delete
[182] Fix | Delete
/*%
[183] Fix | Delete
* Returns the number of items in the hashtable.
[184] Fix | Delete
*
[185] Fix | Delete
* Requires:
[186] Fix | Delete
*\li 'ht' is a valid hashtable
[187] Fix | Delete
*/
[188] Fix | Delete
size_t
[189] Fix | Delete
isc_ht_count(const isc_ht_t *ht);
[190] Fix | Delete
[191] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function