PolicyKit Library Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Synopsis
PolKitPolicyCache; polkit_bool_t (*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); PolKitPolicyFileEntry* polkit_policy_cache_get_entry_by_annotation (PolKitPolicyCache *policy_cache, const char *annotation_key, const char *annotation_value); polkit_bool_t 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 ()
polkit_bool_t (*PolKitPolicyCacheForeachFunc) (PolKitPolicyCache *policy_cache, PolKitPolicyFileEntry *entry, void *user_data);
Callback function for polkit_policy_cache_foreach()
.
|
the policy cache |
|
an entry in the cache - do not unref |
|
user data passed to polkit_policy_cache_foreach()
|
Returns : |
TRUE to short-circuit; e.g. stop the iteration |
polkit_policy_cache_ref ()
PolKitPolicyCache * polkit_policy_cache_ref (PolKitPolicyCache *policy_cache);
Increase reference count.
|
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.
|
the policy cache object |
polkit_policy_cache_debug ()
void polkit_policy_cache_debug (PolKitPolicyCache *policy_cache);
Print debug information about object
|
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.
|
the cache |
|
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.
|
the cache |
|
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_get_entry_by_annotation ()
PolKitPolicyFileEntry* polkit_policy_cache_get_entry_by_annotation (PolKitPolicyCache *policy_cache, const char *annotation_key, const char *annotation_value);
Find the first policy file entry where a given annotation matches a given value. Note that there is nothing preventing the existence of multiple policy file entries matching this criteria; it would however be a packaging bug if this situation occured.
|
the policy cache |
|
the key to check for |
|
the value to check for |
Returns : |
The first PolKitPolicyFileEntry matching the search criteria. The caller shall not unref this object. Returns NULL if there are no policy file entries matching the search criteria. |
Since 0.7
polkit_policy_cache_foreach ()
polkit_bool_t polkit_policy_cache_foreach (PolKitPolicyCache *policy_cache, PolKitPolicyCacheForeachFunc callback, void *user_data);
Visit all entries in the policy cache.
|
the policy cache |
|
callback function |
|
user data to pass to callback function |
Returns : |
TRUE only if iteration was short-circuited |