VALUE db_groups ( VALUE self ) { alpm_list_t * iter; INITDBPTR; VALUE grphash = rb_hash_new(); iter = alpm_db_get_grpcache( db ); while ( iter != NULL ) { pmgrp_t * grp = alpm_list_getdata( iter ); VALUE grpname = rb_str_new2( alpm_grp_get_name( grp )); VALUE pkgs = alpmpkglist_to_ary( alpm_grp_get_pkgs( grp )); rb_hash_aset( grphash, grpname, pkgs ); iter = alpm_list_next( iter ); } return grphash; }
/** * pacman_group_get_name: * @group: A #PacmanGroup. * * Gets the name of @group. * * Returns: A group name. Do not free. */ const gchar *pacman_group_get_name (PacmanGroup *group) { g_return_val_if_fail (group != NULL, NULL); return alpm_grp_get_name (group); }