return iface_type;
}
+guint
+polkit_subject_hash (PolkitSubject *subject)
+{
+ return POLKIT_SUBJECT_GET_IFACE (subject)->hash (subject);
+}
+
gboolean
polkit_subject_equal (PolkitSubject *a,
PolkitSubject *b)
{
GTypeInterface parent_iface;
+ guint (*hash) (PolkitSubject *subject);
+
gboolean (*equal) (PolkitSubject *a,
PolkitSubject *b);
};
GType polkit_subject_get_type (void) G_GNUC_CONST;
+guint polkit_subject_hash (PolkitSubject *subject);
gboolean polkit_subject_equal (PolkitSubject *a,
PolkitSubject *b);
gchar *polkit_subject_to_string (PolkitSubject *subject);
NULL));
}
+static guint
+polkit_system_bus_name_hash (PolkitSubject *subject)
+{
+ PolkitSystemBusName *system_bus_name = POLKIT_SYSTEM_BUS_NAME (subject);
+
+ return g_str_hash (system_bus_name->name);
+}
+
static gboolean
polkit_system_bus_name_equal (PolkitSubject *a,
PolkitSubject *b)
static void
subject_iface_init (PolkitSubjectIface *subject_iface)
{
+ subject_iface->hash = polkit_system_bus_name_hash;
subject_iface->equal = polkit_system_bus_name_equal;
subject_iface->to_string = polkit_system_bus_name_to_string;
}
return POLKIT_SUBJECT (process);
}
+static guint
+polkit_unix_process_hash (PolkitSubject *subject)
+{
+ PolkitUnixProcess *process = POLKIT_UNIX_PROCESS (subject);
+
+ return g_direct_hash (GINT_TO_POINTER ((process->pid + process->start_time))) ;
+}
static gboolean
polkit_unix_process_equal (PolkitSubject *a,
static void
subject_iface_init (PolkitSubjectIface *subject_iface)
{
+ subject_iface->hash = polkit_unix_process_hash;
subject_iface->equal = polkit_unix_process_equal;
subject_iface->to_string = polkit_unix_process_to_string;
}
NULL));
}
+static guint
+polkit_unix_session_hash (PolkitSubject *subject)
+{
+ PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
+
+ return g_str_hash (session->session_id);
+}
+
static gboolean
polkit_unix_session_equal (PolkitSubject *a,
PolkitSubject *b)
static void
subject_iface_init (PolkitSubjectIface *subject_iface)
{
+ subject_iface->hash = polkit_unix_session_hash;
subject_iface->equal = polkit_unix_session_equal;
subject_iface->to_string = polkit_unix_session_to_string;
}