| 299 | } |
| 300 | |
| 301 | static int format_match(const char *filename) |
| 302 | { |
| 303 | FILE *file; |
| 304 | gchar *name = NULL, *contents = NULL; |
| 305 | gboolean status; |
| 306 | |
| 307 | file = fopen(filename, "r"); |
| 308 | if (file == NULL) |
| 309 | return FALSE; |
| 310 | |
| 311 | /* If we can parse the first section correctly, |
| 312 | * then it is assumed to be a VCD file. |
| 313 | */ |
| 314 | status = parse_section(file, &name, &contents); |
| 315 | status = status && (*name != '\0'); |
| 316 | |
| 317 | g_free(name); |
| 318 | g_free(contents); |
| 319 | fclose(file); |
| 320 | |
| 321 | return status; |
| 322 | } |
| 323 | |
| 324 | static int init(struct sr_input *in, const char *filename) |
| 325 | { |
nothing calls this directly
no test coverage detected