+2007-11-25 Matthias Clasen <mclasen@redhat.com>
+
+ * configure.in: Require gtk-doc 1.8.
+
+ * glib/gasyncqueue.c:
+ * glib/gdate.c:
+ * glib/gfileutils.c:
+ * glib/gmain.c:
+ * glib/gmarkup.c:
+ * glib/gregex.c:
+ * glib/gtestutils.c:
+ * glib/gutils.c: Use gtk-doc abbreviations for
+ examples in doc comments.
+
2007-11-24 Matthias Clasen <mclasen@redhat.com>
* */Makefile.am: Replace INCLUDES by AM_CPPFLAGS, other
dnl *** Checks for gtk-doc ***
dnl **************************
-GTK_DOC_CHECK([1.4])
+GTK_DOC_CHECK([1.8])
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
*
* 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:
- * <informalexample><programlisting>
+ * |[
* gint32 id1;
* gint32 id2;
*
* id2 = GPOINTER_TO_INT (element2);
*
* return (id1 > id2 ? +1 : id1 == id2 ? 0 : -1);
- * </programlisting></informalexample>
+ * ]|
*
* Since: 2.10
**/
* Sets the value of a date from a <type>time_t</type> value.
*
* To set the value of a date to the current day, you could write:
- * <informalexample><programlisting>
+ * |[
* g_date_set_time_t (date, time (NULL));
- * </programlisting></informalexample>
+ * ]|
*
* Since: 2.10
*/
* For example, you might think you could use %G_FILE_TEST_IS_SYMLINK
* to know whether it is is safe to write to a file without being
* tricked into writing into a different location. It doesn't work!
- *
- * <informalexample><programlisting>
+ * |[
* /* DON'T DO THIS */
- * if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK)) {
- * fd = g_open (filename, O_WRONLY);
- * /* write to fd */
- * }
- * </programlisting></informalexample>
+ * if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK))
+ * {
+ * fd = g_open (filename, O_WRONLY);
+ * /* write to fd */
+ * }
+ * ]|
*
* Another thing to note is that %G_FILE_TEST_EXISTS and
* %G_FILE_TEST_IS_EXECUTABLE are implemented using the access()
* from within idle handlers, but may have freed the object
* before the dispatch of your idle handler.
*
- * <informalexample><programlisting>
+ * |[
* static gboolean
* idle_callback (gpointer data)
* {
*
* G_OBJECT_CLASS (parent_class)->finalize (object);
* }
- * </programlisting></informalexample>
+ * ]|
*
* This will fail in a multi-threaded application if the
* widget is destroyed before the idle handler fires due
* this particular problem, is to check to if the source
* has already been destroy within the callback.
*
- * <informalexample><programlisting>
+ * |[
* static gboolean
* idle_callback (gpointer data)
* {
*
* return FALSE;
* }
- * </programlisting></informalexample>
+ * ]|
*
* Return value: %TRUE if the source has been destroyed
*
* output, without having to worry that the strings
* might themselves contain markup.
*
- * <informalexample><programlisting>
+ * |[
* const char *store = "Fortnum & Mason";
* const char *item = "Tea";
* char *output;
* "<item>%s</item>"
* "</purchase>",
* store, item);
- * </programlisting></informalexample>
+ * ]|
*
* Return value: newly allocated result from formatting
* operation. Free with g_free().
* To retrieve all the non-overlapping matches of the pattern in
* string you can use g_match_info_next().
*
- * <informalexample><programlisting>
+ * |[
* static void
* print_uppercase_words (const gchar *string)
* {
* g_match_info_free (match_info);
* g_regex_unref (regex);
* }
- * </programlisting></informalexample>
+ * ]|
*
* Returns: %TRUE is the string matched, %FALSE otherwise
*
* To retrieve all the non-overlapping matches of the pattern in
* string you can use g_match_info_next().
*
- * <informalexample><programlisting>
+ * |[
* static void
* print_uppercase_words (const gchar *string)
* {
* g_error_free (error);
* }
* }
- * </programlisting></informalexample>
+ * ]|
*
* Returns: %TRUE is the string matched, %FALSE otherwise
*
* The forking parent process then asserts successfull child program
* termination and validates cihld program outputs.
*
- * <informalexample><programlisting>
+ * |[
* static void
* test_fork_patterns (void)
* {
* g_test_trap_assert_stdout ("*somagic17*");
* g_test_trap_assert_stderr ("*semagic43*");
* }
- * </programlisting></informalexample>
+ * ]|
*
* Returns: %TRUE for the forked child and %FALSE for the executing parent process.
*/
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
+#include <libintl.h>
#include <locale.h>
#include <string.h>
#include <ctype.h> /* For tolower() */
* g_get_homedir() not pay attention to <envar>HOME</envar> and to
* return the real home directory for the user. If applications
* want to pay attention to <envar>HOME</envar>, they can do:
- * <informalexample><programlisting>
+ * |[
* const char *homedir = g_getenv ("HOME");
* if (!homedir)
* homedir = g_get_homedir (<!-- -->);
- * </programlisting></informalexample>
+ * ]|
*
* Returns: the current user's home directory
*/
g_get_language_names ();
}
-#ifdef ENABLE_NLS
-
-#include <libintl.h>
-
#ifdef G_OS_WIN32
/**
if (!_glib_gettext_initialized)
{
#ifdef G_OS_WIN32
- gchar *tmp = _glib_get_locale_dir();
- bindtextdomain(GETTEXT_PACKAGE, tmp);
- g_free(tmp);
+ gchar *tmp = _glib_get_locale_dir ();
+ bindtextdomain (GETTEXT_PACKAGE, tmp);
+ g_free (tmp);
#else
- bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
+ bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
#endif
# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
return dgettext (GETTEXT_PACKAGE, str);
}
-#endif /* ENABLE_NLS */
-
#ifdef G_OS_WIN32
/* Binary compatibility versions. Not for newly compiled code. */