mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Use errno for result errors
Make new enumeration for data transport status and use errno style error numbers for errors.
This commit is contained in:
		
							parent
							
								
									dda28b1589
								
							
						
					
					
						commit
						6fb0f580ea
					
				
					 86 changed files with 2019 additions and 1988 deletions
				
			
		| 
						 | 
				
			
			@ -17,6 +17,7 @@
 | 
			
		|||
 * Boston, MA 02110-1301, USA.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
#include <spa/support/plugin.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -36,13 +37,14 @@ spa_handle_factory_register(const struct spa_handle_factory *factory)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t index)
 | 
			
		||||
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
 | 
			
		||||
{
 | 
			
		||||
	spa_return_val_if_fail(factory != NULL, SPA_RESULT_INVALID_ARGUMENTS);
 | 
			
		||||
	spa_return_val_if_fail(factory != NULL, -EINVAL);
 | 
			
		||||
	spa_return_val_if_fail(index != NULL, -EINVAL);
 | 
			
		||||
 | 
			
		||||
	if (index >= n_factories)
 | 
			
		||||
		return SPA_RESULT_ENUM_END;
 | 
			
		||||
	if (*index >= n_factories)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	*factory = factories[index];
 | 
			
		||||
	return SPA_RESULT_OK;
 | 
			
		||||
	*factory = factories[(*index)++];
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue