Commit adf892e9 authored by Matthias Clasen's avatar Matthias Clasen

Annotate all examples with their language

The C ones, at least.
parent 701f00f1
......@@ -160,7 +160,7 @@ g_action_map_remove_action (GActionMap *action_map,
*
* Each action is constructed as per one #GActionEntry.
*
* |[
* |[<!-- language="C" -->
* static void
* activate_quit (GSimpleAction *simple,
* GVariant *parameter,
......
......@@ -47,7 +47,7 @@
*
* A typical implementation might look something like this:
*
* |[
* |[<!-- language="C" -->
* enum {
* NOT_INITIALIZED,
* INITIALIZING,
......
......@@ -57,7 +57,7 @@
* however, the "_finish()" function may be called at most once.
*
* Example of a typical asynchronous operation flow:
* |[
* |[<!-- language="C" -->
* void _theoretical_frobnitz_async (Theoretical *t,
* GCancellable *c,
* GAsyncReadyCallback cb,
......
......@@ -105,7 +105,7 @@ g_cancellable_class_init (GCancellableClass *klass)
* like this.
*
* An example of how to us this:
* |[
* |[<!-- language="C" -->
* /&ast; Make sure we don't do unnecessary work if already cancelled &ast;/
* if (g_cancellable_set_error_if_cancelled (cancellable, error))
* return;
......
......@@ -5794,7 +5794,7 @@ g_dbus_connection_call_sync_internal (GDBusConnection *connection,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_connection_call (connection,
* "org.freedesktop.StringThings",
* "/org/freedesktop/StringThings",
......@@ -5895,7 +5895,7 @@ g_dbus_connection_call_finish (GDBusConnection *connection,
*
* If the @parameters #GVariant is floating, it is consumed.
* This allows convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_connection_call_sync (connection,
* "org.freedesktop.StringThings",
* "/org/freedesktop/StringThings",
......
......@@ -55,7 +55,7 @@
* automatically map from D-Bus errors to #GError and back. This
* is typically done in the function returning the #GQuark for the
* error domain:
* |[
* |[<!-- language="C" -->
* /&ast; foo-bar-error.h: &ast;/
*
* #define FOO_BAR_ERROR (foo_bar_error_quark ())
......
......@@ -786,7 +786,7 @@ g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
*
* If the @value #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_set_cached_property (proxy,
* "SomeProperty",
* g_variant_new ("(si)",
......@@ -2966,7 +2966,7 @@ g_dbus_proxy_call_sync_internal (GDBusProxy *proxy,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_call (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",
......@@ -3057,7 +3057,7 @@ g_dbus_proxy_call_finish (GDBusProxy *proxy,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_call_sync (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",
......
......@@ -603,7 +603,7 @@ g_file_enumerator_get_container (GFileEnumerator *enumerator)
* inside loops with g_file_enumerator_next_file().
*
* This is a convenience method that's equivalent to:
* |[
* |[<!-- language="C" -->
* gchar *name = g_file_info_get_name (info);
* GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
* name);
......
......@@ -77,7 +77,7 @@
* of an extension point has a name, and a priority. Use
* g_io_extension_point_implement() to implement an extension point.
*
* |[
* |[<!-- language="C" -->
* GIOExtensionPoint *ep;
*
* /&ast; Register an extension point &ast;/
......@@ -85,7 +85,7 @@
* g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
* ]|
*
* |[
* |[<!-- language="C" -->
* /&ast; Implement an extension point &ast;/
* G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
* g_io_extension_point_implement ("my-extension-point",
......
......@@ -367,7 +367,7 @@ g_memory_output_stream_init (GMemoryOutputStream *stream)
* @size as 0 (allowing #GMemoryOutputStream to do the initial
* allocation for itself).
*
* |[
* |[<!-- language="C" -->
* /&ast; a stream that can grow &ast;/
* stream = g_memory_output_stream_new (NULL, 0, realloc, free);
*
......
......@@ -52,7 +52,7 @@
*
* Consider the following example:
*
* |[
* |[<!-- language="C" -->
* typedef struct
* {
* ...
......@@ -109,7 +109,7 @@
* ships a gschemas.compiled file as part of itself, and then simply do
* the following:
*
* |[
* |[<!-- language="C" -->
* {
* GSettings *settings;
* gint some_value;
......
......@@ -399,7 +399,7 @@ g_simple_action_class_init (GSimpleActionClass *class)
* call g_simple_action_set_state() from the handler.
*
* An example of a 'change-state' handler:
* |[
* |[<!-- language="C" -->
* static void
* change_volume_state (GSimpleAction *action,
* GVariant *value,
......
......@@ -106,7 +106,7 @@
* #GAsyncResult. A typical implementation of an asynchronous operation
* using GSimpleAsyncResult looks something like this:
*
* |[
* |[<!-- language="C" -->
* static void
* baked_cb (Cake *cake,
* gpointer user_data)
......
......@@ -32,7 +32,7 @@
* to try out each socket address in turn until one succeeds, as shown
* in the sample code below.
*
* |[
* |[<!-- language="C" -->
* MyConnectionType *
* connect_to_host (const char *hostname,
* guint16 port,
......
......@@ -50,7 +50,7 @@
* the return value.
*
* Here is an example for using GTask as a GAsyncResult:
* |[
* |[<!-- language="C" -->
* typedef struct {
* CakeFrostingType frosting;
* char *message;
......@@ -158,7 +158,7 @@
* and priority).
*
* Here is an example for chained asynchronous operations:
* |[
* |[<!-- language="C" -->
* typedef struct {
* Cake *cake;
* CakeFrostingType frosting;
......@@ -293,7 +293,7 @@
* #GMainContext when it completes.
*
* Running a task in a thread:
* |[
* |[<!-- language="C" -->
* typedef struct {
* guint radius;
* CakeFlavor flavor;
......@@ -377,7 +377,7 @@
* synchronous variants of blocking APIs.
*
* Cancelling a task:
* |[
* |[<!-- language="C" -->
* static void
* bake_cake_thread (GTask *task,
* gpointer source_object,
......
......@@ -257,7 +257,7 @@ g_themed_icon_class_init (GThemedIconClass *klass)
*
* For example, if the icon name was "gnome-dev-cdrom-audio", the array
* would become
* |[
* |[<!-- language="C" -->
* {
* "gnome-dev-cdrom-audio",
* "gnome-dev-cdrom",
......@@ -345,7 +345,7 @@ g_themed_icon_new_from_names (char **iconnames,
* that can be created by shortening @iconname at '-' characters.
*
* In the following example, @icon1 and @icon2 are equivalent:
* |[
* |[<!-- language="C" -->
* const char *names[] = {
* "gnome-dev-cdrom-audio",
* "gnome-dev-cdrom",
......
......@@ -622,7 +622,7 @@ g_volume_enumerate_identifiers (GVolume *volume)
* either be equal or a prefix of what this function returns. In
* other words, in code
*
* |[
* |[<!-- language="C" -->
* GMount *mount;
* GFile *mount_root
* GFile *volume_activation_root;
......@@ -632,7 +632,7 @@ g_volume_enumerate_identifiers (GVolume *volume)
* volume_activation_root = g_volume_get_activation_root (volume); /&ast; assume not NULL &ast;/
* ]|
* then the expression
* |[
* |[<!-- language="C" -->
* (g_file_has_prefix (volume_activation_root, mount_root) ||
g_file_equal (volume_activation_root, mount_root))
* ]|
......
......@@ -259,7 +259,7 @@
* and conversion specifier and append a conversion specifier.
*
* The following example prints "0x7b";
* |[
* |[<!-- language="C" -->
* gint16 value = 123;
* g_print ("%#" G_GINT16_MODIFIER "x", value);
* ]|
......@@ -275,7 +275,7 @@
* include the percent-sign, such that you can add precision and length
* modifiers between percent-sign and conversion specifier.
*
* |[
* |[<!-- language="C" -->
* gint16 in;
* gint32 out;
* sscanf ("42", "%" G_GINT16_FORMAT, &in)
......@@ -721,7 +721,7 @@
* data" to a callback, in the form of a void pointer. From time to time
* you want to pass an integer instead of a pointer. You could allocate
* an integer, with something like:
* |[
* |[<!-- language="C" -->
* int *ip = g_new (int, 1);
* *ip = 42;
* ]|
......@@ -731,7 +731,7 @@
* Pointers are always at least 32 bits in size (on all platforms GLib
* intends to support). Thus you can store at least 32-bit integer values
* in a pointer value. Naively, you might try this, but it's incorrect:
* |[
* |[<!-- language="C" -->
* gpointer p;
* int i;
* p = (void*) 42;
......@@ -739,7 +739,7 @@
* ]|
* Again, that example was not correct, don't copy it.
* The problem is that on some systems you need to do this:
* |[
* |[<!-- language="C" -->
* gpointer p;
* int i;
* p = (void*) (long) 42;
......@@ -1777,14 +1777,14 @@
* Accepts a macro or a string and converts it into a string after
* preprocessor argument expansion. For example, the following code:
*
* |[
* |[<!-- language="C" -->
* #define AGE 27
* const gchar *greeting = G_STRINGIFY (AGE) " today!";
* ]|
*
* is transformed by the preprocessor into (code equivalent to):
*
* |[
* |[<!-- language="C" -->
* const gchar *greeting = "27 today!";
* ]|
*/
......@@ -1798,7 +1798,7 @@
* @identifier1identifier2 from its expanded
* arguments @identifier1 and @identifier2. For example,
* the following code:
* |[
* |[<!-- language="C" -->
* #define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller)
* const gchar *name = GET (traveller, name);
* const gchar *quest = GET (traveller, quest);
......@@ -1806,7 +1806,7 @@
* ]|
*
* is transformed by the preprocessor into:
* |[
* |[<!-- language="C" -->
* const gchar *name = traveller_get_name (traveller);
* const gchar *quest = traveller_get_quest (traveller);
* GdkColor *favourite = traveller_get_favourite_colour (traveller);
......@@ -1846,7 +1846,7 @@
* Its value should be ignored. This can be accomplished by placing
* it as the first argument of a comma expression.
*
* |[
* |[<!-- language="C" -->
* #define ADD_ONE_TO_INT(x) \
* (G_STATIC_ASSERT_EXPR(sizeof (x) == sizeof (int)), ((x) + 1))
* ]|
......@@ -2078,7 +2078,7 @@
* semicolon. For arguments, place the attribute at the beginning of the
* argument declaration.
*
* |[
* |[<!-- language="C" -->
* void my_unused_function (G_GNUC_UNUSED gint unused_argument,
* gint other_argument) G_GNUC_UNUSED;
* ]|
......@@ -2102,7 +2102,7 @@
*
* See the GNU C documentation for more details.
*
* |[
* |[<!-- language="C" -->
* gint g_snprintf (gchar *string,
* gulong n,
* gchar const *format,
......@@ -2141,7 +2141,7 @@
*
* See the GNU C documentation for more details.
*
* |[
* |[<!-- language="C" -->
* gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
* ]|
*/
......@@ -2223,7 +2223,7 @@
* function declaration. While GCC allows the macro after the declaration,
* Sun Studio does not.
*
* |[
* |[<!-- language="C" -->
* G_GNUC_INTERNAL
* void _g_log_fallback_handler (const gchar *log_domain,
* GLogLevelFlags log_level,
......@@ -2253,7 +2253,7 @@
* Hints the compiler that the expression is likely to evaluate to
* a true value. The compiler may use this information for optimizations.
*
* |[
* |[<!-- language="C" -->
* if (G_LIKELY (random () != 1))
* g_print ("not one");
* ]|
......@@ -2270,7 +2270,7 @@
* Hints the compiler that the expression is unlikely to evaluate to
* a true value. The compiler may use this information for optimizations.
*
* |[
* |[<!-- language="C" -->
* if (G_UNLIKELY (random () == 1))
* g_print ("a random one");
* ]|
......
......@@ -68,7 +68,7 @@
* To free an array, use g_array_free().
*
* Here is an example that stores integers in a #GArray:
* |[
* |[<!-- language="C" -->
* GArray *garray;
* gint i;
* /&ast; We create a new array to store gint values.
......@@ -120,7 +120,7 @@ struct _GRealArray
* value is cast to the given type.
*
* This example gets a pointer to an element in a #GArray:
* |[
* |[<!-- language="C" -->
* EDayViewEvent *event;
* /&ast; This gets a pointer to the 4th element
* &ast; in the array of EDayViewEvent structs.
......@@ -816,7 +816,7 @@ g_array_maybe_expand (GRealArray *array,
* To free a pointer array, use g_ptr_array_free().
*
* An example using a #GPtrArray:
* |[
* |[<!-- language="C" -->
* GPtrArray *gparray;
* gchar *string1 = "one", *string2 = "two", *string3 = "three";
*
......@@ -1514,7 +1514,7 @@ g_ptr_array_foreach (GPtrArray *array,
* To free a #GByteArray, use g_byte_array_free().
*
* An example for using a #GByteArray:
* |[
* |[<!-- language="C" -->
* GByteArray *gbarray;
* gint i;
*
......
......@@ -726,7 +726,7 @@ g_async_queue_length_unlocked (GAsyncQueue *queue)
*
* If you were sorting a list of priority numbers to make sure the
* lowest priority would be at the top of the queue, you could use:
* |[
* |[<!-- language="C" -->
* gint32 id1;
* gint32 id2;
*
......
......@@ -101,7 +101,7 @@ volatile gboolean glib_on_error_halt = TRUE;
* The following example shows how it can be used together with
* the g_log() functions.
*
* |[
* |[<!-- language="C" -->
* #include <glib.h>
*
* static void
......
......@@ -161,7 +161,7 @@
* function.
*
* Instead, do the following:
* |[
* |[<!-- language="C" -->
* time_t ttime;
* GTime gtime;
*
......@@ -1286,7 +1286,7 @@ g_date_set_parse (GDate *d,
* the user's current timezone.
*
* To set the value of a date to the current day, you could write:
* |[
* |[<!-- language="C" -->
* g_date_set_time_t (date, time (NULL));
* ]|
*
......
......@@ -53,7 +53,7 @@
*
* Functions that can fail take a return location for a #GError as their
* last argument. For example:
* |[
* |[<!-- language="C" -->
* gboolean g_file_get_contents (const gchar *filename,
* gchar **contents,
* gsize *length,
......@@ -62,7 +62,7 @@
* If you pass a non-%NULL value for the <literal>error</literal>
* argument, it should point to a location where an error can be placed.
* For example:
* |[
* |[<!-- language="C" -->
* gchar *contents;
* GError *err = NULL;
*
......@@ -89,7 +89,7 @@
* Because g_file_get_contents() returns %FALSE on failure, if you
* are only interested in whether it failed and don't need to display
* an error message, you can pass %NULL for the @error argument:
* |[
* |[<!-- language="C" -->
* if (g_file_get_contents ("foo.txt", &contents, NULL, NULL)) /&ast; ignore errors &ast;/
* /&ast; no error occurred &ast;/ ;
* else
......@@ -115,7 +115,7 @@
* want to g_set_error(), then return immediately. g_set_error()
* does nothing if the error location passed to it is %NULL.
* Here's an example:
* |[
* |[<!-- language="C" -->
* gint
* foo_open_file (GError **error)
* {
......@@ -141,7 +141,7 @@
* function that can report a #GError. If the sub-function indicates
* fatal errors in some way other than reporting a #GError, such as
* by returning %TRUE on success, you can simply do the following:
* |[
* |[<!-- language="C" -->
* gboolean
* my_function_that_can_fail (GError **err)
* {
......@@ -163,7 +163,7 @@
* reporting a #GError, you need to create a temporary #GError
* since the passed-in one may be %NULL. g_propagate_error() is
* intended for use in this case.
* |[
* |[<!-- language="C" -->
* gboolean
* my_function_that_can_fail (GError **err)
* {
......@@ -188,7 +188,7 @@
* ]|
*
* Error pileups are always a bug. For example, this code is incorrect:
* |[
* |[<!-- language="C" -->
* gboolean
* my_function_that_can_fail (GError **err)
* {
......@@ -215,7 +215,7 @@
* of handling an error by always doing nothing about it. So the
* following code is fine, assuming errors in sub_function_that_can_fail()
* are not fatal to my_function_that_can_fail():
* |[
* |[<!-- language="C" -->
* gboolean
* my_function_that_can_fail (GError **err)
* {
......@@ -246,7 +246,7 @@
*
* - The error domain is called &lt;NAMESPACE&gt;_&lt;MODULE&gt;_ERROR,
* for example %G_SPAWN_ERROR or %G_THREAD_ERROR:
* |[
* |[<!-- language="C" -->
* #define G_SPAWN_ERROR g_spawn_error_quark ()
*
* GQuark
......
......@@ -289,7 +289,7 @@ g_mkdir_with_parents (const gchar *pathname,
* For example, you might think you could use %G_FILE_TEST_IS_SYMLINK
* to know whether it is safe to write to a file without being
* tricked into writing into a different location. It doesn't work!
* |[
* |[<!-- language="C" -->
* /&ast; DON'T DO THIS &ast;/
* if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK))
* {
......
......@@ -476,7 +476,7 @@ g_dngettext (const gchar *domain,
* <filename>glib/gi18n.h</filename>. For use in a library, you must include
* <filename>glib/gi18n-lib.h</filename> after defining the %GETTEXT_PACKAGE
* macro suitably for your library:
* |[
* |[<!-- language="C" -->
* #define GETTEXT_PACKAGE "gtk20"
* #include <glib/gi18n-lib.h>
* ]|
......@@ -542,7 +542,7 @@ g_dngettext (const gchar *domain,
* used as a context. This is mainly useful for short strings which
* may need different translations, depending on the context in which
* they are used.
* |[
* |[<!-- language="C" -->
* label1 = C_("Navigation", "Back");
* label2 = C_("Body part", "Back");
* ]|
......@@ -564,7 +564,7 @@ g_dngettext (const gchar *domain,
* where the translated strings can't be directly used, e.g. in string
* array initializers. To get the translated string, call gettext()
* at runtime.
* |[
* |[<!-- language="C" -->
* {
* static const char *messages[] = {
* N_("some very meaningful message"),
......@@ -593,7 +593,7 @@ g_dngettext (const gchar *domain,
* be directly used, e.g. in string array initializers. To get the
* translated string, you should call g_dpgettext2() at runtime.
*
* |[
* |[<!-- language="C" -->
* {
* static const char *messages[] = {
* NC_("some context", "some very meaningful message"),
......
......@@ -679,7 +679,7 @@ g_hash_table_new_full (GHashFunc hash_func,
* Initializes a key/value pair iterator and associates it with
* @hash_table. Modifying the hash table after calling this function
* invalidates the returned iterator.
* |[
* |[<!-- language="C" -->
* GHashTableIter iter;
* gpointer key, value;
*
......
......@@ -75,7 +75,7 @@
* g_list_insert() and g_list_insert_sorted().
*
* To visit all elements in the list, use a loop over the list:
* |[
* |[<!-- language="C" -->
* GList *l;
* for (l = list; l != NULL; l = l->next)
* {
......@@ -87,7 +87,7 @@
*
* To loop over the list and modify it (e.g. remove a certain element)
* a while loop is more appropriate, for example:
* |[
* |[<!-- language="C" -->
* GList *l = list;
* while (l != NULL)
* {
......@@ -236,7 +236,7 @@ g_list_free_full (GList *list,
* to avoid the inefficiency is to use g_list_prepend() and reverse
* the list with g_list_reverse() when all elements have been added.
*
* |[
* |[<!-- language="C" -->
* /&ast; Notice that these are initialized to the empty list. &ast;/
* GList *string_list = NULL, *number_list = NULL;
*
......@@ -288,7 +288,7 @@ g_list_append (GList *list,
* Note that the return value is the new start of the list,
* which will have changed, so make sure you store the new value.
*
* |[
* |[<!-- language="C" -->
* /&ast; Notice that it is initialized to the empty list. &ast;/
* GList *list = NULL;
*
......@@ -436,7 +436,7 @@ g_list_insert_before (GList *list,
*
* This function is for example used to move an element in the list.
* The following example moves an element to the top of the list:
* |[
* |[<!-- language="C" -->
* list = g_list_remove_link (list, llink);
* list = g_list_concat (llink, list);
* ]|
......@@ -578,7 +578,7 @@ g_list_remove_all (GList *list,
* This function is for example used to move an element in the list
* (see the example for g_list_concat()) or to remove an element in
* the list before freeing its data:
* |[
* |[<!-- language="C" -->
* list = g_list_remove_link (list, llink);
* free_some_data_that_may_access_the_list_again (llink->data);
* g_list_free (llink);
......@@ -650,12 +650,12 @@ g_list_copy (GList *list)
* if the copy function takes only one argument.
*
* For instance, if @list holds a list of GObjects, you can do:
* |[
* |[<!-- language="C" -->
* another_list = g_list_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
* ]|
*
* And, to entirely free the new list, you could do:
* |[
* |[<!-- language="C" -->
* g_list_free_full (another_list, g_object_unref);
* ]|
*
......
......@@ -2741,7 +2741,7 @@ get_dispatch (void)
* This function is useful in a situation like the following:
* Imagine an extremely simple "garbage collected" system.
*
* |[
* |[<!-- language="C" -->
* static GList *free_list;
*
* gpointer
......@@ -2778,7 +2778,7 @@ get_dispatch (void)
* doesn't work, since the idle function could be called from a
* recursive callback. This can be fixed by using g_main_depth()
*
* |[
* |[<!-- language="C" -->
* gpointer
* allocate_memory (gsize size)
* {
......@@ -2867,7 +2867,7 @@ g_main_current_source (void)
* from within idle handlers, but may have freed the object
* before the dispatch of your idle handler.
*
* |[
* |[<!-- language="C" -->
* static gboolean
* idle_callback (gpointer data)
* {
......@@ -2905,7 +2905,7 @@ g_main_current_source (void)
* this particular problem, is to check to if the source
* has already been destroy within the callback.
*
* |[
* |[<!-- language="C" -->
* static gboolean
* idle_callback (gpointer data)
* {
......@@ -4321,7 +4321,7 @@ g_main_context_get_poll_func (GMainContext *context)
* Another related use for this function is when implementing a main
* loop with a termination condition, computed from multiple threads:
*
* |[
* |[<!-- language="C" -->
* #define NUM_TASKS 10
* static volatile gint tasks_remaining = NUM_TASKS;
* ...
......@@ -4331,7 +4331,7 @@ g_main_context_get_poll_func (GMainContext *context)
* ]|
*
* Then in a thread:
* |[
* |[<!-- language="C" -->
* perform_work();
*
* if (g_atomic_int_dec_and_test (&tasks_remaining))
......
......@@ -1996,7 +1996,7 @@ g_markup_parse_context_get_user_data (GMarkupParseContext *context)
* As an example, see the following implementation of a simple
* parser that counts the number of tags encountered.
*
* |[
* |[<!-- language="C" -->
* typedef struct
* {
* gint tag_count;
......@@ -2038,7 +2038,7 @@ g_markup_parse_context_get_user_data (GMarkupParseContext *context)
* In order to allow this parser to be easily used as a subparser, the
* following interface is provided:
*
* |[
* |[<!-- language="C" -->
* void
* start_counting (GMarkupParseContext *context)
* {
......@@ -2063,7 +2063,7 @@ g_markup_parse_context_get_user_data (GMarkupParseContext *context)
*
* The subparser would then be used as follows:
*
* |[
* |[<!-- language="C" -->
* static void start_element (context, element_name, ...)
* {
* if (strcmp (element_name, "count-these") == 0)
......@@ -2523,7 +2523,7 @@ g_markup_vprintf_escaped (const gchar *format,
* output, without having to worry that the strings
* might themselves contain markup.
*
* |[
* |[<!-- language="C" -->
* const char *store = "Fortnum & Mason";
* const char *item = "Tea";
* char *output;
......
......@@ -538,19 +538,19 @@ g_log_set_fatal_mask (const gchar *log_domain,
*
* Here is an example for adding a log handler for all warning messages
* in the default domain:
* |[
* |[<!-- language="C" -->
* g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
*
* This example adds a log handler for all critical messages from GTK+:
* |[
* |[<!-- language="C" -->
* g_log_set_handler ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
*
* This example adds a log handler for all messages from GLib:
* |[
* |[<!-- language="C" -->
* g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
......@@ -1146,7 +1146,7 @@ g_assert_warning (const char *log_domain,
*
* For example:
*
* |[
* |[<!-- language="C" -->
* /&ast; g_main_context_push_thread_default() should fail if the
* &ast; context is already owned by another thread.
* &ast;/
......
......@@ -91,7 +91,7 @@
*
* Here is a complete example of setting up GOption to parse the example
* commandline above and produce the example help output.
* |[
* |[<!-- language="C" -->