Rename the generated private data getter function
[platform/upstream/glib.git] / gio / gfileenumerator.c
index d2779ce..a853540 100644 (file)
 #include "gioerror.h"
 #include "glibintl.h"
 
+struct _GFileEnumeratorPrivate {
+  /* TODO: Should be public for subclasses? */
+  GFile *container;
+  guint closed : 1;
+  guint pending : 1;
+  GAsyncReadyCallback outstanding_callback;
+  GError *outstanding_error;
+};
 
 /**
  * SECTION:gfileenumerator
  * version will return a list of #GFileInfo<!---->s, whereas the 
  * synchronous will only return the next file in the enumerator.
  *
+ * The ordering of returned files is unspecified for non-Unix
+ * platforms; for more information, see g_dir_read_name().  On Unix,
+ * when operating on local files, returned files will be sorted by
+ * inode number.  Effectively you can assume that the ordering of
+ * returned files will be stable between successive calls (and
+ * applications) assuming the directory is unchanged.
+ *
+ * If your application needs a specific ordering, such as by name or
+ * modification time, you will have to implement that in your
+ * application code.
+ *
  * To close a #GFileEnumerator, use g_file_enumerator_close(), or 
  * its asynchronous version, g_file_enumerator_close_async(). Once 
  * a #GFileEnumerator is closed, no further actions may be performed 
  * 
  **/ 
 
-G_DEFINE_TYPE (GFileEnumerator, g_file_enumerator, G_TYPE_OBJECT);
-
-struct _GFileEnumeratorPrivate {
-  /* TODO: Should be public for subclasses? */
-  GFile *container;
-  guint closed : 1;
-  guint pending : 1;
-  GAsyncReadyCallback outstanding_callback;
-  GError *outstanding_error;
-};
+G_DEFINE_TYPE_WITH_PRIVATE (GFileEnumerator, g_file_enumerator, G_TYPE_OBJECT)
 
 enum {
   PROP_0,
@@ -139,9 +149,7 @@ static void
 g_file_enumerator_class_init (GFileEnumeratorClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  
-  g_type_class_add_private (klass, sizeof (GFileEnumeratorPrivate));
-  
+
   gobject_class->set_property = g_file_enumerator_set_property;
   gobject_class->dispose = g_file_enumerator_dispose;
   gobject_class->finalize = g_file_enumerator_finalize;
@@ -164,9 +172,7 @@ g_file_enumerator_class_init (GFileEnumeratorClass *klass)
 static void
 g_file_enumerator_init (GFileEnumerator *enumerator)
 {
-  enumerator->priv = G_TYPE_INSTANCE_GET_PRIVATE (enumerator,
-                                                 G_TYPE_FILE_ENUMERATOR,
-                                                 GFileEnumeratorPrivate);
+  enumerator->priv = g_file_enumerator_get_instance_private (enumerator);
 }
 
 /**
@@ -180,6 +186,9 @@ g_file_enumerator_init (GFileEnumerator *enumerator)
  * returned from this function will contain attributes that match the 
  * attribute string that was passed when the #GFileEnumerator was created.
  *
+ * See the documentation of #GFileEnumerator for information about the
+ * order of returned files.
+ *
  * On error, returns %NULL and sets @error to the error. If the
  * enumerator is at the end, %NULL will be returned and @error will
  * be unset.
@@ -311,6 +320,9 @@ next_async_callback_wrapper (GObject      *source_object,
  * Request information for a number of files from the enumerator asynchronously.
  * When all i/o for the operation is finished the @callback will be called with
  * the requested information. 
+
+ * See the documentation of #GFileEnumerator for information about the
+ * order of returned files.
  *
  * The callback can be called with less than @num_files files in case of error
  * or at the end of the enumerator. In case of a partial error the callback will