EndpointSecurity icon indicating copy to clipboard operation
EndpointSecurity copied to clipboard

A module to expose the Endpoint Security library to Swift

EndpointSecurity

This module allows you to import the C based Endpoint Security framework into your Swift code. You will also need to link against libEndpointSecurity.dylib. If you want to read more about exposing C headers to Swift you can see the Clang documentation here.

Usage

import EndpointSecurity

var client: OpaquePointer?

let res = es_new_client(&client) { (client, message) in
    // Do something with events
}

guard res == ES_NEW_CLIENT_RESULT_SUCCESS else {
    fatalError("Could not connect to endpoint security subsystem.")
}

Building

swiftc -I ./EndpointSecurity test.swift -lEndpointSecurity