parent
							
								
									5d72755027
								
							
						
					
					
						commit
						fc2fe7fd28
					
				
					 1 changed files with 20 additions and 10 deletions
				
			
		|  | @ -1361,16 +1361,6 @@ static script_info *create_script(char const *file) | |||
| 	return info; | ||||
| } | ||||
| 
 | ||||
| static void load_script(char const *file) | ||||
| { | ||||
| 	script_info *info = create_script(file); | ||||
| 	if(info) | ||||
| 	{ | ||||
| 		g_ptr_array_add(scripts, info); | ||||
| 		check_deferred(info); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| static script_info *get_script_by_file(char const *filename) | ||||
| { | ||||
| 	char const *expanded = expand_path(filename); | ||||
|  | @ -1387,6 +1377,26 @@ static script_info *get_script_by_file(char const *filename) | |||
| 	return NULL; | ||||
| } | ||||
| 
 | ||||
| static int load_script(char const *file) | ||||
| { | ||||
| 	script_info *info = get_script_by_file(file); | ||||
| 
 | ||||
| 	if (info != NULL) | ||||
| 	{ | ||||
| 		hexchat_print(ph, "Lua script is already loaded"); | ||||
| 		return 0; | ||||
| 	} | ||||
| 
 | ||||
| 	info = create_script(file); | ||||
| 	if (info) | ||||
| 	{ | ||||
| 		g_ptr_array_add(scripts, info); | ||||
| 		check_deferred(info); | ||||
| 	} | ||||
| 
 | ||||
| 	return 1; | ||||
| } | ||||
| 
 | ||||
| static int unload_script(char const *filename) | ||||
| { | ||||
| 	script_info *script = get_script_by_file(filename); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue