mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
ucm: add '${LibCaps}' substitution
It is a preparation for future checking of alsa-lib's extensions. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
70f4c95df5
commit
d8300e5cb7
2 changed files with 18 additions and 1 deletions
|
|
@ -388,6 +388,7 @@ substituted. The substitutes strings are in the table bellow.
|
|||
|
||||
Substituted string | Value
|
||||
-----------------------|---------------------
|
||||
${LibCaps} | Library capabilities (string like '*a*b*c*') [**Syntax 8**]
|
||||
${OpenName} | Original UCM card name (passed to snd_use_case_mgr_open())
|
||||
${ConfLibDir} | Library top-level configuration directory (e.g. /usr/share/alsa)
|
||||
${ConfTopDir} | Top-level UCM configuration directory (e.g. /usr/share/alsa/ucm2)
|
||||
|
|
@ -433,6 +434,10 @@ Define.Bytes2 "${sys-card:[type=hex,pos=0x22]device/../descriptors}"
|
|||
Replace *type=hex* with *type=ascii* or omit this variable settings to work with ASCII characters.
|
||||
|
||||
|
||||
#### Library capabilities
|
||||
|
||||
None at the moment. The list will grow after *Syntax 8* (library 1.2.14).
|
||||
|
||||
#### Special whole string substitution
|
||||
|
||||
Substituted string | Value
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
* transition sequences, multiple client access and user defined use
|
||||
* cases was kindly sponsored by Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Copyright (C) 2019 Red Hat Inc.
|
||||
* Copyright (C) 2019-2025 Red Hat Inc.
|
||||
* Authors: Jaroslav Kysela <perex@perex.cz>
|
||||
*/
|
||||
|
||||
|
|
@ -30,8 +30,19 @@
|
|||
#include <limits.h>
|
||||
#include <regex.h>
|
||||
|
||||
/* capabilities string like "*a*b*c" will be used to check library extensions */
|
||||
/* use Needle like "*a*" or regex expression for a match */
|
||||
#define LIB_CAPS_STRING "*" "*"
|
||||
|
||||
static unsigned char _hex_table[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
static char *rval_lib_caps(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (uc_mgr->conf_format < 8)
|
||||
return NULL;
|
||||
return strdup(LIB_CAPS_STRING);
|
||||
}
|
||||
|
||||
static char *rval_open_name(snd_use_case_mgr_t *uc_mgr)
|
||||
{
|
||||
const char *name;
|
||||
|
|
@ -883,6 +894,7 @@ __std:
|
|||
goto __std;
|
||||
}
|
||||
fcn2 = NULL;
|
||||
MATCH_VARIABLE(value, "${LibCaps}", rval_lib_caps, false);
|
||||
MATCH_VARIABLE(value, "${OpenName}", rval_open_name, false);
|
||||
MATCH_VARIABLE(value, "${ConfLibDir}", rval_conf_libdir, false);
|
||||
MATCH_VARIABLE(value, "${ConfTopDir}", rval_conf_topdir, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue