util/apparmor: sanitize header
Clean up the header and align it with our coding-style. This includes:
* separte member functions logically with a new-line
* properly pre-declare all defined types
* prefix symbols with the module namespace
* always include c-stdaux.h
* Bus AppArmor Helpers
*/
+#include <c-stdaux.h>
#include <stdlib.h>
+typedef struct BusAppArmorRegistry BusAppArmorRegistry;
typedef struct NameSet NameSet;
enum {
- _APPARMOR_E_SUCCESS,
+ _BUS_APPARMOR_E_SUCCESS,
BUS_APPARMOR_E_DENIED,
};
-typedef struct BusAppArmorRegistry BusAppArmorRegistry;
-
int bus_apparmor_is_enabled(bool *enabledp);
int bus_apparmor_dbus_supported(bool *supportedp);
int bus_apparmor_registry_new(struct BusAppArmorRegistry **registryp, const char *fallback_context);
BusAppArmorRegistry *bus_apparmor_registry_ref(BusAppArmorRegistry *registry);
BusAppArmorRegistry *bus_apparmor_registry_unref(BusAppArmorRegistry *registry);
+
C_DEFINE_CLEANUP(BusAppArmorRegistry *, bus_apparmor_registry_unref);
+
int bus_apparmor_set_bus_type(BusAppArmorRegistry *registry, const char *bustype);
int bus_apparmor_check_own(struct BusAppArmorRegistry *registry, const char *context,
