- {
- /* Parse all name=value[,] elements */
- do
- {
- psz_chain++; /* skip previous delimiter */
- SKIPSPACE( psz_chain );
-
- /* Look for the end of the name (,={}_space_) */
- len = strcspn( psz_chain, "=,{} \t" );
- if( len == 0 )
- continue; /* ignore empty parameter */
-
- /* Append the new parameter */
- config_chain_t *p_cfg = malloc( sizeof(*p_cfg) );
- if( !p_cfg )
- break;
- p_cfg->psz_name = strndup( psz_chain, len );
- psz_chain += len;
- p_cfg->psz_value = NULL;
- p_cfg->p_next = NULL;
-
- *pp_next = p_cfg;
- pp_next = &p_cfg->p_next;
-
- /* Extract the option value */
- SKIPSPACE( psz_chain );
- if( strchr( "={", *psz_chain ) )
- {
- p_cfg->psz_value = ChainGetValue( &psz_chain );
- SKIPSPACE( psz_chain );
- }
- }
- while( !memchr( "}", *psz_chain, 2 ) );
-
- if( *psz_chain ) psz_chain++; /* skip '}' */;
- SKIPSPACE( psz_chain );
- }