PolkitSubject

PolkitSubject — Type for representing subjects

Synopsis

                    PolkitSubject;
                    PolkitSubjectIface;
guint               polkit_subject_hash                 (PolkitSubject *subject);
gboolean            polkit_subject_equal                (PolkitSubject *a,
                                                         PolkitSubject *b);
gchar *             polkit_subject_to_string            (PolkitSubject *subject);
PolkitSubject *     polkit_subject_from_string          (const gchar *str,
                                                         GError **error);

Object Hierarchy

  GInterface
   +----PolkitSubject

Prerequisites

PolkitSubject requires GObject.

Known Implementations

PolkitSubject is implemented by PolkitUnixProcess, PolkitSystemBusName and PolkitUnixSession.

Description

PolkitSubject is an abstract type for representing one or more processes.

Details

PolkitSubject

typedef struct _PolkitSubject PolkitSubject;

Generic type for all objects that can be used as subjects.


PolkitSubjectIface

typedef struct {
  GTypeInterface parent_iface;

  guint    (*hash)      (PolkitSubject *subject);

  gboolean (*equal)     (PolkitSubject *a,
                         PolkitSubject *b);

  gchar *  (*to_string) (PolkitSubject *subject);
} PolkitSubjectIface;

An interface for subjects.

GTypeInterface parent_iface;

The parent interface.

hash ()

Gets a hash value for a PolkitSubject.

equal ()

Checks if two PolkitSubjects are equal.

to_string ()

Serializes a PolkitSubject to a string that can be used in polkit_subject_from_string().

polkit_subject_hash ()

guint               polkit_subject_hash                 (PolkitSubject *subject);

Gets a hash code for subject that can be used with e.g. g_hash_table_new().

subject :

A PolkitSubject.

Returns :

A hash code.

polkit_subject_equal ()

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 :

A PolkitSubject.

b :

A PolkitSubject.

Returns :

TRUE if a and b are equal, FALSE otherwise.

polkit_subject_to_string ()

gchar *             polkit_subject_to_string            (PolkitSubject *subject);

Serializes subject to a string that can be used in polkit_subject_from_string().

subject :

A PolkitSubject.

Returns :

A string representing subject. Free with g_free().

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 polkit_subject_to_string().

error :

Return location for error.

Returns :

A PolkitSubject or NULL if error is set. Free with g_object_unref().