![](https://secure.gravatar.com/avatar/6d5d12866bad6e4adbc6a1473ad36548.jpg?s=120&d=mm&r=g)
On 6/19/2024 5:28 PM, Takashi Iwai wrote:
For making it easer for applications to create a virtual UMP Endpoint and UMP blocks, add two API helper functions.
snd_seq_create_ump_endpoint() creates (unsurprisingly) a UMP Endpoint, based on the given snd_ump_endpoint_info_t information. The number of (max) UMP groups belonging to this Endpoint has to be specified. This function sets up the Endpoint info on the sequencer client, and creates a MIDI 2.0 UMP port as well as UMP Group ports automatically. The name of the sequencer client is updated from the Endpoint name, too.
After creating a UMP Endpoint, create each UMP Block via snd_seq_create_ump_block() function with a snd_ump_block_info_t info. The associated groups for each block have to be specified there. The port names and capability bits are updated accordingly after setting each block information.
Signed-off-by: Takashi Iwai tiwai@suse.de
...
if (*blknames) {
strlcat(blknames, ", ", sizeof(blknames));
strlcat(blknames, (const char *)bp->name,
sizeof(blknames));
FYI, this seems to introduce build problems on systems that do not have strlcpy:
During build: seqmid.c: In function ‘update_group_ports’: seqmid.c:672:33: warning: implicit declaration of function ‘strlcat’; did you mean ‘strncat’? [-Wimplicit-function-declaration] 672 | strlcat(blknames, ", ", sizeof(blknames)); | ^~~~~~~ | strncat
And then during linking: /usr/bin/ld: seq/.libs/libseq.a(seqmid.o): in function `update_group_ports': /home/amade/workdir/avs/alsa-lib/src/seq/seqmid.c:672: undefined reference to `strlcat' /usr/bin/ld: /home/amade/workdir/avs/alsa-lib/src/seq/seqmid.c:673: undefined reference to `strlcat' collect2: error: ld returned 1 exit status