const char *base, const char *key,
snd_config_t **result);
+int _snd_conf_generic_id(const char *id);
+
#endif
#ifndef DOC_HIDDEN
SND_DLSYM_BUILD_VERSION(snd_func_refer, SND_CONFIG_DLSYM_VERSION_EVALUATE);
#endif
+
+#ifndef DOC_HIDDEN
+int _snd_conf_generic_id(const char *id)
+{
+ static const char ids[3][8] = { "comment", "type", "hint" };
+ unsigned int k;
+ for (k = 0; k < sizeof(ids) / sizeof(ids[0]); ++k) {
+ if (strcmp(id, ids[k]) == 0)
+ return 1;
+ }
+ return 0;
+}
+#endif
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
+ if (_snd_conf_generic_id(id))
continue;
if (strcmp(id, "card") == 0) {
err = snd_config_get_integer(n, &card);
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
- continue;
+ if (_snd_conf_generic_id(id))
if (strcmp(id, "server") == 0) {
err = snd_config_get_string(n, &server);
if (err < 0) {
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
+ if (_snd_conf_generic_id(id))
continue;
if (strcmp(id, "host") == 0)
continue;
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
+ if (_snd_conf_generic_id(id))
continue;
if (strcmp(id, "card") == 0) {
err = snd_config_get_integer(n, &card);
return err;
}
-
-int snd_pcm_conf_generic_id(const char *id)
-{
- static const char ids[3][8] = { "comment", "type", "hint" };
- unsigned int k;
- for (k = 0; k < sizeof(ids) / sizeof(ids[0]); ++k) {
- if (strcmp(id, ids[k]) == 0)
- return 1;
- }
- return 0;
-}
-
static void snd_pcm_set_ptr(snd_pcm_t *pcm, snd_pcm_rbptr_t *rbptr,
volatile snd_pcm_uframes_t *hw_ptr, int fd, off_t offset)
{
snd1_pcm_areas_from_bufs
#define snd_pcm_open_named_slave \
snd1_pcm_open_named_slave
-#define snd_pcm_conf_generic_id \
- snd1_pcm_conf_generic_id
#define snd_pcm_hw_open_fd \
snd1_pcm_hw_open_fd
#define snd_pcm_wait_nocheck \
return snd_pcm_open_named_slave(pcmp, NULL, root, conf, stream,
mode, parent_conf);
}
-int snd_pcm_conf_generic_id(const char *id);
+
+#define snd_pcm_conf_generic_id(id) _snd_conf_generic_id(id)
int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name, int fd, int mmap_emulation, int sync_ptr_ioctl);
int __snd_pcm_mmap_emul_open(snd_pcm_t **pcmp, const char *name,
assert(buffer || size == 0);
return (rawmidi->ops->read)(rawmidi, buffer, size);
}
-
-#ifndef DOC_HIDDEN
-int snd_rawmidi_conf_generic_id(const char *id)
-{
- static const char ids[][8] = {
- "comment",
- "type",
- "hint",
- };
- unsigned int k;
-
- for (k = 0; k < sizeof ids / sizeof *ids; ++k) {
- if (strcmp(id, ids[k]) == 0)
- return 1;
- }
- return 0;
-}
-#endif
const char *name, snd_seq_t *seq_handle, int port,
int merge, int mode);
-int snd_rawmidi_conf_generic_id(const char *id);
+#define snd_rawmidi_conf_generic_id(id) _snd_conf_generic_id(id)
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
+ if (_snd_conf_generic_id(id))
continue;
return -EINVAL;
}
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
+ if (_snd_conf_generic_id(id))
continue;
if (strcmp(id, "class") == 0) {
err = snd_config_get_integer(n, &dev_class);
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
- if (strcmp(id, "comment") == 0)
- continue;
- if (strcmp(id, "type") == 0)
+ if (_snd_conf_generic_id(id))
continue;
SNDERR("Unexpected field %s", id);
return -EINVAL;