| Top |
| guint | polkit_subject_hash () |
| gboolean | polkit_subject_equal () |
| void | polkit_subject_exists () |
| gboolean | polkit_subject_exists_finish () |
| gboolean | polkit_subject_exists_sync () |
| gchar * | polkit_subject_to_string () |
| PolkitSubject * | polkit_subject_from_string () |
PolkitSubject is implemented by PolkitSystemBusName, PolkitUnixProcess and PolkitUnixSession.
guint
polkit_subject_hash (PolkitSubject *subject);
Gets a hash code for subject
that can be used with e.g. g_hash_table_new().
gboolean polkit_subject_equal (PolkitSubject *a,PolkitSubject *b);
Checks if a
and b
are equal, ie. represent the same subject.
However, avoid calling polkit_subject_equal() to compare two processes;
for more information see the PolkitUnixProcess documentation.
This function can be used in e.g. g_hash_table_new().
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
from. You can then call polkit_subject_exists_finish() to get the
result of the operation.
gboolean polkit_subject_exists_finish (PolkitSubject *subject,GAsyncResult *res,GError **error);
Finishes checking whether a subject exists.
subject |
||
res |
A GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
[allow-none] |
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.
gchar *
polkit_subject_to_string (PolkitSubject *subject);
Serializes subject
to a string that can be used in
polkit_subject_from_string().
PolkitSubject * polkit_subject_from_string (const gchar *str,GError **error);
Creates an object from str
that implements the PolkitSubject
interface.
str |
A string obtained from |
|
error |
Return location for error or |
[allow-none] |
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.
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 |
||
Asynchronously check if a PolkitSubject exists. |
||
Finishes checking if a PolkitSubject exists. |
||
Synchronously check if a PolkitSubject exists. |