mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Datatrak import rework: changes of file.c and file.h
Datatrak import is called from parse_file() in file.c. This function reads the full file to be imported into a memblock structure. It's easier and more secure, to parse this buffer instead of the file itself. These are the necessary changes in function datatrak_import() declaration and call. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
This commit is contained in:
		
							parent
							
								
									92d24a2912
								
							
						
					
					
						commit
						25cec35d24
					
				
					 2 changed files with 4 additions and 3 deletions
				
			
		|  | @ -534,8 +534,9 @@ int parse_file(const char *filename) | ||||||
| 
 | 
 | ||||||
| 	/* DataTrak/Wlog */ | 	/* DataTrak/Wlog */ | ||||||
| 	if (fmt && !strcasecmp(fmt + 1, "LOG")) { | 	if (fmt && !strcasecmp(fmt + 1, "LOG")) { | ||||||
| 		datatrak_import(filename, &dive_table); | 		ret = datatrak_import(&mem, &dive_table); | ||||||
| 		return 0; | 		free(mem.buffer); | ||||||
|  | 		return ret; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/* OSTCtools */ | 	/* OSTCtools */ | ||||||
|  |  | ||||||
|  | @ -9,7 +9,7 @@ struct memblock { | ||||||
| 
 | 
 | ||||||
| extern int try_to_open_cochran(const char *filename, struct memblock *mem); | extern int try_to_open_cochran(const char *filename, struct memblock *mem); | ||||||
| extern int try_to_open_liquivision(const char *filename, struct memblock *mem); | extern int try_to_open_liquivision(const char *filename, struct memblock *mem); | ||||||
| extern void datatrak_import(const char *file, struct dive_table *table); | extern int datatrak_import(struct memblock *mem, struct dive_table *table); | ||||||
| extern void ostctools_import(const char *file, struct dive_table *table); | extern void ostctools_import(const char *file, struct dive_table *table); | ||||||
| 
 | 
 | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue