mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	conf: add snd_config_is_empty() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									da33eda632
								
							
						
					
					
						commit
						3050af4b90
					
				
					 2 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								src/conf.c
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								src/conf.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1832,6 +1832,19 @@ int snd_config_is_array(const snd_config_t *config)
 | 
			
		|||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \brief Returns if the compound has no fields (is empty).
 | 
			
		||||
 * \param config Handle to the configuration node.
 | 
			
		||||
 * \return A positive value when true, zero when false, otherwise a negative error code.
 | 
			
		||||
 */
 | 
			
		||||
int snd_config_is_empty(const snd_config_t *config)
 | 
			
		||||
{
 | 
			
		||||
	assert(config);
 | 
			
		||||
	if (config->type != SND_CONFIG_TYPE_COMPOUND)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	return list_empty(&config->u.compound.fields);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \brief Returns the id of a configuration node.
 | 
			
		||||
 * \param[in] config Handle to the configuration node.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue