Policy Cache

Policy Cache — Holds the actions defined on the system.

Synopsis




                    PolKitPolicyCache;
void                (*PolKitPolicyCacheForeachFunc)     (PolKitPolicyCache *policy_cache,
                                                         PolKitPolicyFileEntry *entry,
                                                         void *user_data);
PolKitPolicyCache*  polkit_policy_cache_ref             (PolKitPolicyCache *policy_cache);
void                polkit_policy_cache_unref           (PolKitPolicyCache *policy_cache);
void                polkit_policy_cache_debug           (PolKitPolicyCache *policy_cache);
PolKitPolicyFileEntry* polkit_policy_cache_get_entry    (PolKitPolicyCache *policy_cache,
                                                         PolKitAction *action);
PolKitPolicyFileEntry* polkit_policy_cache_get_entry_by_id
                                                        (PolKitPolicyCache *policy_cache,
                                                         const char *action_id);
void                polkit_policy_cache_foreach         (PolKitPolicyCache *policy_cache,
                                                         PolKitPolicyCacheForeachFunc callback,
                                                         void *user_data);

Description

This class is used to hold all policy objects (stemming from policy files) and provide look-up functions.

Details

PolKitPolicyCache

typedef struct _PolKitPolicyCache PolKitPolicyCache;

Instances of this class are used to hold all policy objects (stemming from policy files) and provide look-up functions.


PolKitPolicyCacheForeachFunc ()

void                (*PolKitPolicyCacheForeachFunc)     (PolKitPolicyCache *policy_cache,
                                                         PolKitPolicyFileEntry *entry,
                                                         void *user_data);

Callback function for polkit_policy_cache_foreach().

policy_cache :

the policy cache

entry :

an entry in the cache - do not unref

user_data :

user data passed to polkit_policy_cache_foreach()

polkit_policy_cache_ref ()

PolKitPolicyCache*  polkit_policy_cache_ref             (PolKitPolicyCache *policy_cache);

Increase reference count.

policy_cache :

the policy cache object

Returns :

the object

polkit_policy_cache_unref ()

void                polkit_policy_cache_unref           (PolKitPolicyCache *policy_cache);

Decreases the reference count of the object. If it becomes zero, the object is freed. Before freeing, reference counts on embedded objects are decresed by one.

policy_cache :

the policy cache object

polkit_policy_cache_debug ()

void                polkit_policy_cache_debug           (PolKitPolicyCache *policy_cache);

Print debug information about object

policy_cache :

the cache

polkit_policy_cache_get_entry ()

PolKitPolicyFileEntry* polkit_policy_cache_get_entry    (PolKitPolicyCache *policy_cache,
                                                         PolKitAction *action);

Given a action, find the object describing the definition of the policy; e.g. data stemming from files in /usr/share/PolicyKit/policy.

policy_cache :

the cache

action :

the action

Returns :

A PolKitPolicyFileEntry entry on sucess; otherwise NULL if the action wasn't identified. Caller shall not unref this object.

polkit_policy_cache_get_entry_by_id ()

PolKitPolicyFileEntry* polkit_policy_cache_get_entry_by_id
                                                        (PolKitPolicyCache *policy_cache,
                                                         const char *action_id);

Given a action identifier, find the object describing the definition of the policy; e.g. data stemming from files in /usr/share/PolicyKit/policy.

policy_cache :

the cache

action_id :

the action identifier

Returns :

A PolKitPolicyFileEntry entry on sucess; otherwise NULL if the action wasn't identified. Caller shall not unref this object.

polkit_policy_cache_foreach ()

void                polkit_policy_cache_foreach         (PolKitPolicyCache *policy_cache,
                                                         PolKitPolicyCacheForeachFunc callback,
                                                         void *user_data);

Visit all entries in the policy cache.

policy_cache :

the policy cache

callback :

callback function

user_data :

user data to pass to callback function