mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 08:58:54 +02:00
Mark the functions g_basename and g_dirname deprecated. They will issue an
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gutils.c, glib.h: Mark the functions g_basename and g_dirname deprecated. They will issue an warning once, when compiled with G_ENABLE_DEBUG, but continue to work as before. Instead the functions g_path_get_basename and g_path_get_dirname should be used, which BOTH return newly allocated memory, that has to freed by g_free. The new g_path_get_basename now strips trailing slashes from the path. This fixes #5097. For discussion see http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html * gwin32.c, testglib.c, tests/dirname-test.c: Use the new functions instead of the old ones. * gmodule/libgplugin_a.c, gmodule/testgmodule.c: Use g_path_get_basename instead of the deprecated g_basename.
This commit is contained in:
committed by
Sebastian Wilhelmi
parent
84114c5321
commit
fec9828ac6
11
glib/glib.h
11
glib/glib.h
@@ -1701,15 +1701,22 @@ gint g_vsnprintf (gchar *string,
|
||||
gulong n,
|
||||
gchar const *format,
|
||||
va_list args);
|
||||
gchar* g_basename (const gchar *file_name);
|
||||
/* Check if a file name is an absolute path */
|
||||
gboolean g_path_is_absolute (const gchar *file_name);
|
||||
/* In case of absolute paths, skip the root part */
|
||||
gchar* g_path_skip_root (gchar *file_name);
|
||||
|
||||
/* strings are newly allocated with g_malloc() */
|
||||
/* These two functions are deprecated and will be removed in the next
|
||||
* major release of GLib. Use g_path_get_dirname/g_path_get_basename
|
||||
* instead. Whatch out! The string returned by g_path_get_basename
|
||||
* must be g_freed, while the string returned by g_basename must not.*/
|
||||
gchar* g_basename (const gchar *file_name);
|
||||
gchar* g_dirname (const gchar *file_name);
|
||||
|
||||
/* The returned strings are newly allocated with g_malloc() */
|
||||
gchar* g_get_current_dir (void);
|
||||
gchar* g_path_get_basename (const gchar *file_name);
|
||||
gchar* g_path_get_dirname (const gchar *file_name);
|
||||
|
||||
/* Get the codeset for the current locale */
|
||||
/* gchar * g_get_codeset (void); */
|
||||
|
Reference in New Issue
Block a user