mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Start showing unparsed entries
(ie all of them) This also shows the type of entry, which makes it clear that I've screwed up the sample matching. Oh well. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									ee35716ec7
								
							
						
					
					
						commit
						414565e000
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								parse.c
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								parse.c
									
										
									
									
									
								
							|  | @ -104,14 +104,31 @@ static void record_dive(struct dive *dive) | |||
| 	printf("Recording dive %d with %d samples\n", ++nr, dive->samples); | ||||
| } | ||||
| 
 | ||||
| static void nonmatch(const char *type, const char *fullname, const char *name, int size, const char *buffer) | ||||
| { | ||||
| 	printf("Unable to match %s '(%.*s)%s' (%.*s)\n", type, | ||||
| 		(int) (name - fullname), fullname, name, | ||||
| 		size, buffer); | ||||
| } | ||||
| 
 | ||||
| static const char *last_part(const char *name) | ||||
| { | ||||
| 	const char *p = strrchr(name, '.'); | ||||
| 	return p ? p+1 : name; | ||||
| } | ||||
| 
 | ||||
| /* We're in samples - try to convert the random xml value to something useful */ | ||||
| static void try_to_fill_sample(struct sample *sample, const char *name, int size, const char *buffer) | ||||
| { | ||||
| 	const char *last = last_part(name); | ||||
| 	nonmatch("sample", name, last, size, buffer); | ||||
| } | ||||
| 
 | ||||
| /* We're in the top-level dive xml. Try to convert whatever value to a dive value */ | ||||
| static void try_to_fill_dive(struct dive *dive, const char *name, int size, const char *buffer) | ||||
| { | ||||
| 	const char *last = last_part(name); | ||||
| 	nonmatch("dive", name, last, size, buffer); | ||||
| } | ||||
| 
 | ||||
| /*
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue