mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	some more work on the cli
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@24 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									382e7aefd4
								
							
						
					
					
						commit
						56f8c953dd
					
				
					 13 changed files with 458 additions and 58 deletions
				
			
		
							
								
								
									
										30
									
								
								src/module.c
									
										
									
									
									
								
							
							
						
						
									
										30
									
								
								src/module.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -17,6 +17,9 @@ struct module* module_load(struct core *c, const char *name, const char *argumen
 | 
			
		|||
    m = malloc(sizeof(struct module));
 | 
			
		||||
    assert(m);
 | 
			
		||||
 | 
			
		||||
    m->name = strdup(name);
 | 
			
		||||
    m->argument = argument ? strdup(argument) : NULL;
 | 
			
		||||
    
 | 
			
		||||
    if (!(m->dl = lt_dlopenext(name)))
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -26,8 +29,6 @@ struct module* module_load(struct core *c, const char *name, const char *argumen
 | 
			
		|||
    if (!(m->done = lt_dlsym(m->dl, "module_done")))
 | 
			
		||||
        goto fail;
 | 
			
		||||
    
 | 
			
		||||
    m->name = strdup(name);
 | 
			
		||||
    m->argument = argument ? strdup(argument) : NULL;
 | 
			
		||||
    m->userdata = NULL;
 | 
			
		||||
    m->core = c;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -127,3 +128,28 @@ char *module_list_to_string(struct core *c) {
 | 
			
		|||
    
 | 
			
		||||
    return strbuf_tostring_free(s);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct once_info {
 | 
			
		||||
    struct core *core;
 | 
			
		||||
    uint32_t index;
 | 
			
		||||
};
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
void module_unload_once_callback(void *userdata) {
 | 
			
		||||
    struct once_info *i = userdata;
 | 
			
		||||
    assert(i);
 | 
			
		||||
    module_unload_by_index(i->core, i->index);
 | 
			
		||||
    free(i);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void module_unload_request(struct core *c, struct module *m) {
 | 
			
		||||
    struct once_info *i;
 | 
			
		||||
    assert(c && m);
 | 
			
		||||
 | 
			
		||||
    i = malloc(sizeof(struct once_info));
 | 
			
		||||
    assert(i);
 | 
			
		||||
    i->core = c;
 | 
			
		||||
    i->index = m->index;
 | 
			
		||||
    mainloop_once(c->mainloop, module_unload_once_callback, i);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue