Example #1
0
char *concat_dep_list (alpm_list_t *deps)
{
	alpm_list_t *i, *deps_str = NULL;
	char *ret;
	for (i=deps; i; i = alpm_list_next (i))
		deps_str = alpm_list_add (deps_str, alpm_dep_compute_string (i->data));
	ret = concat_str_list (deps_str);
	FREELIST (deps_str);
	return ret;
}
Example #2
0
char *concat_backup_list (alpm_list_t *backups)
{
	alpm_list_t *i, *backups_str = NULL;
	char *ret;
	char *b_str;
	alpm_backup_t *backup;
	for (i=backups; i; i = alpm_list_next (i))
	{
		backup = i->data;
		asprintf (&b_str, "%s\t%s", backup->name, backup->hash);
		backups_str = alpm_list_add (backups_str, b_str);
	}
	ret = concat_str_list (backups_str);
	FREELIST (backups_str);
	return ret;
}
Example #3
0
char *concat_backup_list (const alpm_list_t *backups)
{
	alpm_list_t *backups_str = NULL;
	for (const alpm_list_t *i = backups; i; i = alpm_list_next (i)) {
		const alpm_backup_t *backup = i->data;
		if (backup) {
			char *b_str;
			int ret = asprintf (&b_str, "%s\t%s", backup->name, backup->hash);
			if (!b_str || ret < 0) {
				continue;
			}
			backups_str = alpm_list_add (backups_str, b_str);
		}
	}
	char *ret = concat_str_list (backups_str);
	FREELIST (backups_str);
	return ret;
}