Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
more conversions from utlist to tllist
Baptiste Daroussin committed 4 years ago
commit 2fd33681a94798207be0f2a8598977c60c9741c5
parent 6445397
2 files changed +6 -7
modified libpkg/pkg_ports.c
@@ -507,7 +507,7 @@ populate_keywords(struct plist *p)
		a = xmalloc(sizeof(struct action));
		k->keyword = xstrdup(keyacts[i].key);
		a->perform = keyacts[i].action;
-
		DL_APPEND(k->actions, a);
+
		tll_push_back(k->actions, a);
		pkghash_safe_add(p->keywords, k->keyword, k, NULL);
	}
}
@@ -516,7 +516,7 @@ static void
keyword_free(struct keyword *k)
{
	free(k->keyword);
-
	DL_FREE(k->actions, free);
+
	tll_free_and_free(k->actions, free);
	free(k);
}

@@ -888,7 +888,6 @@ parse_keywords(struct plist *plist, char *keyword,
    char *line, struct file_attr *attr)
{
	struct keyword *k = NULL;
-
	struct action *a;
	int ret = EPKG_FATAL;

	/* if keyword is empty consider it as a file */
@@ -897,8 +896,8 @@ parse_keywords(struct plist *plist, char *keyword,

	k = pkghash_get_value(plist->keywords, keyword);
	if (k != NULL) {
-
		LL_FOREACH(k->actions, a) {
-
			ret = a->perform(plist, line, attr);
+
		tll_foreach(k->actions, a) {
+
			ret = a->item->perform(plist, line, attr);
			if (ret != EPKG_OK)
				break;
		}
modified libpkg/private/pkg.h
@@ -518,9 +518,10 @@ struct pkg_repo {
	struct pkg_repo *next, *prev;
};

+
typedef tll(struct action *) actions_t;
struct keyword {
	char *keyword;
-
	struct action *actions;
+
	actions_t actions;
};

struct plist {
@@ -559,7 +560,6 @@ struct file_attr {

struct action {
	int (*perform)(struct plist *, char *, struct file_attr *);
-
	struct action *next, *prev;
};

/* sql helpers */