Go to the documentation of this file.
38 static uint32_t FeatureHashFunc(
HashListTable *ht,
void *data,
45 for (
int i = 0; i <
len; i++)
51 static char FeatureHashCompareFunc(
void *data1, uint16_t datalen1,
52 void *data2, uint16_t datalen2)
59 if (f1 == NULL || f2 == NULL)
68 return (len1 == len2 && memcmp(f1->
feature, f2->
feature, len1) == 0);
71 static void FeatureHashFreeFunc(
void *data)
80 static void FeatureInit(
void) {
82 FeatureHashCompareFunc,
85 if (!feature_hash_table) {
90 static void FeatureAddEntry(
const char *feature_name)
106 FeatureHashFreeFunc(feature);
118 FeatureAddEntry(feature_name);
131 return feature != NULL;
136 if (feature_hash_table != NULL) {
138 feature_hash_table = NULL;
147 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)
#define FatalError(x,...)
void ProvidesFeature(const char *feature_name)