/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include <dhash.h>
#include "util/sss_ptr_hash.h"
{
void *type_ptr;
"Invalid data type detected. Expected [%s], got [%s].\n",
return false;
}
return true;
}
struct sss_ptr_hash_delete_data {
void *pvt;
};
struct sss_ptr_hash_value {
void *ptr;
};
struct sss_ptr_hash_spy {
const char *key;
};
static int
{
/* This results in removing entry from hash table and freeing the value. */
return 0;
}
static struct sss_ptr_hash_spy *
const char *key,
struct sss_ptr_hash_value *value)
{
return NULL;
}
return NULL;
}
return spy;
}
static int
{
/* Disable spy destructor and free it. */
}
return 0;
}
static struct sss_ptr_hash_value *
const char *key,
void *talloc_ptr)
{
return NULL;
}
return NULL;
}
return value;
}
static void
void *pvt)
{
void *ptr;
return;
}
return;
}
/* Free value. */
/* Switch to the input value and call custom callback. */
}
}
void *del_cb_pvt)
{
return NULL;
}
return NULL;
}
return table;
}
const char *key,
void *talloc_ptr,
const char *type,
bool override)
{
int hret;
return EINVAL;
}
return ERR_INVALID_DATA_TYPE;
}
return ENOMEM;
}
return EEXIST;
}
if (hret != HASH_SUCCESS) {
return EIO;
}
return EOK;
}
static struct sss_ptr_hash_value *
const char *key)
{
int hret;
if (hret == HASH_ERROR_KEY_NOT_FOUND) {
return NULL;
} else if (hret != HASH_SUCCESS) {
return NULL;
}
/* Check value type. */
return NULL;
}
return NULL;
}
return table_value.ptr;
}
const char *key,
const char *type)
{
return NULL;
}
return NULL;
}
}
const char *key,
bool free_value)
{
int hret;
void *ptr;
return;
}
/* Value not found. */
return;
}
/* Delete table entry. This will free value and spy in delete callback. */
hret);
}
/* Also free the original value if requested. */
if (free_value) {
}
return;
}
bool free_values)
{
unsigned long count;
unsigned long i;
int hret;
void *ptr;
return;
}
if (hret != HASH_SUCCESS) {
return;
}
for (i = 0; i < count; i++) {
/* This will remove the entry from hash table and free value. */
if (free_values) {
/* Also free the original value. */
}
}
return;
}
const char *key)
{
}