From: Takashi Iwai Subject: Re: [PATCH] PCM parameters in file plugin Date: Wed, 28 Jan 2009 16:41:50 +0100 Message-ID: References: <49627395.1090506@insite.cz> <49632995.9000109@insite.cz> <49634196.1070500@insite.cz> <4974FCC1.70907@insite.cz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 772B0103804 for ; Wed, 28 Jan 2009 16:41:50 +0100 (CET) In-Reply-To: <4974FCC1.70907@insite.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Pavel Hofman Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 19 Jan 2009 23:20:49 +0100, Pavel Hofman wrote: > > @@ -84,6 +106,211 @@ typedef struct { > #define TO_LE16(x) bswap_16(x) > #endif > > +/* old_string MUST contain the key! */ > +int snd_pcm_file_replace_key(char *old_string, char *key, char *value, > + char **newstring_p) Make this static. > +{ > + int str_index, newstr_index, key_index, end, new_len, old_len, cpy_len, > + first_key_index; > + char *c, *first_c, *newstring; > + int keys_count; > + > + first_c = c = (char *) strstr(old_string, key); I guess this parser doesn't handle '%%' properly like printf()? > +int snd_pcm_file_replace_fname(snd_pcm_file_t *file, char **new_fname_p) Make it static. > +int snd_pcm_file_has_keys(char *string) Ditto. > +int snd_pcm_file_open_output_file(snd_pcm_file_t *file) Ditto. > + if (file->final_fname[0] == '|') { > + /* pipe mode */ > + FILE *pipe; > + /* clearing */ > + file->final_fname[0] = ' '; > + pipe = popen(file->final_fname, "w"); Pass "file->final_fname + 1", and you don't have to replace the pipe with a space. thanks, Takashi