Only allow including <gio/gio.h> from apps
authorAlexander Larsson <alexl@redhat.com>
Fri, 14 Dec 2007 10:35:24 +0000 (10:35 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Fri, 14 Dec 2007 10:35:24 +0000 (10:35 +0000)
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fam/Makefile.am:
        * gappinfo.h:
        * gasyncresult.h:
        * gbufferedinputstream.h:
        * gbufferedoutputstream.h:
        * gcancellable.h:
        * gcontenttype.h:
        * gdatainputstream.h:
        * gdataoutputstream.h:
        * gdesktopappinfo.h:
        * gdirectorymonitor.h:
        * gdrive.h:
        * gfile.h:
        * gfileattribute.h:
        * gfileenumerator.h:
        * gfileicon.h:
        * gfileinfo.h:
        * gfileinputstream.h:
        * gfilemonitor.h:
        * gfilenamecompleter.h:
        * gfileoutputstream.h:
        * gfilterinputstream.h:
        * gfilteroutputstream.h:
        * gicon.h:
        * ginputstream.h:
        * gio.h:
        * gioerror.h:
        * giomodule.h:
        * gioscheduler.h:
        * gloadableicon.h:
        * gmemoryinputstream.h:
        * gmemoryoutputstream.h:
        * gmount.h:
        * gmountoperation.h:
        * goutputstream.h:
        * gseekable.h:
        * gsimpleasyncresult.h:
        * gthemedicon.h:
        * gunixinputstream.h:
        * gunixmounts.h:
        * gunixoutputstream.h:
        * gvfs.h:
        * gvolume.h:
        * gvolumemonitor.h:
        * inotify/Makefile.am:
Only allow including <gio/gio.h> from apps

svn path=/trunk/; revision=6117

47 files changed:
gio/ChangeLog
gio/Makefile.am
gio/fam/Makefile.am
gio/gappinfo.h
gio/gasyncresult.h
gio/gbufferedinputstream.h
gio/gbufferedoutputstream.h
gio/gcancellable.h
gio/gcontenttype.h
gio/gdatainputstream.h
gio/gdataoutputstream.h
gio/gdesktopappinfo.h
gio/gdirectorymonitor.h
gio/gdrive.h
gio/gfile.h
gio/gfileattribute.h
gio/gfileenumerator.h
gio/gfileicon.h
gio/gfileinfo.h
gio/gfileinputstream.h
gio/gfilemonitor.h
gio/gfilenamecompleter.h
gio/gfileoutputstream.h
gio/gfilterinputstream.h
gio/gfilteroutputstream.h
gio/gicon.h
gio/ginputstream.h
gio/gio.h
gio/gioerror.h
gio/giomodule.h
gio/gioscheduler.h
gio/gloadableicon.h
gio/gmemoryinputstream.h
gio/gmemoryoutputstream.h
gio/gmount.h
gio/gmountoperation.h
gio/goutputstream.h
gio/gseekable.h
gio/gsimpleasyncresult.h
gio/gthemedicon.h
gio/gunixinputstream.h
gio/gunixmounts.h
gio/gunixoutputstream.h
gio/gvfs.h
gio/gvolume.h
gio/gvolumemonitor.h
gio/inotify/Makefile.am

index 09a8a8a..9b524ba 100644 (file)
@@ -1,5 +1,55 @@
 2007-12-14  Alexander Larsson  <alexl@redhat.com>
 
+        * Makefile.am:
+        * fam/Makefile.am:
+        * gappinfo.h:
+        * gasyncresult.h:
+        * gbufferedinputstream.h:
+        * gbufferedoutputstream.h:
+        * gcancellable.h:
+        * gcontenttype.h:
+        * gdatainputstream.h:
+        * gdataoutputstream.h:
+        * gdesktopappinfo.h:
+        * gdirectorymonitor.h:
+        * gdrive.h:
+        * gfile.h:
+        * gfileattribute.h:
+        * gfileenumerator.h:
+        * gfileicon.h:
+        * gfileinfo.h:
+        * gfileinputstream.h:
+        * gfilemonitor.h:
+        * gfilenamecompleter.h:
+        * gfileoutputstream.h:
+        * gfilterinputstream.h:
+        * gfilteroutputstream.h:
+        * gicon.h:
+        * ginputstream.h:
+        * gio.h:
+        * gioerror.h:
+        * giomodule.h:
+        * gioscheduler.h:
+        * gloadableicon.h:
+        * gmemoryinputstream.h:
+        * gmemoryoutputstream.h:
+        * gmount.h:
+        * gmountoperation.h:
+        * goutputstream.h:
+        * gseekable.h:
+        * gsimpleasyncresult.h:
+        * gthemedicon.h:
+        * gunixinputstream.h:
+        * gunixmounts.h:
+        * gunixoutputstream.h:
+        * gvfs.h:
+        * gvolume.h:
+        * gvolumemonitor.h:
+        * inotify/Makefile.am:
+       Only allow including <gio/gio.h> from apps
+
+2007-12-14  Alexander Larsson  <alexl@redhat.com>
+
         * gioscheduler.[ch]:
         * gsimpleasyncresult.c:
        Rename gioscheduler calls so they all use the g_io_schedule_ prefix.
index 07c9e8c..e5dd24d 100644 (file)
@@ -31,6 +31,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/gmodule                         \
        $(GLIB_DEBUG_FLAGS)                             \
        -DG_DISABLE_DEPRECATED                          \
+       -DGIO_COMPILATION                               \
        -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
 
 lib_LTLIBRARIES = libgio-2.0.la
index 3d9b4d5..3b7b4f8 100644 (file)
@@ -24,6 +24,7 @@ libgiofam_la_CFLAGS = \
        -I$(top_srcdir)/gmodule         \
        -I$(top_srcdir)/gio             \
        -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  \
+       -DGIO_COMPILATION               \
        -DG_DISABLE_DEPRECATED
 
 libgiofam_la_LDFLAGS = $(module_flags)
index e7dfd3c..59d6f2f 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_APP_INFO_H__
 #define __G_APP_INFO_H__
 
index 123c20a..640d611 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_ASYNC_RESULT_H__
 #define __G_ASYNC_RESULT_H__
 
index 8e9c1ea..3eea4f9 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_BUFFERED_INPUT_STREAM_H__
 #define __G_BUFFERED_INPUT_STREAM_H__
 
index d47ecd0..134bf82 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_BUFFERED_OUTPUT_STREAM_H__
 #define __G_BUFFERED_OUTPUT_STREAM_H__
 
index 2697914..7c890be 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_CANCELLABLE_H__
 #define __G_CANCELLABLE_H__
 
index e8bbf57..9dcbf14 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_CONTENT_TYPE_H__
 #define __G_CONTENT_TYPE_H__
 
index 355752d..0ecd14f 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_DATA_INPUT_STREAM_H__
 #define __G_DATA_INPUT_STREAM_H__
 
index c5d7043..7a4e405 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_DATA_OUTPUT_STREAM_H__
 #define __G_DATA_OUTPUT_STREAM_H__
 
index 0f667dc..6ed5853 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __G_DESKTOP_APP_INFO_H__
 #define __G_DESKTOP_APP_INFO_H__
 
-#include <gio/gappinfo.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
index 4425f7d..5909b5b 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_DIRECTORY_MONITOR_H__
 #define __G_DIRECTORY_MONITOR_H__
 
index f36b3c8..6d9e463 100644 (file)
  *         David Zeuthen <davidz@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_DRIVE_H__
 #define __G_DRIVE_H__
 
index 07d7992..48574b1 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_H__
 #define __G_FILE_H__
 
index 0c96e99..0d41903 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_ATTRIBUTE_H__
 #define __G_FILE_ATTRIBUTE_H__
 
index ffec2dd..11d04fc 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_ENUMERATOR_H__
 #define __G_FILE_ENUMERATOR_H__
 
index e31c42d..18d73d0 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_ICON_H__
 #define __G_FILE_ICON_H__
 
index 1614d12..ec48d1e 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_INFO_H__
 #define __G_FILE_INFO_H__
 
index 77e7f9f..5f1f891 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_INPUT_STREAM_H__
 #define __G_FILE_INPUT_STREAM_H__
 
index 0fb4f2b..5b38f45 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_MONITOR_H__
 #define __G_FILE_MONITOR_H__
 
index 4fd7734..c7fd383 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILENAME_COMPLETER_H__
 #define __G_FILENAME_COMPLETER_H__
 
index b6982b5..3162722 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILE_OUTPUT_STREAM_H__
 #define __G_FILE_OUTPUT_STREAM_H__
 
index f8e82db..ee6d915 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILTER_INPUT_STREAM_H__
 #define __G_FILTER_INPUT_STREAM_H__
 
index 124046e..ba2d968 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_FILTER_OUTPUT_STREAM_H__
 #define __G_FILTER_OUTPUT_STREAM_H__
 
index b7dab6a..dd02889 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_ICON_H__
 #define __G_ICON_H__
 
index 8966136..3759fec 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_INPUT_STREAM_H__
 #define __G_INPUT_STREAM_H__
 
index 5f4e706..606344d 100644 (file)
--- a/gio/gio.h
+++ b/gio/gio.h
@@ -23,6 +23,8 @@
 #ifndef __G_IO_H__
 #define __G_IO_H__
 
+#define __GIO_GIO_H_INSIDE__
+
 #include <gio/gvfs.h>
 #include <gio/gfile.h>
 #include <gio/gvolumemonitor.h>
@@ -49,4 +51,6 @@
 #include <gio/gsimpleasyncresult.h>
 #include <gio/gioenumtypes.h>
 
+#undef __GIO_GIO_H_INSIDE__
+
 #endif /* __G_IO_H__ */
index b928a90..f024c09 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_IO_ERROR_H__
 #define __G_IO_ERROR_H__
 
index 36b6de7..bc2bb67 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_IO_MODULE_H__
 #define __G_IO_MODULE_H__
 
index d70e2ad..acc2e1e 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_IO_SCHEDULER_H__
 #define __G_IO_SCHEDULER_H__
 
index 88f42df..3854259 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_LOADABLE_ICON_H__
 #define __G_LOADABLE_ICON_H__
 
index d244912..fd07462 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_MEMORY_INPUT_STREAM_H__
 #define __G_MEMORY_INPUT_STREAM_H__
 
index 56d77bf..e52f23d 100644 (file)
  * Author: Christian Kellner <gicmo@gnome.org> 
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_MEMORY_OUTPUT_STREAM_H__
 #define __G_MEMORY_OUTPUT_STREAM_H__
 
index 837fcc8..c413e60 100644 (file)
  *         David Zeuthen <davidz@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_MOUNT_H__
 #define __G_MOUNT_H__
 
index 3b3b42a..35434fa 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_MOUNT_OPERATION_H__
 #define __G_MOUNT_OPERATION_H__
 
index 4977d7d..8626bb1 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_OUTPUT_STREAM_H__
 #define __G_OUTPUT_STREAM_H__
 
index 0525349..78b8998 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_SEEKABLE_H__
 #define __G_SEEKABLE_H__
 
index f1ab938..f2f9b36 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_SIMPLE_ASYNC_RESULT_H__
 #define __G_SIMPLE_ASYNC_RESULT_H__
 
index b249d35..7c3a204 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_THEMED_ICON_H__
 #define __G_THEMED_ICON_H__
 
index 4eeaa41..7bb7cd9 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __G_UNIX_INPUT_STREAM_H__
 #define __G_UNIX_INPUT_STREAM_H__
 
-#include <gio/ginputstream.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
index 1ad6f10..9be6c89 100644 (file)
@@ -23,9 +23,7 @@
 #ifndef __G_UNIX_MOUNTS_H__
 #define __G_UNIX_MOUNTS_H__
 
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gicon.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
index 83cad9e..bfcf614 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __G_UNIX_OUTPUT_STREAM_H__
 #define __G_UNIX_OUTPUT_STREAM_H__
 
-#include <gio/goutputstream.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
index 3abc9b4..9400c6f 100644 (file)
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_VFS_H__
 #define __G_VFS_H__
 
index 6c82bf7..02f5bc2 100644 (file)
  *         David Zeuthen <davidz@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_VOLUME_H__
 #define __G_VOLUME_H__
 
index 787d414..463d56a 100644 (file)
  *         David Zeuthen <davidz@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_VOLUME_MONITOR_H__
 #define __G_VOLUME_MONITOR_H__
 
index 0780fa2..36d920a 100644 (file)
@@ -32,5 +32,6 @@ libinotify_la_CFLAGS = \
        -I$(top_srcdir)/gmodule         \
        -I$(top_srcdir)/gio             \
        -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  \
+       -DGIO_COMPILATION               \
        -DG_DISABLE_DEPRECATED