Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Move HASH_FREE to private/pkg.h to allow reuse
Baptiste Daroussin committed 13 years ago
commit 419e47b20ea93832409e3ba0f2b473c03bb708b2
parent 9d981cf2260f00cb20bf20f3873996fed73df7b1
2 files changed +11 -11
modified libpkg/pkg.c
@@ -368,17 +368,6 @@ pkg_set_from_file(struct pkg *pkg, pkg_attr attr, const char *path)
	return (ret);
}

-
#define HASH_NEXT(hash, data) do {            \
-
		if (data == NULL)             \
-
			data = hash;          \
-
		else                          \
-
			data = data->hh.next; \
-
		if (data == NULL)             \
-
			return (EPKG_END);    \
-
		else                          \
-
			return (EPKG_OK);     \
-
	} while (0)
-

int
pkg_licenses(struct pkg *pkg, struct pkg_license **l)
{
modified libpkg/private/pkg.h
@@ -58,6 +58,17 @@
	data = NULL;                               \
} while (0)

+
#define HASH_NEXT(hash, data) do {            \
+
		if (data == NULL)             \
+
			data = hash;          \
+
		else                          \
+
			data = data->hh.next; \
+
		if (data == NULL)             \
+
			return (EPKG_END);    \
+
		else                          \
+
			return (EPKG_OK);     \
+
	} while (0)
+

#define LIST_FREE(head, data, free_func) do { \
	while (!STAILQ_EMPTY(head)) { \
		data = STAILQ_FIRST(head); \