From 67c48e49ee85e66c31b7b4c54e5eb0dac5789096 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 18 Jun 2003 23:12:56 +0000 Subject: [PATCH] Move the documentation inline and add details. (#108505) Move 2003-06-19 Matthias Clasen * glib/gutils.c (g_path_get_basename): Move the documentation inline and add details. (#108505) * glib/tmpl/misc_utils.sgml: Move g_path_get_basename() docs inline. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ docs/reference/ChangeLog | 6 +++++- docs/reference/glib/tmpl/misc_utils.sgml | 21 ++++++++++----------- glib/gutils.c | 17 ++++++++++++++++- 9 files changed, 61 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d1456b..815296c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3d1456b..815296c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 3d1456b..815296c 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3d1456b..815296c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3d1456b..815296c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3d1456b..815296c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2003-06-19 Matthias Clasen + + * glib/gutils.c (g_path_get_basename): Move the documentation + inline and add details. (#108505) + 2003-06-18 Matthias Clasen * acinclude.m4 (JH_PATH_XML_CATALOG, JH_CHECK_XML_CATALOG): New diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 64bb6ca..78b0fd7 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,6 +1,10 @@ +2003-06-19 Matthias Clasen + + * glib/tmpl/misc_utils.sgml: Move g_path_get_basename() docs inline. + 2003-06-18 Matthias Clasen - * glib/glib-sections.txt: Add g_thread_init_glib to silence gtk-doc. +o * glib/glib-sections.txt: Add g_thread_init_glib to silence gtk-doc. * gobject/Makefile.am: Add rule to regenerate man pages from Docbook. diff --git a/docs/reference/glib/tmpl/misc_utils.sgml b/docs/reference/glib/tmpl/misc_utils.sgml index 3b10f85..0cc37b0 100644 --- a/docs/reference/glib/tmpl/misc_utils.sgml +++ b/docs/reference/glib/tmpl/misc_utils.sgml @@ -22,6 +22,14 @@ These are portable utility functions. @Returns: + + + + + +@application_name: + + Gets the name of the program. This name should NOT be localized, @@ -146,20 +154,11 @@ path it returns %NULL. -Gets the name of the file without any leading directory components. -The returned string should be freed when no longer needed. - - - -This function allocates new memory for the returned string. This is -different from the old g_basename() function, which returned a pointer -into the argument. - -@file_name: the name of the file. -@Returns: the name of the file without any leading directory components. +@file_name: +@Returns: diff --git a/glib/gutils.c b/glib/gutils.c index 06c4fd8..973bb98 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -390,7 +390,9 @@ g_parse_debug_string (const gchar *string, * * Return value: the name of the file without any leading directory components. * - * Deprecated: Use g_path_get_basename() instead. + * Deprecated: Use g_path_get_basename() instead, but notice that + * g_path_get_basename() allocates new memory for the returned string, unlike + * this function which returns a pointer into the argument. **/ G_CONST_RETURN gchar* g_basename (const gchar *file_name) @@ -411,6 +413,19 @@ g_basename (const gchar *file_name) return (gchar*) file_name; } +/** + * g_path_get_basename: + * @file_name: the name of the file. + * + * Gets the last component of the filename. If @file_name ends with a + * directory separator it gets the component before the last slash. If + * @file_name consists only of directory separators (and on Windows, + * possibly a drive letter), a single separator is returned. If + * @file_name is empty, it gets ".". + * + * Return value: a newly allocated string containing the last component of + * the filename. + */ gchar* g_path_get_basename (const gchar *file_name) { -- 2.7.4