Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill now unused xbt_dirname().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Oct 2017 13:26:49 +0000 (15:26 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Oct 2017 13:27:09 +0000 (15:27 +0200)
ChangeLog
include/xbt/file.h
src/xbt/xbt_os_file.cpp

index 89a432d..2ca220f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,7 +11,7 @@ SimGrid (3.18) NOT RELEASED YET (target: December 24 2017)
  XBT
  - Define class simgrid::xbt::Path to manage file names.
  - Removed unused functions:
  XBT
  - Define class simgrid::xbt::Path to manage file names.
  - Removed unused functions:
-   - xbt/file.h: xbt_getline()
+   - xbt/file.h: xbt_dirname(), xbt_getline()
 
 SimGrid (3.17) Released October 8 2017
 
 
 SimGrid (3.17) Released October 8 2017
 
index b22a004..3d588ba 100644 (file)
@@ -14,12 +14,10 @@ SG_BEGIN_DECL()
 /** @defgroup XBT_file File manipulation functions
  *  @ingroup XBT_misc
  *
 /** @defgroup XBT_file File manipulation functions
  *  @ingroup XBT_misc
  *
- * This module redefine some quite classical functions such as xbt_dirname() or xbt_basename() for the platforms
- * lacking them.
+ * This module redefine some quite classical functions such as xbt_basename() for the platforms lacking them.
  * @{
  */
  * @{
  */
-/* Our own implementation of dirname, that does not exist on windows */
-XBT_PUBLIC(char *) xbt_dirname(const char *path);
+/* Our own implementation of basename, that does not exist on windows */
 XBT_PUBLIC(char *) xbt_basename(const char *path);
 
 /**@}*/
 XBT_PUBLIC(char *) xbt_basename(const char *path);
 
 /**@}*/
index d3e87df..1e1e9f8 100644 (file)
 #include <cstring>
 #include <libgen.h> /* POSIX dirname */
 
 #include <cstring>
 #include <libgen.h> /* POSIX dirname */
 
-/** @brief Returns the directory component of a path (reimplementation of POSIX dirname)
- *
- * The argument is never modified, and the returned value must be freed after use.
- */
-char *xbt_dirname(const char *path)
-{
-  return xbt_strdup(simgrid::xbt::Path(path).getDirname().c_str());
-}
-
 /** @brief Returns the file component of a path (reimplementation of POSIX basename)
  *
  * The argument is never modified, and the returned value must be freed after use.
 /** @brief Returns the file component of a path (reimplementation of POSIX basename)
  *
  * The argument is never modified, and the returned value must be freed after use.