## Policy Definition Files Policy Definition Files — Represents a set of declared actions. |

## Synopsis

                        PolKitPolicyFile;
    polkit_bool_t       (*PolKitPolicyFileEntryForeachFunc) (PolKitPolicyFile *policy_file,
                                                             PolKitPolicyFileEntry *policy_file_entry,
                                                             void *user_data);
    PolKitPolicyFile *  polkit_policy_file_new              (const char *path,
                                                             polkit_bool_t load_descriptions,
                                                             PolKitError **error);
    PolKitPolicyFile *  polkit_policy_file_ref              (PolKitPolicyFile *policy_file);
    void                polkit_policy_file_unref            (PolKitPolicyFile *policy_file);
    polkit_bool_t       polkit_policy_file_entry_foreach    (PolKitPolicyFile *policy_file,
                                                             PolKitPolicyFileEntryForeachFunc cb,
                                                             void *user_data);

## Description

This class is used to represent a policy file.

## Details

### PolKitPolicyFile

    typedef struct _PolKitPolicyFile PolKitPolicyFile;

Objects of this class are used to record information about a policy file.

### PolKitPolicyFileEntryForeachFunc ()

    polkit_bool_t       (*PolKitPolicyFileEntryForeachFunc) (PolKitPolicyFile *policy_file,
                                                             PolKitPolicyFileEntry *policy_file_entry,
                                                             void *user_data);

Type for function used in `polkit_policy_file_entry_foreach()`.

`policy_file` : | the policy file
`policy_file_entry` : | the entry
`user_data` : | user data
Returns : | TRUE to short-circuit, e.g. stop the iteration

### polkit_policy_file_new ()

    PolKitPolicyFile *  polkit_policy_file_new              (const char *path,
                                                             polkit_bool_t load_descriptions,
                                                             PolKitError **error);

Load a policy file.

`path` : | path to file
`load_descriptions` : | whether descriptions should be loaded
`error` : | Return location for error
Returns : | The new object or NULL if error is set

### polkit_policy_file_ref ()

    PolKitPolicyFile *  polkit_policy_file_ref              (PolKitPolicyFile *policy_file);

Increase reference count.

`policy_file` : | the policy file object
Returns : | the object

### polkit_policy_file_unref ()

    void                polkit_policy_file_unref            (PolKitPolicyFile *policy_file);

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_file` : | the policy file object

### polkit_policy_file_entry_foreach ()

    polkit_bool_t       polkit_policy_file_entry_foreach    (PolKitPolicyFile *policy_file,
                                                             PolKitPolicyFileEntryForeachFunc cb,
                                                             void *user_data);

Visits all entries in a policy file.

`policy_file` : | the policy file object
`cb` : | callback to invoke for each entry
`user_data` : | user data
Returns : | TRUE if the iteration was short-circuited