Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add default_value and description files to struct pkg_option, plus accessor functions.
Matthew Seaman committed 12 years ago
commit a032d5f939faf19b4d10d0f5759cdabf22a79dee
parent 22295e9
2 files changed +20 -0
modified libpkg/pkg_attributes.c
@@ -382,6 +382,8 @@ pkg_option_free(struct pkg_option *option)

	sbuf_free(option->key);
	sbuf_free(option->value);
+
	sbuf_free(option->default_value);
+
	sbuf_free(option->description);
	free(option);
}

@@ -401,6 +403,22 @@ pkg_option_value(struct pkg_option const * const option)
	return (sbuf_get(option->value));
}

+
const char *
+
pkg_option_default_value(struct pkg_option const * const option)
+
{
+
	assert(option != NULL);
+

+
	return (sbuf_get(option->default_value));
+
}
+

+
const char *
+
pkg_option_description(struct pkg_option const * const option)
+
{
+
	assert(option != NULL);
+

+
	return (sbuf_get(option->description));
+
}
+

/*
 * Shared Libraries
 */
modified libpkg/private/pkg.h
@@ -180,6 +180,8 @@ struct pkg_dir {
struct pkg_option {
	struct sbuf	*key;
	struct sbuf	*value;
+
	struct sbuf	*default_value;
+
	struct sbuf	*description;
	UT_hash_handle	hh;
};