|  |  |  | PolicyKit Library Reference Manual |  | 
|---|---|---|---|---|
                    PolKitAction;
PolKitAction*       polkit_action_new                   (void);
PolKitAction*       polkit_action_ref                   (PolKitAction *action);
void                polkit_action_unref                 (PolKitAction *action);
polkit_bool_t       polkit_action_set_action_id         (PolKitAction *action,
                                                         const char *action_id);
polkit_bool_t       polkit_action_get_action_id         (PolKitAction *action,
                                                         char **out_action_id);
void                polkit_action_debug                 (PolKitAction *action);
polkit_bool_t       polkit_action_validate              (PolKitAction *action);
polkit_bool_t       polkit_action_validate_id           (const char *action_id);
polkit_bool_t       polkit_action_equal                 (PolKitAction *a,
                                                         PolKitAction *b);
const char*         polkit_action_to_string_representation
                                                        (PolKitAction *action);
PolKitAction*       polkit_action_new_from_string_representation
                                                        (const char *str);
typedef struct _PolKitAction PolKitAction;
Objects of this class are used to record information about an action.
PolKitAction* polkit_action_new (void);
Create a new PolKitAction object.
| Returns: | the new object | 
PolKitAction* polkit_action_ref (PolKitAction *action);
Increase reference count.
| 
 | the action object | 
| Returns: | the object | 
void polkit_action_unref (PolKitAction *action);
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 action object | 
polkit_bool_t polkit_action_set_action_id (PolKitAction *action, const char *action_id);
Set the action identifier
| 
 | the action object | 
| 
 | action identifier | 
| Returns: | TRUE only if the value validated and was set | 
polkit_bool_t polkit_action_get_action_id (PolKitAction *action, char **out_action_id);
Get the action identifier.
| 
 | the action object | 
| 
 | Returns the action identifier. The caller shall not free this string. | 
| Returns: | TRUE iff the value was returned. | 
void polkit_action_debug (PolKitAction *action);
Print debug details
| 
 | the object | 
polkit_bool_t polkit_action_validate (PolKitAction *action);
Validate the object
| 
 | the object | 
| Returns: | TRUE iff the object is valid. | 
polkit_bool_t polkit_action_validate_id (const char *action_id);
Validate whether an action identifier is well formed. To be well formed, an action identifier needs to start with a lower case ASCII character and can only contain the characters "[a-z][0-9].-". It must be less than or equal 256 bytes in length including the terminating NUL character.
| 
 | the action identifier to validate | 
| Returns: | TRUE iff the action identifier is well formed | 
polkit_bool_t polkit_action_equal (PolKitAction *a, PolKitAction *b);
Test if a and b refer to the same action.
| 
 | first action | 
| 
 | second action | 
| Returns: | TRUE iff aandbrefer to the same action. | 
Since 0.8
const char*         polkit_action_to_string_representation
                                                        (PolKitAction *action);
Serializes action into a textual form that can be transferred from
process to process or saved on disk. Use
polkit_action_new_from_string_representation() to deserialize it.
| 
 | the action object | 
| Returns: | A string representation of actionor NULL if the action
is not valid. String is valid untilactionis freed. | 
Since 0.8
PolKitAction* polkit_action_new_from_string_representation (const char *str);
Creates a new PolKitAction object from a textual representation.
| 
 | textual representation of an action; typically obtained from polkit_action_to_string_representation() | 
| Returns: | A new PolKitAction object or NULL if OOM or if the
representation isn't valid. Caller must free this object with polkit_action_unref(). | 
Since 0.8