コード例 #1
0
ファイル: polkitunixgroup.c プロジェクト: Distrotech/polkit
/**
 * polkit_unix_group_new:
 * @gid: A UNIX group id.
 *
 * Creates a new #PolkitUnixGroup object for @gid.
 *
 * Returns: (transfer full): A #PolkitUnixGroup object. Free with g_object_unref().
 */
PolkitIdentity *
polkit_unix_group_new (gint gid)
{
  return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_GROUP,
                                       "gid", gid,
                                       NULL));
}
コード例 #2
0
/**
 * polkit_unix_netgroup_new:
 * @name: A netgroup name.
 *
 * Creates a new #PolkitUnixNetgroup object for @name.
 *
 * Returns: (transfer full): A #PolkitUnixNetgroup object. Free with g_object_unref().
 */
PolkitIdentity *
polkit_unix_netgroup_new (const gchar *name)
{
  g_return_val_if_fail (name != NULL, NULL);
  return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP,
                                       "name", name,
                                       NULL));
}
コード例 #3
0
static gint
compare_users (gconstpointer a, gconstpointer b)
{
	char *user;
	int ret;

	if (POLKIT_IS_UNIX_USER (a))
		user = g_strdup (polkit_unix_user_get_name (POLKIT_UNIX_USER (a)));
	else
		user = polkit_identity_to_string (POLKIT_IDENTITY (a));

	ret = g_strcmp0 ((const char *) user, (const char *) b);
	g_free (user);
	return ret;
}