mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
13 lines
706 B
C
13 lines
706 B
C
#include "common/kmod.h"
|
|
#include "common/apple/cf_helpers.h"
|
|
#include <IOKit/kext/KextManager.h>
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
|
|
bool ffKmodLoaded(const char* modName) {
|
|
FF_CFTYPE_AUTO_RELEASE CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, modName, kCFStringEncodingUTF8);
|
|
FF_CFTYPE_AUTO_RELEASE CFArrayRef identifiers = CFArrayCreate(kCFAllocatorDefault, (const void**) &name, 1, &kCFTypeArrayCallBacks);
|
|
FF_CFTYPE_AUTO_RELEASE CFArrayRef keys = CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr);
|
|
FF_CFTYPE_AUTO_RELEASE CFDictionaryRef kextInfo = KextManagerCopyLoadedKextInfo(identifiers, keys);
|
|
return CFDictionaryContainsKey(kextInfo, name);
|
|
}
|