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)
61 if (f1 == NULL || f2 == NULL)
70 return (len1 == len2 && memcmp(f1->
feature, f2->
feature, len1) == 0);
73 static void FeatureHashFreeFunc(
void *data)
82 static void FeatureInit(
void) {
84 FeatureHashCompareFunc,
87 if (!feature_hash_table) {
88 FatalError(
"Unable to allocate feature hash table.");
92 static void FeatureAddEntry(
const char *feature_name)
98 FatalError(
"Unable to allocate feature entry memory.");
108 FeatureHashFreeFunc(feature);
120 FeatureAddEntry(feature_name);
133 return feature != NULL;
138 if (feature_hash_table != NULL) {
140 feature_hash_table = NULL;
149 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)
bool RequiresFeature(const char *feature_name)
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)
void ProvidesFeature(const char *feature_name)