Scroll to navigation

functional.c(3elektra) Elektra functional.c(3elektra)

NAME

functional.c - Functional helper.

SYNOPSIS

#include <kdb.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions


int elektraKsFilter (KeySet *result, KeySet *input, int(*filter)(const Key *k, void *argument), void *argument)
return only those keys from the given keyset that pass the supplied filter function with the supplied argument

Detailed Description

Functional helper.

Copyright:

BSD License (see LICENSE.md or https://www.libelektra.org)

Function Documentation

int elektraKsFilter (KeySet * result, KeySet * input, int(*)(const Key *k, void *argument) filter, void * argument)

return only those keys from the given keyset that pass the supplied filter function with the supplied argument

Parameters:

result the keyset that should contain the filtered keys
input the keyset whose keys should be filtered
filter a function pointer to a function that will be used to filter the keyset. A key will be taken if the function returns a value greater than 0.
argument an argument that will be passed to the filter function each time it is called

Returns:

the number of filtered keys if the filter function always returned a positive value, -1 otherwise

Return values:

NULL on NULL pointer

Author

Generated automatically by Doxygen for Elektra from the source code.

Mon Jan 15 2018 Version 0.8.20