예제 #1
0
파일: database.c 프로젝트: juster/ruby-alpm
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;
}
예제 #2
0
/**
 * 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);
}