[PATCH 1/4] config-parser: Document config_section_get_entry()
Bryce Harrington
bryce at osg.samsung.com
Tue Jan 20 15:30:29 PST 2015
From: "Bryce Harrington" <bryce at osg.samsung.com>
Signed-off-by: Bryce Harrington (http://osg.samsung.com) <bryce at osg.samsung.com>
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
---
shared/config-parser.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/shared/config-parser.c b/shared/config-parser.c
index 4542ca6..b72cb77 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -130,6 +130,27 @@ config_section_get_entry(struct weston_config_section *section,
return NULL;
}
+/** Lookup matching section from config
+ *
+ * \param config Configuration data source to look in
+ * \param section Look for a section with this name (required)
+ * \param key Only return section with this key set to value (optional)
+ * \param value Only return section with key set to this value (optional)
+ *
+ * Looks through the weston_config data structure for a
+ * weston_config_section named \c section, and returns the first match.
+ * If \c key and \c value are specified as non-NULL, then only sections which
+ * contain the exact key=value pair will be returned.
+ *
+ * Note that the matching is case-sensitive, and are performed as string
+ * comparisons for the values, so 'foo=1', 'Foo=1', and 'foo=1.0' are not
+ * considered matches.
+ *
+ * \return a weston_config_section pointer matching criteria, or NULL if no
+ * match was found or an error occurred.
+ *
+ * /memberof weston_config
+ */
WL_EXPORT
struct weston_config_section *
weston_config_get_section(struct weston_config *config, const char *section,
--
1.9.1
More information about the wayland-devel
mailing list