#ifndef LIBPOLKIT_H
#define LIBPOLKIT_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
#include <dbus/dbus.h>
typedef enum {
LIBPOLKIT_RESULT_OK,
LIBPOLKIT_RESULT_ERROR,
LIBPOLKIT_RESULT_INVALID_CONTEXT,
LIBPOLKIT_RESULT_NOT_PRIVILEGED,
LIBPOLKIT_RESULT_NO_SUCH_PRIVILEGE,
LIBPOLKIT_RESULT_NO_SUCH_USER
} LibPolKitResult;
struct LibPolKitContext_s;
typedef struct LibPolKitContext_s LibPolKitContext;
LibPolKitContext *libpolkit_new_context (DBusConnection *connection);
gboolean libpolkit_free_context (LibPolKitContext *ctx);
LibPolKitResult libpolkit_get_privilege_list (LibPolKitContext *ctx,
GList **result);
LibPolKitResult libpolkit_is_uid_allowed_for_privilege (LibPolKitContext *ctx,
const char *system_bus_unique_name,
const char *user,
const char *privilege,
const char *resource,
gboolean *out_is_allowed,
gboolean *out_is_temporary,
char **out_is_privileged_but_restricted_to_system_bus_unique_name);
LibPolKitResult libpolkit_revoke_temporary_privilege (LibPolKitContext *ctx,
const char *user,
const char *privilege,
const char *resource,
gboolean *result);
LibPolKitResult libpolkit_get_allowed_resources_for_privilege_for_uid (LibPolKitContext *ctx,
const char *user,
const char *privilege,
GList **resources,
GList **restrictions,
int *num_non_temporary);
#endif