return iface_type;
}
+guint
+polkit_identity_hash (PolkitIdentity *identity)
+{
+ return POLKIT_IDENTITY_GET_IFACE (identity)->hash (identity);
+}
+
gboolean
polkit_identity_equal (PolkitIdentity *a,
PolkitIdentity *b)
{
GTypeInterface parent_iface;
+ guint (*hash) (PolkitIdentity *identity);
+
gboolean (*equal) (PolkitIdentity *a,
PolkitIdentity *b);
};
GType polkit_identity_get_type (void) G_GNUC_CONST;
+guint polkit_identity_hash (PolkitIdentity *a);
gboolean polkit_identity_equal (PolkitIdentity *a,
PolkitIdentity *b);
gchar *polkit_identity_to_string (PolkitIdentity *identity);
return identity;
}
+static guint
+polkit_unix_group_hash (PolkitIdentity *identity)
+{
+ PolkitUnixGroup *group;
+
+ group = POLKIT_UNIX_GROUP (identity);
+
+ return g_direct_hash (GINT_TO_POINTER (((gint) (group->gid)) * 2 + 1));
+}
+
static gboolean
polkit_unix_group_equal (PolkitIdentity *a,
PolkitIdentity *b)
static void
identity_iface_init (PolkitIdentityIface *identity_iface)
{
+ identity_iface->hash = polkit_unix_group_hash;
identity_iface->equal = polkit_unix_group_equal;
identity_iface->to_string = polkit_unix_group_to_string;
}
return user_a->uid == user_b->uid;
}
+static guint
+polkit_unix_user_hash (PolkitIdentity *identity)
+{
+ PolkitUnixUser *user;
+
+ user = POLKIT_UNIX_USER (identity);
+
+ return g_direct_hash (GINT_TO_POINTER (((gint) (user->uid)) * 2));
+}
+
static gchar *
polkit_unix_user_to_string (PolkitIdentity *identity)
{
static void
identity_iface_init (PolkitIdentityIface *identity_iface)
{
+ identity_iface->hash = polkit_unix_user_hash;
identity_iface->equal = polkit_unix_user_equal;
identity_iface->to_string = polkit_unix_user_to_string;
}