From: Andrew Eikum <aeikum@codeweavers.com>
To: alsa-devel <alsa-devel@alsa-project.org>
Subject: [alsa-lib PATCH 4/4] Improve snd_device_name_hint documentation
Date: Wed, 4 Jan 2012 14:11:49 -0600 [thread overview]
Message-ID: <20120104201149.GF9868@foghorn.codeweavers.com> (raw)
In-Reply-To: <a0053dfb39d22118fce92031e4d6adac948b02fc.1325707699.git.aeikum@codeweavers.com>
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
---
src/control/namehint.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
[-- Attachment #2: 0004-Improve-snd_device_name_hint-documentation.patch --]
[-- Type: text/x-patch, Size: 2676 bytes --]
diff --git a/src/control/namehint.c b/src/control/namehint.c
index faaa5d5..19352be 100644
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -517,15 +517,18 @@ static int add_software_devices(struct hint_list *list)
}
/**
- * \brief Return string list with device name hints.
+ * \brief Get a set of device name hints
* \param card Card number or -1 (means all cards)
* \param iface Interface identification (like "pcm", "rawmidi", "timer", "seq")
- * \param hints Result - array of string with device name hints
+ * \param hints Result - array of device name hints
* \result zero if success, otherwise a negative error code
*
- * Note: The device description is separated with '|' char.
+ * hints will receive a NULL-terminated array of device name hints,
+ * which can be passed to #snd_device_name_get_hint to extract usable
+ * values. When no longer needed, hints should be passed to
+ * #snd_device_name_free_hint to release resources.
*
- * User defined hints are gathered from namehint.IFACE tree like:
+ * User-defined hints are gathered from namehint.IFACE tree like:
*
* <code>
* namehint.pcm {<br>
@@ -534,6 +537,8 @@ static int add_software_devices(struct hint_list *list)
* }
* </code>
*
+ * Note: The device description is separated with '|' char.
+ *
* Special variables: defaults.namehint.showall specifies if all device
* definitions are accepted (boolean type).
*/
@@ -626,8 +631,8 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
}
/**
- * \brief Free a string list with device name hints.
- * \param hints A string list to free
+ * \brief Free a list of device name hints.
+ * \param hints List to free
* \result zero if success, otherwise a negative error code
*/
int snd_device_name_free_hint(void **hints)
@@ -646,16 +651,17 @@ int snd_device_name_free_hint(void **hints)
}
/**
- * \brief Get a hint Free a string list with device name hints.
+ * \brief Extract a value from a hint
* \param hint A pointer to hint
- * \param id Hint ID (see bellow)
+ * \param id Hint value to extract ("NAME", "DESC", or "IOID", see below)
* \result an allocated ASCII string if success, otherwise NULL
*
* List of valid IDs:
* NAME - name of device
* DESC - description of device
- * IOID - input / output identification (Input or Output strings),
- * not present (NULL) means both
+ * IOID - input / output identification ("Input" or "Output"), NULL means both
+ *
+ * The return value should be freed when no longer needed.
*/
char *snd_device_name_get_hint(const void *hint, const char *id)
{
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2012-01-04 20:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a0053dfb39d22118fce92031e4d6adac948b02fc.1325707699.git.aeikum@codeweavers.com>
2012-01-04 20:11 ` [alsa-lib PATCH 2/4] Search-and-replace improve documentation language Andrew Eikum
2012-01-05 6:43 ` Raymond Yau
2012-01-05 8:37 ` Clemens Ladisch
2012-01-04 20:11 ` [alsa-lib PATCH 3/4] Improve hw_params documentation Andrew Eikum
2012-01-04 20:11 ` Andrew Eikum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120104201149.GF9868@foghorn.codeweavers.com \
--to=aeikum@codeweavers.com \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).