diff options
author | Jaroslav Kysela <perex@perex.cz> | 2001-07-04 13:55:13 +0000 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2001-07-04 13:55:13 +0000 |
commit | c7ed13b3ae1b278ee140a2930bd396576e67c944 (patch) | |
tree | b45cef64407772a9fec301d324e145631464be50 /seq/aseqnet | |
parent | e6a4296b790fbb588a3f6325134aec51f185bc04 (diff) | |
download | alsa-utils-c7ed13b3ae1b278ee140a2930bd396576e67c944.tar.gz |
Rewritten for the new sequencer API (with encapsulation).
Diffstat (limited to 'seq/aseqnet')
-rw-r--r-- | seq/aseqnet/aseqnet.c | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/seq/aseqnet/aseqnet.c b/seq/aseqnet/aseqnet.c index 17d7b1e..ed52227 100644 --- a/seq/aseqnet/aseqnet.c +++ b/seq/aseqnet/aseqnet.c @@ -189,47 +189,6 @@ static void init_pollfds(void) } /* - * parse command line to client:port - * NB: the given string will be broken. - */ -static int parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, char *arg) -{ - char *p; - int client, port; - - if ((p = strpbrk(arg, ":.")) == NULL) - return -1; - if ((port = atoi(p + 1)) < 0) - return -1; - addr->port = port; - if (isdigit(*arg)) { - client = atoi(arg); - if (client < 0) - return -1; - addr->client = client; - } else { - /* convert from the name */ - snd_seq_client_info_t cinfo; - int len; - - *p = 0; - len = strlen(arg); - if (len <= 0) - return -1; - cinfo.client = -1; - while (snd_seq_query_next_client(seq, &cinfo) >= 0) { - if (! strncmp(cinfo.name, arg, len)) { - addr->client = cinfo.client; - return 0; - } - } - return -1; /* not found */ - } - return 0; -} - - -/* * close all files */ static void close_files(void) @@ -301,7 +260,7 @@ static void init_seq(char *source, char *dest) /* explicit subscriptions */ if (source) { /* read subscription */ - if (parse_address(handle, &addr, source) < 0) { + if (snd_seq_parse_address(handle, &addr, source) < 0) { fprintf(stderr, "invalid source address %s\n", source); exit(1); } @@ -312,7 +271,7 @@ static void init_seq(char *source, char *dest) } if (dest) { /* write subscription */ - if (parse_address(handle, &addr, dest) < 0) { + if (snd_seq_parse_address(handle, &addr, dest) < 0) { fprintf(stderr, "invalid destination address %s\n", dest); exit(1); } |