summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-07 03:39:16 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-07 03:42:53 (GMT)
commita95f49f79ffb4221c583a2d30144b0e58e4c056b (patch)
tree71e8a38189c6761f77a801a7e156597cdd9ba3f7 /kicad
parentb56961f2787247132483aeb5327018adb6e3b404 (diff)
downloadeeshow-a95f49f79ffb4221c583a2d30144b0e58e4c056b.zip
eeshow-a95f49f79ffb4221c583a2d30144b0e58e4c056b.tar.gz
eeshow-a95f49f79ffb4221c583a2d30144b0e58e4c056b.tar.bz2
kicad/kicad.h: share and generalize default paths
Diffstat (limited to 'kicad')
-rw-r--r--kicad/kicad.h27
-rw-r--r--kicad/lib-parse.c8
2 files changed, 29 insertions, 6 deletions
diff --git a/kicad/kicad.h b/kicad/kicad.h
new file mode 100644
index 0000000..1a1f9a7
--- /dev/null
+++ b/kicad/kicad.h
@@ -0,0 +1,27 @@
+/*
+ * kicad/kicad.h - Common KiCad-related definitons
+ *
+ * Written 2016 by Werner Almesberger
+ * Copyright 2016 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#ifndef KICAD_KICAD_H
+#define KICAD_KICAD_H
+
+/* According to common/gestfich.cpp:KicadDatasPath */
+
+#define KICAD_DATAS_PATH(append) \
+ "/usr/share/kicad" append, \
+ "/usr/local/share/kicad" append, \
+ "/usr/local/kicad/share" append, \
+ "/usr/local/kicad" append
+
+#define DEFAULT_LIBRARY_PATHS KICAD_DATAS_PATH("/library")
+
+#endif /* !KICAD_KICAD_H */
diff --git a/kicad/lib-parse.c b/kicad/lib-parse.c
index a1783fe..7001d54 100644
--- a/kicad/lib-parse.c
+++ b/kicad/lib-parse.c
@@ -19,17 +19,13 @@
#include "misc/diag.h"
#include "gfx/text.h"
#include "file/file.h"
+#include "kicad/kicad.h"
#include "kicad/ext.h"
#include "kicad/lib.h"
-/* according to common/gestfich.cpp:KicadDatasPath */
-
static const char *builtin_paths[] = {
- "/usr/share/kicad/library",
- "/usr/local/share/kicad/library",
- "/usr/local/kicad/share/library",
- "/usr/local/kicad/library"
+ DEFAULT_LIBRARY_PATHS
};