Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(),
authorMatthias Clasen <mclasen@redhat.com>
Mon, 8 Nov 2004 18:26:56 +0000 (18:26 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 8 Nov 2004 18:26:56 +0000 (18:26 +0000)
2004-11-08  Matthias Clasen  <mclasen@redhat.com>

* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)

16 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/glib/tmpl/hooks.sgml
docs/reference/glib/tmpl/iochannels.sgml
glib/gasyncqueue.c
glib/gasyncqueue.h
glib/ghook.c
glib/ghook.h
glib/giochannel.c
glib/giochannel.h
glib/gmain.c
glib/gmain.h

index 07ce92a54c465a752972178735ba5c93b2d2d111..4adb442868d4a9daaf75677eb3256a3694a4b198 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-11-08  Matthias Clasen  <mclasen@redhat.com>
-       
+
+       * glib/gasyncqueue.[hc]:
+       * glib/ghook.[hc]: 
+       * glib/gmain.[hc]:
+       * glib/giochannel.[hc]: Make g_io_channel_ref(), 
+       g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
+       return the passed in pointer. (#151663, Manish Singh)
+
        * glib/gmain.c: Initialize child_watch_count to 1, so 
        that we don't miss the very first child if it exits 
        before we set up the child watch. In that case we had 
index 07ce92a54c465a752972178735ba5c93b2d2d111..4adb442868d4a9daaf75677eb3256a3694a4b198 100644 (file)
@@ -1,5 +1,12 @@
 2004-11-08  Matthias Clasen  <mclasen@redhat.com>
-       
+
+       * glib/gasyncqueue.[hc]:
+       * glib/ghook.[hc]: 
+       * glib/gmain.[hc]:
+       * glib/giochannel.[hc]: Make g_io_channel_ref(), 
+       g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
+       return the passed in pointer. (#151663, Manish Singh)
+
        * glib/gmain.c: Initialize child_watch_count to 1, so 
        that we don't miss the very first child if it exits 
        before we set up the child watch. In that case we had 
index 07ce92a54c465a752972178735ba5c93b2d2d111..4adb442868d4a9daaf75677eb3256a3694a4b198 100644 (file)
@@ -1,5 +1,12 @@
 2004-11-08  Matthias Clasen  <mclasen@redhat.com>
-       
+
+       * glib/gasyncqueue.[hc]:
+       * glib/ghook.[hc]: 
+       * glib/gmain.[hc]:
+       * glib/giochannel.[hc]: Make g_io_channel_ref(), 
+       g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
+       return the passed in pointer. (#151663, Manish Singh)
+
        * glib/gmain.c: Initialize child_watch_count to 1, so 
        that we don't miss the very first child if it exits 
        before we set up the child watch. In that case we had 
index 07ce92a54c465a752972178735ba5c93b2d2d111..4adb442868d4a9daaf75677eb3256a3694a4b198 100644 (file)
@@ -1,5 +1,12 @@
 2004-11-08  Matthias Clasen  <mclasen@redhat.com>
-       
+
+       * glib/gasyncqueue.[hc]:
+       * glib/ghook.[hc]: 
+       * glib/gmain.[hc]:
+       * glib/giochannel.[hc]: Make g_io_channel_ref(), 
+       g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
+       return the passed in pointer. (#151663, Manish Singh)
+
        * glib/gmain.c: Initialize child_watch_count to 1, so 
        that we don't miss the very first child if it exits 
        before we set up the child watch. In that case we had 
index 07ce92a54c465a752972178735ba5c93b2d2d111..4adb442868d4a9daaf75677eb3256a3694a4b198 100644 (file)
@@ -1,5 +1,12 @@
 2004-11-08  Matthias Clasen  <mclasen@redhat.com>
-       
+
+       * glib/gasyncqueue.[hc]:
+       * glib/ghook.[hc]: 
+       * glib/gmain.[hc]:
+       * glib/giochannel.[hc]: Make g_io_channel_ref(), 
+       g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
+       return the passed in pointer. (#151663, Manish Singh)
+
        * glib/gmain.c: Initialize child_watch_count to 1, so 
        that we don't miss the very first child if it exits 
        before we set up the child watch. In that case we had 
index 851f2fd0f02444a2a12391196b427198e91f1e83..7387a890e68cfa4d6a75cd2e0e27275307cf498b 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-08  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/tmpl/hooks.sgml: 
+       * glib/tmpl/iochannels.sgml: Updates
+
 2004-11-04  Tor Lillqvist  <tml@iki.fi>
 
        * glib/tmpl/windows.sgml: Improve G_WIN32_HAVE_WIDECHAR_API
index 677bf5ae2ead722b9ec575767a42ce886ebb64cb..842d4e8032aaf3beff381768885531e17ce66620 100644 (file)
@@ -417,7 +417,7 @@ Increments the reference count for a #GHook.
 
 @hook_list: a #GHookList.
 @hook: the #GHook to increment the reference count of.
-
+@returns: the @hook that was passed in (since 2.6)
 
 <!-- ##### FUNCTION g_hook_unref ##### -->
 <para>
index 9445bfd21fb09eabf4a02e24ce8d3889de09f419..443da42fa5639f5a9f7297bf390e985701c94636 100644 (file)
@@ -301,7 +301,7 @@ Increments the reference count of a #GIOChannel.
 </para>
 
 @channel: a #GIOChannel.
-
+@Returns:  the @channel that was passed in (since 2.6)
 
 <!-- ##### FUNCTION g_io_channel_unref ##### -->
 <para>
index c2e941d67e571aabc2865c765e036640de9923c1..6822f7deef76b5f081574ca4471989451a442a28 100644 (file)
@@ -64,14 +64,18 @@ g_async_queue_new (void)
  *
  * Increases the reference count of the asynchronous @queue by 1. You
  * do not need to hold the lock to call this function.
+ *
+ * Returns: the @queue that was passed in (since 2.6)
  **/
-void 
+GAsyncQueue *
 g_async_queue_ref (GAsyncQueue *queue)
 {
   g_return_if_fail (queue);
   g_return_if_fail (g_atomic_int_get (&queue->ref_count) > 0);
   
   g_atomic_int_inc (&queue->ref_count);
+
+  return queue;
 }
 
 /**
index 80044e0bc382e0e935970366fd7860230586f01f..e26add9b7fd96ac883e876bd951c8bc0fef76668 100644 (file)
@@ -47,7 +47,7 @@ void          g_async_queue_lock               (GAsyncQueue *queue);
 void          g_async_queue_unlock             (GAsyncQueue *queue);
 
 /* Ref and unref the GAsyncQueue. */
-void          g_async_queue_ref                (GAsyncQueue *queue);
+GAsyncQueue*  g_async_queue_ref                (GAsyncQueue *queue);
 void          g_async_queue_unref              (GAsyncQueue *queue);
 #ifndef G_DISABLE_DEPRECATED
 /* You don't have to hold the lock for calling *_ref and *_unref anymore. */
index 70d3e36bdbd926bc8364e14af54380aa9950f50b..83ef80979e5e62c01ea6f114e54694b00d0310e0 100644 (file)
@@ -222,7 +222,7 @@ g_hook_unref (GHookList *hook_list,
     }
 }
 
-void
+GHook *
 g_hook_ref (GHookList *hook_list,
            GHook     *hook)
 {
@@ -231,6 +231,8 @@ g_hook_ref (GHookList *hook_list,
   g_return_if_fail (hook->ref_count > 0);
   
   hook->ref_count++;
+
+  return hook;
 }
 
 void
index 422284c0798ebca6494d1bc5ef7604ea996a759c..a552bfb0cf2325d747e265f1badad0424e3886d1 100644 (file)
@@ -105,7 +105,7 @@ void         g_hook_list_clear              (GHookList              *hook_list);
 GHook*  g_hook_alloc                   (GHookList              *hook_list);
 void    g_hook_free                    (GHookList              *hook_list,
                                         GHook                  *hook);
-void    g_hook_ref                     (GHookList              *hook_list,
+GHook *         g_hook_ref                     (GHookList              *hook_list,
                                         GHook                  *hook);
 void    g_hook_unref                   (GHookList              *hook_list,
                                         GHook                  *hook);
index 1436ab496cc9524fb0affa2cdbd31c284534094d..c911a2687fa037308effc2662e8a323b36af3796 100644 (file)
@@ -91,12 +91,14 @@ g_io_channel_init (GIOChannel *channel)
   channel->close_on_unref = FALSE;
 }
 
-void 
+GIOChannel *
 g_io_channel_ref (GIOChannel *channel)
 {
   g_return_if_fail (channel != NULL);
 
   channel->ref_count++;
+
+  return channel;
 }
 
 void 
index b23be3e641d560c8bbfc02d226c00fb6aaab1cd0..aa812be49f2eaaf6c1dbcc348d237454b3884dd9 100644 (file)
@@ -163,7 +163,7 @@ struct _GIOFuncs
 };
 
 void        g_io_channel_init   (GIOChannel    *channel);
-void        g_io_channel_ref    (GIOChannel    *channel);
+GIOChannel *g_io_channel_ref    (GIOChannel    *channel);
 void        g_io_channel_unref  (GIOChannel    *channel);
 
 #ifndef G_DISABLE_DEPRECATED
index c522aba24ac633923e888537d6a24e9895b30761..7ee0b1a05ba34e3e32efb069040aab1d862ef1fc 100644 (file)
@@ -589,8 +589,10 @@ g_poll (GPollFD *fds,
  * @context: a #GMainContext
  * 
  * Increases the reference count on a #GMainContext object by one.
+ *
+ * Returns: the @context that was passed in (since 2.6)
  **/
-void
+GMainContext *
 g_main_context_ref (GMainContext *context)
 {
   g_return_if_fail (context != NULL);
index 66fb51c88f9120cbd50f26c836cc92b81f7299f3..2bbf607681d937bb18ba5fe6db1189f6ebe538fb 100644 (file)
@@ -136,7 +136,7 @@ struct _GPollFD
 /* GMainContext: */
 
 GMainContext *g_main_context_new       (void);
-void          g_main_context_ref       (GMainContext *context);
+GMainContext *g_main_context_ref       (GMainContext *context);
 void          g_main_context_unref     (GMainContext *context);
 GMainContext *g_main_context_default   (void);