gplugin/gplugin

Move internal headers to the end
bugfix/clang-format-tweaks
2020-02-26, Richard Laager
1b7956e62905
Parents 54917b58582a
Children 8dd04416a17d
Move internal headers to the end

This is the normal style. I found a different way to address the Perl include
ordering issues.
--- a/.clang-format Wed Feb 26 14:19:35 2020 -0600
+++ b/.clang-format Wed Feb 26 14:42:35 2020 -0600
@@ -68,13 +68,6 @@
IncludeBlocks: Preserve
#IncludeBlocks: Regroup
IncludeCategories:
- # We do not use many local headers, but when used, we order them first,
- # rather than the popular convention of last. This is important for the
- # Perl loader, where we need to ensure that all (indirect) includes of
- # gperl.h occur before all includes of glib, due to the conflict in the _
- # macro.
- - Regex: '^"'
- Priority: 10
# C system headers.
- Regex: '^[<"](aio|arpa/inet|assert|complex|cpio|ctype|curses|dirent|dlfcn|errno|fcntl|fenv|float|fmtmsg|fnmatch|ftw|glob|grp|iconv|inttypes|iso646|langinfo|libgen|limits|locale|math|monetary|mqueue|ndbm|netdb|net/if|netinet/in|netinet/tcp|nl_types|poll|pthread|pwd|regex|sched|search|semaphore|setjmp|signal|spawn|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|strings|stropts|sys/ipc|syslog|sys/mman|sys/msg|sys/resource|sys/select|sys/sem|sys/shm|sys/socket|sys/stat|sys/statvfs|sys/time|sys/times|sys/types|sys/uio|sys/un|sys/utsname|sys/wait|tar|term|termios|tgmath|threads|time|trace|uchar|ulimit|uncntrl|unistd|utime|utmpx|wchar|wctype|wordexp)\.h[">]$'
Priority: 20
@@ -115,6 +108,9 @@
# Other libraries' headers
- Regex: '^<'
Priority: 60
+ # Our (internal) headers
+ - Regex: '^"'
+ Priority: 70
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
IndentPPDirectives: None
--- a/gplugin/tests/dynamic-type/dynamic-type-provider.c Wed Feb 26 14:19:35 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-type-provider.c Wed Feb 26 14:42:35 2020 -0600
@@ -16,11 +16,11 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "dynamic-test.h"
-
#include <gplugin.h>
#include <gplugin-native.h>
+#include "dynamic-test.h"
+
G_DEFINE_DYNAMIC_TYPE(DynamicTest, dynamic_test, G_TYPE_OBJECT);
static void
--- a/gplugin/tests/dynamic-type/dynamic-type-user.c Wed Feb 26 14:19:35 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-type-user.c Wed Feb 26 14:42:35 2020 -0600
@@ -16,11 +16,11 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "dynamic-test.h"
-
#include <gplugin.h>
#include <gplugin-native.h>
+#include "dynamic-test.h"
+
static DynamicTest *test_object = NULL;
G_MODULE_EXPORT GPluginPluginInfo *
--- a/lua/gplugin-lua-core.c Wed Feb 26 14:19:35 2020 -0600
+++ b/lua/gplugin-lua-core.c Wed Feb 26 14:42:35 2020 -0600
@@ -15,14 +15,14 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "gplugin-lua-loader.h"
-#include "gplugin-lua-plugin.h"
-
#include <glib/gi18n-lib.h>
#include <gplugin.h>
#include <gplugin-native.h>
+#include "gplugin-lua-loader.h"
+#include "gplugin-lua-plugin.h"
+
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error)
{
--- a/lua/gplugin-lua-loader.c Wed Feb 26 14:19:35 2020 -0600
+++ b/lua/gplugin-lua-loader.c Wed Feb 26 14:42:35 2020 -0600
@@ -17,14 +17,14 @@
#include "gplugin-lua-loader.h"
-#include "gplugin-lua-plugin.h"
-
#include <glib/gi18n-lib.h>
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
+#include "gplugin-lua-plugin.h"
+
struct _GPluginLuaLoader {
GPluginLoader parent;
};
--- a/perl/gplugin-perl-core.c Wed Feb 26 14:19:35 2020 -0600
+++ b/perl/gplugin-perl-core.c Wed Feb 26 14:42:35 2020 -0600
@@ -15,12 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include <gplugin.h>
+#include <gplugin-native.h>
+
#include "gplugin-perl-loader.h"
#include "gplugin-perl-plugin.h"
-#include <gplugin.h>
-#include <gplugin-native.h>
-
#undef _
#include <glib/gi18n-lib.h>
--- a/perl/gplugin-perl-loader.c Wed Feb 26 14:19:35 2020 -0600
+++ b/perl/gplugin-perl-loader.c Wed Feb 26 14:42:35 2020 -0600
@@ -17,10 +17,17 @@
#include "gplugin-perl-loader.h"
-#include "gplugin-perl-plugin.h"
+#define PERL_NO_GET_CONTEXT
+#include <gperl.h>
+/* perl define's _() to something completely different that we don't use. So
+ * we undef it so that we can use it for gettext.
+ */
+#undef _
#include <glib/gi18n-lib.h>
+#include "gplugin-perl-plugin.h"
+
struct _GPluginPerlLoader {
GPluginLoader parent;
};
--- a/perl/gplugin-perl-plugin.h Wed Feb 26 14:19:35 2020 -0600
+++ b/perl/gplugin-perl-plugin.h Wed Feb 26 14:42:35 2020 -0600
@@ -21,12 +21,14 @@
#include <gplugin.h>
#include <gplugin-native.h>
+#ifndef _GPERL_H_
#define PERL_NO_GET_CONTEXT
#include <gperl.h>
/* perl define's _() to something completely different that we don't use. So
* we undef it so that we can use it for gettext.
*/
#undef _
+#endif
G_BEGIN_DECLS
--- a/python/gplugin-python3-core.c Wed Feb 26 14:19:35 2020 -0600
+++ b/python/gplugin-python3-core.c Wed Feb 26 14:42:35 2020 -0600
@@ -15,14 +15,14 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "gplugin-python3-loader.h"
-#include "gplugin-python3-plugin.h"
-
#include <glib/gi18n-lib.h>
#include <gplugin.h>
#include <gplugin-native.h>
+#include "gplugin-python3-loader.h"
+#include "gplugin-python3-plugin.h"
+
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error)
{
--- a/python/gplugin-python3-loader.c Wed Feb 26 14:19:35 2020 -0600
+++ b/python/gplugin-python3-loader.c Wed Feb 26 14:42:35 2020 -0600
@@ -17,9 +17,6 @@
#include "gplugin-python3-loader.h"
-#include "gplugin-python3-plugin.h"
-#include "gplugin-python3-utils.h"
-
#include <stdlib.h>
#include <glib/gi18n-lib.h>
@@ -27,6 +24,9 @@
#include <Python.h>
#include <pygobject.h>
+#include "gplugin-python3-plugin.h"
+#include "gplugin-python3-utils.h"
+
struct _GPluginPython3Loader {
GPluginLoader parent;
--- a/python/tests/test-python3-utils.c Wed Feb 26 14:19:35 2020 -0600
+++ b/python/tests/test-python3-utils.c Wed Feb 26 14:42:35 2020 -0600
@@ -15,12 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "gplugin-python3-utils.h"
-
#include <glib.h>
#include <Python.h>
+#include "gplugin-python3-utils.h"
+
/******************************************************************************
* filename to module tests
*****************************************************************************/
--- a/tcc/gplugin-tcc-core.c Wed Feb 26 14:19:35 2020 -0600
+++ b/tcc/gplugin-tcc-core.c Wed Feb 26 14:42:35 2020 -0600
@@ -15,14 +15,14 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "gplugin-tcc-loader.h"
-#include "gplugin-tcc-plugin.h"
-
#include <glib/gi18n-lib.h>
#include <gplugin.h>
#include <gplugin-native.h>
+#include "gplugin-tcc-loader.h"
+#include "gplugin-tcc-plugin.h"
+
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error)
{
--- a/tcc/gplugin-tcc-loader.c Wed Feb 26 14:19:35 2020 -0600
+++ b/tcc/gplugin-tcc-loader.c Wed Feb 26 14:42:35 2020 -0600
@@ -17,12 +17,12 @@
#include "gplugin-tcc-loader.h"
-#include "gplugin-tcc-plugin.h"
-
#include <glib/gi18n-lib.h>
#include <libtcc.h>
+#include "gplugin-tcc-plugin.h"
+
struct _GPluginTccLoader {
GPluginLoader parent;
};