| PolicyKit Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | Known Implementations | ||||
PolkitSubject; struct PolkitSubjectIface; guint polkit_subject_hash (PolkitSubject *subject); gboolean polkit_subject_equal (PolkitSubject *a,PolkitSubject *b); void polkit_subject_exists (PolkitSubject *subject,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean polkit_subject_exists_finish (PolkitSubject *subject,GAsyncResult *res,GError **error); gboolean polkit_subject_exists_sync (PolkitSubject *subject,GCancellable *cancellable,GError **error); gchar * polkit_subject_to_string (PolkitSubject *subject); PolkitSubject * polkit_subject_from_string (const gchar *str,GError **error);
PolkitSubject is implemented by PolkitSystemBusName, PolkitUnixProcess and PolkitUnixSession.
typedef struct _PolkitSubject PolkitSubject;
Generic type for all objects that can be used as subjects.
struct PolkitSubjectIface {
GTypeInterface parent_iface;
guint (*hash) (PolkitSubject *subject);
gboolean (*equal) (PolkitSubject *a,
PolkitSubject *b);
gchar * (*to_string) (PolkitSubject *subject);
void (*exists) (PolkitSubject *subject,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*exists_finish) (PolkitSubject *subject,
GAsyncResult *res,
GError **error);
gboolean (*exists_sync) (PolkitSubject *subject,
GCancellable *cancellable,
GError **error);
};
An interface for subjects.
GTypeInterface |
The parent interface. |
| Gets a hash value for a PolkitSubject. | |
| Checks if two PolkitSubjects are equal. | |
Serializes a PolkitSubject to a string that can be
used in polkit_subject_from_string(). |
|
| Asynchronously check if a PolkitSubject exists. | |
| Finishes checking if a PolkitSubject exists. | |
| Synchronously check if a PolkitSubject exists. |
guint polkit_subject_hash (PolkitSubject *subject);
Gets a hash code for subject that can be used with e.g. g_hash_table_new().
|
A PolkitSubject. |
Returns : |
A hash code. |
gboolean polkit_subject_equal (PolkitSubject *a,PolkitSubject *b);
Checks if a and b are equal, ie. represent the same subject.
This function can be used in e.g. g_hash_table_new().
|
A PolkitSubject. |
|
A PolkitSubject. |
Returns : |
TRUE if a and b are equal, FALSE otherwise. |
void polkit_subject_exists (PolkitSubject *subject,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously checks if subject exists.
When the operation is finished, callback will be invoked in the
polkit_subject_exists_finish() to get the
result of the operation.
|
A PolkitSubject. |
|
A GCancellable or NULL. [allow-none]
|
|
A GAsyncReadyCallback to call when the request is satisfied |
|
The data to pass to callback. |
gboolean polkit_subject_exists_finish (PolkitSubject *subject,GAsyncResult *res,GError **error);
Finishes checking whether a subject exists.
|
A PolkitSubject. |
|
A GAsyncResult obtained from the GAsyncReadyCallback passed to polkit_subject_exists(). |
|
Return location for error or NULL. [allow-none]
|
Returns : |
TRUE if the subject exists, FALSE if not or error is set. |
gboolean polkit_subject_exists_sync (PolkitSubject *subject,GCancellable *cancellable,GError **error);
Checks if subject exists.
This is a synchronous blocking call - the calling thread is blocked
until a reply is received. See polkit_subject_exists() for the
asynchronous version.
|
A PolkitSubject. |
|
A GCancellable or NULL. [allow-none]
|
|
Return location for error or NULL. [allow-none]
|
Returns : |
TRUE if the subject exists, FALSE if not or error is set. |
gchar * polkit_subject_to_string (PolkitSubject *subject);
Serializes subject to a string that can be used in
polkit_subject_from_string().
|
A PolkitSubject. |
Returns : |
A string representing subject. Free with g_free(). |
PolkitSubject * polkit_subject_from_string (const gchar *str,GError **error);
Creates an object from str that implements the PolkitSubject
interface.
|
A string obtained from polkit_subject_to_string(). |
|
Return location for error or NULL. [allow-none]
|
Returns : |
A PolkitSubject or NULL if error is
set. Free with g_object_unref(). [transfer full]
|