Commit 2ae1a46b authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Add g_object_add/remove_toggle_ref() functions to get notification when a

2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * gobject.[ch] gobject.symbols: Add
        g_object_add/remove_toggle_ref() functions to get notification
        when a reference count is the last remaining reference; this
        enables better memory management for language bindings.
        (http://mail.gnome.org/archives/gtk-devel-list/2005-April/msg00095.html)

2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * glib/gdataset.[ch] glib/gdatasetprivate.h: Add
        g_datalist_set/unset_flags(), g_datalist_get_flags() functions
        to squeeze some bits into a GDataSet... this is needed for
        efficient implementation of toggle references in GObject.

        * tests/gobject/references.c tests/gobject/Makefile.am:
        Add a test case for weak and toggle references.

        * glib/gfileutils.[ch]: Rename g_file_replace() back
        to g_file_set_contents().

        * glib/glib.symbols: Update.

2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt:
        Update

        * gobject/tmpl/objects.sgml: Document toggle-references.
parent 1167d7d6
2005-05-05 Owen Taylor <otaylor@redhat.com>
* glib/gdataset.[ch] glib/gdatasetprivate.h: Add
g_datalist_set/unset_flags(), g_datalist_get_flags() functions
to squeeze some bits into a GDataSet... this is needed for
efficient implementation of toggle references in GObject.
* tests/gobject/references.c tests/gobject/Makefile.am:
Add a test case for weak and toggle references.
* glib/gfileutils.[ch]: Rename g_file_replace() back
to g_file_set_contents().
* glib/glib.symbols: Update.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_str_equal, g_str_hash): Move docs
......
2005-05-05 Owen Taylor <otaylor@redhat.com>
* glib/gdataset.[ch] glib/gdatasetprivate.h: Add
g_datalist_set/unset_flags(), g_datalist_get_flags() functions
to squeeze some bits into a GDataSet... this is needed for
efficient implementation of toggle references in GObject.
* tests/gobject/references.c tests/gobject/Makefile.am:
Add a test case for weak and toggle references.
* glib/gfileutils.[ch]: Rename g_file_replace() back
to g_file_set_contents().
* glib/glib.symbols: Update.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_str_equal, g_str_hash): Move docs
......
2005-05-05 Owen Taylor <otaylor@redhat.com>
* glib/gdataset.[ch] glib/gdatasetprivate.h: Add
g_datalist_set/unset_flags(), g_datalist_get_flags() functions
to squeeze some bits into a GDataSet... this is needed for
efficient implementation of toggle references in GObject.
* tests/gobject/references.c tests/gobject/Makefile.am:
Add a test case for weak and toggle references.
* glib/gfileutils.[ch]: Rename g_file_replace() back
to g_file_set_contents().
* glib/glib.symbols: Update.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_str_equal, g_str_hash): Move docs
......
2005-05-05 Owen Taylor <otaylor@redhat.com>
* glib/gdataset.[ch] glib/gdatasetprivate.h: Add
g_datalist_set/unset_flags(), g_datalist_get_flags() functions
to squeeze some bits into a GDataSet... this is needed for
efficient implementation of toggle references in GObject.
* tests/gobject/references.c tests/gobject/Makefile.am:
Add a test case for weak and toggle references.
* glib/gfileutils.[ch]: Rename g_file_replace() back
to g_file_set_contents().
* glib/glib.symbols: Update.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_str_equal, g_str_hash): Move docs
......
2005-05-05 Owen Taylor <otaylor@redhat.com>
* glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt:
Update
* gobject/tmpl/objects.sgml: Document toggle-references.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/hash_tables.sgml: Move some docs inline.
......
......@@ -22,6 +22,7 @@ IGNORE_HFILES= \
build \
gobject \
config.h \
gdatasetprivate.h \
glibintl.h \
gbsearcharray.h \
gmoduleconf.h \
......
......@@ -980,7 +980,7 @@ G_FILE_ERROR
GFileTest
g_file_error_from_errno
g_file_get_contents
g_file_replace
g_file_set_contents
g_file_test
g_mkstemp
g_file_open_tmp
......@@ -1345,6 +1345,7 @@ g_nullify_pointer
<SUBSECTION Private>
G_NATIVE_ATEXIT
g_ATEXIT
g_win32_get_system_data_dirs_for_module
ATEXIT
</SECTION>
......@@ -1970,6 +1971,10 @@ g_datalist_remove_no_notify
<SUBSECTION>
g_datalist_foreach
g_datalist_clear
g_datalist_set_flags
g_datalist_unset_flags
g_datalist_get_flags
G_DATALIST_FLAGS_MASK
</SECTION>
......
......@@ -34,6 +34,9 @@ elements. Each must use separate allocators.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GAllocator ##### -->
<para>
The <structname>GAllocator</structname> struct contains private data. and should only be accessed
......
......@@ -55,6 +55,9 @@ To free an array, use g_array_free().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GArray ##### -->
<para>
Contains the public fields of an <link linkend="glib-arrays">Array</link>.
......
......@@ -60,6 +60,9 @@ To free a pointer array, use g_ptr_array_free().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GPtrArray ##### -->
<para>
Contains the public fields of a pointer array.
......
......@@ -63,6 +63,9 @@ locking function variants (those without the suffix _unlocked)
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GAsyncQueue ##### -->
<para>
The #GAsyncQueue struct is an opaque data structure, which represents
......
......@@ -60,6 +60,9 @@ g_atomic_pointer_compare_and_exchange() respectively.
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION g_atomic_int_get ##### -->
<para>
Reads the value of the integer pointed to by @atomic. Also acts as
......
......@@ -44,6 +44,9 @@ as the standard byte order (which is in fact the big-endian byte order).
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_BYTE_ORDER ##### -->
<para>
The host byte order.
......
......@@ -26,6 +26,9 @@ A #GCache value is the actual resource.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GCache ##### -->
<para>
The #GCache struct is an opaque data structure containing information about
......
......@@ -161,6 +161,9 @@ export G_FILENAME_ENCODING=ISO-8859-1
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION g_convert ##### -->
<para>
......
......@@ -47,6 +47,9 @@ To remove all data elements from a datalist, use g_datalist_clear().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GData ##### -->
<para>
The #GData struct is an opaque data structure to represent a
......@@ -202,3 +205,37 @@ The data elements' destroy functions are called if they have been set.
@datalist: a datalist.
<!-- ##### FUNCTION g_datalist_set_flags ##### -->
<para>
</para>
@datalist:
@flags:
<!-- ##### FUNCTION g_datalist_unset_flags ##### -->
<para>
</para>
@datalist:
@flags:
<!-- ##### FUNCTION g_datalist_get_flags ##### -->
<para>
</para>
@datalist:
@Returns:
<!-- ##### MACRO G_DATALIST_FLAGS_MASK ##### -->
<para>
</para>
......@@ -49,6 +49,9 @@ To destroy a dataset, use g_dataset_destroy().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO g_dataset_id_set_data ##### -->
<para>
Sets the data element associated with the given #GQuark id.
......
......@@ -63,6 +63,9 @@ can request the current time as a #GTimeVal with g_get_current_time().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_USEC_PER_SEC ##### -->
<para>
Number of microseconds in one second (1 million). This macro is provided for
......
......@@ -370,6 +370,9 @@ Summary of rules for use of #GError:
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GError ##### -->
<para>
The <structname>GError</structname> structure contains
......
......@@ -38,6 +38,9 @@ g_dir_read_name(), g_dir_rewind(), g_dir_close().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GFileError ##### -->
<para>
Values corresponding to <literal>errno</literal> codes returned from file operations
......@@ -165,6 +168,18 @@ A test to perform on a file using g_file_test().
@Returns:
<!-- ##### FUNCTION g_file_set_contents ##### -->
<para>
</para>
@filename:
@contents:
@length:
@error:
@Returns:
<!-- ##### FUNCTION g_file_test ##### -->
<para>
......@@ -346,3 +361,33 @@ An opaque structure representing an opened directory.
@Returns:
<!-- ##### FUNCTION g_chmod ##### -->
<para>
</para>
@filename:
@mode:
@Returns:
<!-- ##### FUNCTION g_access ##### -->
<para>
</para>
@filename:
@mode:
@Returns:
<!-- ##### FUNCTION g_creat ##### -->
<para>
</para>
@filename:
@mode:
@Returns:
......@@ -44,6 +44,10 @@ serializes and deserializes a desktop entry.
Desktop Entry Parser
<!-- ##### SECTION ./tmpl/glib-unused.sgml:Stability_Level ##### -->
<!-- ##### ENUM GChannelError ##### -->
<para>
......@@ -629,6 +633,17 @@ in any UNIX manual.
@error:
@Returns:
<!-- ##### FUNCTION g_file_replace ##### -->
<para>
</para>
@filename:
@contents:
@length:
@error:
@Returns:
<!-- ##### FUNCTION g_io_channel_error_quark ##### -->
<para>
......
......@@ -331,14 +331,14 @@ This function is deprecated and will be removed in the next major
@v1:
@v2:
@Returns:
@Returns:
<!-- ##### FUNCTION g_str_hash ##### -->
<para>
</para>
@v:
@Returns:
@v:
@Returns:
......@@ -17,6 +17,9 @@ and the list of hook functions can be invoked.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GHookList ##### -->
<para>
The <structname>GHookList</structname> struct represents a
......
......@@ -27,6 +27,9 @@ the GETTEXT_PACKAGE macro suitably for your library:
The gettext manual.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO _ ##### -->
<para>
Marks a string for translation, gets replaced with the translated string
......
......@@ -64,6 +64,9 @@ Convenience functions for creating #GIOChannel instances and adding them to the
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GIOChannel ##### -->
<para>
A data structure representing an IO Channel. The fields should be considered
......
......@@ -97,6 +97,9 @@ Key and Group names are case-sensitive, for example a group called
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GKeyFile ##### -->
<para>
The <structname>GKeyFile</structname> struct contains only private fields
......
......@@ -15,6 +15,9 @@ the standard integer and floating point types.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_MININT ##### -->
<para>
The minimum value which can be held in a #gint.
......
......@@ -64,6 +64,9 @@ To free the entire list, use g_list_free().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GList ##### -->
<para>
The #GList struct is used for each element in a doubly-linked list.
......
......@@ -64,6 +64,9 @@ To free the entire list, use g_slist_free().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GSList ##### -->
<para>
The #GSList struct is used for each element in the singly-linked list.
......@@ -74,7 +77,6 @@ The #GSList struct is used for each element in the singly-linked list.
<link linkend="glib-Type-Conversion-Macros">Type Conversion Macros</link>.
@next: contains the link to the next element in the list.
<!-- ##### FUNCTION g_slist_alloc ##### -->
<para>
Allocates space for one #GSList element.
......
......@@ -14,6 +14,9 @@ These macros provide a few commonly-used features.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_OS_WIN32 ##### -->
<para>
This macro is defined only on Windows. So you can bracket
......
......@@ -15,6 +15,9 @@ by application programmers.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_INLINE_FUNC ##### -->
<para>
Used to declare inline functions. If inline functions are not supported on
......@@ -238,6 +241,8 @@ See the GNU C documentation for details.
Since: 2.8
<!-- ##### MACRO G_GNUC_FUNCTION ##### -->
<para>
Expands to the GNU C <literal>__FUNCTION__</literal> variable if the
......
......@@ -101,6 +101,9 @@ manages all available sources of events.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GMainLoop ##### -->
<para>
The <structname>GMainLoop</structname> struct is an opaque data type
......
......@@ -85,6 +85,9 @@ Sections marked as CDATA
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GMarkupError ##### -->
<para>
Error codes returned by markup parsing.
......
......@@ -20,6 +20,9 @@ This also means that there is no need to check if the call succeeded.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO g_new ##### -->
<para>
Allocates @n_structs elements of type @struct_type.
......@@ -228,18 +231,12 @@ Wraps g_alloca() in a more typesafe manner.
<!-- ##### MACRO g_memmove ##### -->
<para>
Copies a block of memory @n bytes long, from @s to @d.
The source and destination areas may overlap.
</para>
<para>
In order to use this function, you must include <filename>string.h</filename>
yourself, because this macro will typically simply resolve
to <function>memmove()</function> and GLib does not include <filename>string.h</filename> for you.
</para>
@d: the destination address to copy the bytes to.
@s: the source address to copy the bytes from.
@n: the number of bytes to copy.
@dest:
@src:
@len:
<!-- ##### FUNCTION g_memdup ##### -->
......
......@@ -122,6 +122,9 @@ To help debug memory chunks, use g_mem_chunk_info() and g_mem_chunk_print().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GMemChunk ##### -->
<para>
The #GMemChunk struct is an opaque data structure representing a memory
......
......@@ -20,6 +20,9 @@ These can be extended with user-defined levels.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_LOG_DOMAIN ##### -->
<para>
Defines the log domain.
......
......@@ -14,6 +14,9 @@ These are portable utility functions.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION g_get_application_name ##### -->
<para>
......@@ -74,12 +77,20 @@ These are portable utility functions.
@variable:
<!-- ##### FUNCTION g_listenv ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION g_get_user_name ##### -->
<para>
</para>
@Returns:
@Returns:
<!-- ##### FUNCTION g_get_real_name ##### -->
......@@ -87,7 +98,7 @@ These are portable utility functions.
</para>
@Returns:
@Returns:
<!-- ##### FUNCTION g_get_user_cache_dir ##### -->
......@@ -151,7 +162,7 @@ These are portable utility functions.
</para>
@Returns:
@Returns:
<!-- ##### FUNCTION g_basename ##### -->
......@@ -181,8 +192,8 @@ The returned string should be freed when no longer needed.
</para>
@file_name:
@Returns:
@file_name:
@Returns:
<!-- ##### FUNCTION g_path_skip_root ##### -->
......@@ -309,8 +320,8 @@ larger than @num.
@string:
@keys:
@nkeys:
@Returns:
@nkeys:
@Returns:
<!-- ##### STRUCT GDebugKey ##### -->
......
......@@ -88,6 +88,9 @@ just_say_hello (const char *filename, GError **error)
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GModule ##### -->
<para>
The #GModule struct is an opaque data structure to represent a
......
......@@ -24,6 +24,9 @@ The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the
<ulink url="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</ulink>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO G_IEEE754_FLOAT_BIAS ##### -->
<para>
See <ulink url="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</ulink>
......
......@@ -124,6 +124,9 @@ main (int argc, char *argv[])
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GOptionError ##### -->
<para>
Error codes returned by option parsing.
......
......@@ -30,6 +30,9 @@ pattern compilation.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GPatternSpec ##### -->
<para>
A <structname>GPatternSpec</structname> is the 'compiled' form of a pattern.
......
......@@ -31,6 +31,9 @@ To find the #GQuark corresponding to a given string, use g_quark_try_string().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF GQuark ##### -->
<para>
A GQuark is an integer which uniquely identifies a particular string.
......
......@@ -35,6 +35,9 @@ To free the entire queue, use g_queue_free().
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GQueue ##### -->
<para>
Contains the public fields of a <link linkend="glib-queues">Queue</link>.
......