Example #1
0
/* Tokenise a string and append the tokens to the list.
 * Returns the number of tokens appended. */
int lists_strs_tokenise (lists_t_strs *list, const char *s)
{
	int result;

	assert (list);
	assert (s);

	result = lists_strs_split (list, s, " \t");

	return result;
}
Example #2
0
/* Add a new preference for an audio format. */
static void load_each_preference (const char *preference)
{
    const char *prefix;
    lists_t_strs *tokens;
    decoder_t_preference *pref;

    assert (preference && preference[0]);

    tokens = lists_strs_new (4);
    lists_strs_split (tokens, preference, "(,)");
    prefix = lists_strs_at (tokens, 0);
    pref = make_preference (prefix);
#ifdef DEBUG
    pref->source = preference;
#endif
    load_decoders (pref, tokens);
    pref->next = preferences;
    preferences = pref;
    lists_strs_free (tokens);
}