summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-01-13 13:59:29 +0100
committerDavid Robillard <d@drobilla.net>2019-01-13 13:59:29 +0100
commit162d540a7a78bcd75aea002b4afa101133315e8b (patch)
treef59f5adbc21f4156a1a8b4e33abe9124a6f526cb /src
parent4b4c1797d93e6efb93b12df21c1cd9f04341b61e (diff)
downloadlilv-162d540a7a78bcd75aea002b4afa101133315e8b.tar.gz
lilv-162d540a7a78bcd75aea002b4afa101133315e8b.tar.bz2
lilv-162d540a7a78bcd75aea002b4afa101133315e8b.zip
Clean up includes
Sorts includes from local to global (which catches errors) and fixes missing includes found by the resulting breakage and include-what-you-use.
Diffstat (limited to 'src')
-rw-r--r--src/collections.c9
-rw-r--r--src/instance.c9
-rw-r--r--src/lib.c8
-rw-r--r--src/lilv_internal.h17
-rw-r--r--src/node.c10
-rw-r--r--src/plugin.c23
-rw-r--r--src/pluginclass.c10
-rw-r--r--src/port.c17
-rw-r--r--src/query.c9
-rw-r--r--src/scalepoint.c4
-rw-r--r--src/state.c23
-rw-r--r--src/ui.c8
-rw-r--r--src/util.c31
-rw-r--r--src/world.c25
-rw-r--r--src/zix/tree.c7
-rw-r--r--src/zix/tree.h5
16 files changed, 152 insertions, 63 deletions
diff --git a/src/collections.c b/src/collections.c
index 9ded845..64a8ab2 100644
--- a/src/collections.c
+++ b/src/collections.c
@@ -16,6 +16,15 @@
#include "lilv_internal.h"
+#include "lilv/lilv.h"
+#include "sord/sord.h"
+#include "zix/common.h"
+#include "zix/tree.h"
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
int
lilv_ptr_cmp(const void* a, const void* b, void* user_data)
{
diff --git a/src/instance.c b/src/instance.c
index 030c6ff..ba71e81 100644
--- a/src/instance.c
+++ b/src/instance.c
@@ -14,12 +14,17 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "lilv_internal.h"
+
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+#include "lilv/lilv.h"
+
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "lilv_internal.h"
-
LILV_API LilvInstance*
lilv_plugin_instantiate(const LilvPlugin* plugin,
double sample_rate,
diff --git a/src/lib.c b/src/lib.c
index 73e57bb..b212506 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -16,6 +16,14 @@
#include "lilv_internal.h"
+#include "lilv/lilv.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+#include "zix/tree.h"
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdlib.h>
+
LilvLib*
lilv_lib_open(LilvWorld* world,
const LilvNode* uri,
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index 426eaaf..baf4a02 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -21,10 +21,17 @@
extern "C" {
#endif
+#include "lilv_config.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
+#include "sord/sord.h"
+#include "zix/tree.h"
+
+#include <float.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
-#include <float.h>
#ifdef _WIN32
# include <windows.h>
@@ -52,14 +59,6 @@ static inline const char* dlerror(void) { return "Unknown error"; }
# include <unistd.h>
#endif
-#include "serd/serd.h"
-#include "sord/sord.h"
-
-#include "zix/tree.h"
-
-#include "lilv_config.h"
-#include "lilv/lilv.h"
-
#ifdef LILV_DYN_MANIFEST
# include "lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h"
#endif
diff --git a/src/node.c b/src/node.c
index 5605177..6079919 100644
--- a/src/node.c
+++ b/src/node.c
@@ -14,13 +14,19 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
+#include "sord/sord.h"
+
#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "lilv_internal.h"
-
static void
lilv_node_set_numerics_from_string(LilvNode* val)
{
diff --git a/src/plugin.c b/src/plugin.c
index 0575b32..da39d0e 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -16,19 +16,30 @@
#define __STDC_LIMIT_MACROS
-#include <assert.h>
+#include "lilv_config.h"
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
+#include "sord/sord.h"
+#include "zix/tree.h"
+
+#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+
+#ifdef LILV_DYN_MANIFEST
+# include "lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h"
+# include <dlfcn.h>
+#endif
+
#include <math.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "lilv_config.h"
-#include "lilv_internal.h"
-
-#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
-
#define NS_DOAP (const uint8_t*)"http://usefulinc.com/ns/doap#"
#define NS_FOAF (const uint8_t*)"http://xmlns.com/foaf/0.1/"
diff --git a/src/pluginclass.c b/src/pluginclass.c
index 622ff8f..ef2efe7 100644
--- a/src/pluginclass.c
+++ b/src/pluginclass.c
@@ -14,11 +14,15 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <string.h>
-
#include "lilv_internal.h"
+#include "lilv/lilv.h"
+#include "sord/sord.h"
+#include "zix/tree.h"
+
+#include <stdbool.h>
+#include <stdlib.h>
+
LilvPluginClass*
lilv_plugin_class_new(LilvWorld* world,
const SordNode* parent_node,
diff --git a/src/port.c b/src/port.c
index fcc32fc..8e2812a 100644
--- a/src/port.c
+++ b/src/port.c
@@ -14,16 +14,21 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "lilv_internal.h"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/event/event.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "lilv_internal.h"
+#include "lilv/lilv.h"
+#include "sord/sord.h"
+#include "zix/tree.h"
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
LilvPort*
lilv_port_new(LilvWorld* world,
diff --git a/src/query.c b/src/query.c
index fe2988f..29ad96e 100644
--- a/src/query.c
+++ b/src/query.c
@@ -14,12 +14,15 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <limits.h>
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "sord/sord.h"
+#include "zix/tree.h"
+
#include <stdlib.h>
#include <string.h>
-#include "lilv_internal.h"
-
typedef enum {
LILV_LANG_MATCH_NONE, ///< Language does not match at all
LILV_LANG_MATCH_PARTIAL, ///< Partial (language, but not country) match
diff --git a/src/scalepoint.c b/src/scalepoint.c
index 349b2b3..bcda54e 100644
--- a/src/scalepoint.c
+++ b/src/scalepoint.c
@@ -16,6 +16,10 @@
#include "lilv_internal.h"
+#include "lilv/lilv.h"
+
+#include <stdlib.h>
+
/** Ownership of value and label is taken */
LilvScalePoint*
lilv_scale_point_new(LilvNode* value, LilvNode* label)
diff --git a/src/state.c b/src/state.c
index 4fc7e43..4ce4abd 100644
--- a/src/state.c
+++ b/src/state.c
@@ -14,18 +14,29 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
+#include "sord/sord.h"
+#include "sratom/sratom.h"
+#include "zix/tree.h"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
+#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "lilv_config.h"
-#include "lilv_internal.h"
-#include "sratom/sratom.h"
+#include <assert.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#define USTR(s) ((const uint8_t*)(s))
diff --git a/src/ui.c b/src/ui.c
index e3a9b2b..8a2858f 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -14,12 +14,16 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "zix/tree.h"
+
#include <assert.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include "lilv_internal.h"
-
LilvUI*
lilv_ui_new(LilvWorld* world,
LilvNode* uri,
diff --git a/src/util.c b/src/util.c
index e896d65..e105ec3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -22,13 +22,11 @@
# define _DARWIN_C_SOURCE 1 /* for flock */
#endif
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
+#include "lilv_config.h"
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
#ifdef _WIN32
#ifndef _WIN32_WINNT
@@ -56,19 +54,26 @@ CreateSymbolicLink(LPCTSTR linkpath, LPCTSTR targetpath, DWORD flags)
# endif
#else
# include <dirent.h>
-# include <limits.h>
# include <unistd.h>
#endif
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "lilv_internal.h"
-
#if defined(HAVE_FLOCK) && defined(HAVE_FILENO)
# include <sys/file.h>
#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#ifndef PAGE_SIZE
# define PAGE_SIZE 4096
#endif
diff --git a/src/world.c b/src/world.c
index 1858569..d0302e4 100644
--- a/src/world.c
+++ b/src/world.c
@@ -14,14 +14,29 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include "lilv_config.h"
+#include "lilv_internal.h"
+
+#include "lilv/lilv.h"
+#include "serd/serd.h"
+#include "sord/sord.h"
+#include "zix/common.h"
+#include "zix/tree.h"
#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "lilv_internal.h"
+#ifdef LILV_DYN_MANIFEST
+# include "lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h"
+# include <dlfcn.h>
+#endif
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdio.h>
static int
lilv_world_drop_graph(LilvWorld* world, const SordNode* graph);
diff --git a/src/zix/tree.c b/src/zix/tree.c
index 1646709..b6fdd2a 100644
--- a/src/zix/tree.c
+++ b/src/zix/tree.c
@@ -14,15 +14,14 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "zix/common.h"
+#include "zix/tree.h"
+
#include <assert.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "zix/common.h"
-#include "zix/tree.h"
-
typedef struct ZixTreeNodeImpl ZixTreeNode;
struct ZixTreeImpl {
diff --git a/src/zix/tree.h b/src/zix/tree.h
index e531a9b..79177d0 100644
--- a/src/zix/tree.h
+++ b/src/zix/tree.h
@@ -17,10 +17,11 @@
#ifndef ZIX_TREE_H
#define ZIX_TREE_H
-#include <stddef.h>
-
#include "zix/common.h"
+#include <stdbool.h>
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif