Go to the documentation of this file.
40 static uint32_t FeatureHashFunc(
HashListTable *ht,
void *data,
47 for (
size_t i = 0; i <
len; i++)
53 static char FeatureHashCompareFunc(
void *data1, uint16_t datalen1,
54 void *data2, uint16_t datalen2)
59 if (f1 == NULL || f2 == NULL)
68 static void FeatureHashFreeFunc(
void *data)
77 static void FeatureInit(
void) {
79 FeatureHashCompareFunc,
82 if (!feature_hash_table) {
83 FatalError(
"Unable to allocate feature hash table.");
87 static void FeatureAddEntry(
const char *feature_name)
93 FatalError(
"Unable to allocate feature entry memory.");
103 FeatureHashFreeFunc(feature);
115 FeatureAddEntry(feature_name);
128 return feature != NULL;
133 if (feature_hash_table != NULL) {
135 feature_hash_table = NULL;
144 printf(
"provided feature name: %s\n", f->
feature);
#define HashListTableGetListData(hb)
HashListTableBucket * HashListTableGetListHead(HashListTable *ht)
#define SCMUTEX_INITIALIZER
void * HashListTableLookup(HashListTable *ht, void *data, uint16_t datalen)
int HashListTableAdd(HashListTable *ht, void *data, uint16_t datalen)
#define HashListTableGetListNext(hb)
void FeatureTrackingRegister(void)
HashListTable * HashListTableInit(uint32_t size, uint32_t(*Hash)(struct HashListTable_ *, void *, uint16_t), char(*Compare)(void *, uint16_t, void *, uint16_t), void(*Free)(void *))
#define SCMutexUnlock(mut)
struct FeatureEntryType FeatureEntryType
void FeatureTrackingRelease(void)
void HashListTableFree(HashListTable *ht)
bool SCRequiresFeature(const char *feature_name)
void ProvidesFeature(const char *feature_name)