Root/
| Source at commit e46f8382f32dcb45d213bfe4c5734a68cc074dac created 7 years 4 months ago. By Werner Almesberger, eeshow/kicad/ext.c (clone_file_names, free_file_names): manage set of names | |
|---|---|
| 1 | /* |
| 2 | * kicad/ext.h - Identify files by their extension |
| 3 | * |
| 4 | * Written 2016 by Werner Almesberger |
| 5 | * Copyright 2016 by Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | #ifndef KICAD_EXT_H |
| 15 | #define KICAD_EXT_H |
| 16 | |
| 17 | enum ext { |
| 18 | ext_unknown, |
| 19 | ext_project, |
| 20 | ext_sch, |
| 21 | ext_lib, |
| 22 | ext_pl, /* .kicad_wks, work sheet */ |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | struct file_names { |
| 27 | const char *pro; /* just one allowed, may be NULL */ |
| 28 | const char *sch; /* just one allowed, may be NULL */ |
| 29 | const char *pl; /* just one allowed, may be NULL */ |
| 30 | const char **libs; |
| 31 | unsigned n_libs; |
| 32 | }; |
| 33 | |
| 34 | |
| 35 | enum ext identify(const char *path); |
| 36 | void classify_files(struct file_names *fn, char *const *args, |
| 37 | unsigned n_args); |
| 38 | struct file_names *clone_file_names(const struct file_names *fn); |
| 39 | void free_file_names(struct file_names *fn); |
| 40 | |
| 41 | #endif /* !KICAD_EXT_H */ |
| 42 | |
Branches:
master
