[dia/zbrown/graphene-rect: 7/11] message: move dia_message_filename and stop declaring it twice




commit 811a16e5274933e1e0541c0198b99d80c7807672
Author: Zander Brown <zbrown gnome org>
Date:   Tue Apr 6 19:26:07 2021 +0100

    message: move dia_message_filename and stop declaring it twice

 lib/dia_dirs.c | 32 --------------------------------
 lib/dia_dirs.h |  2 +-
 lib/message.c  | 33 +++++++++++++++++++++++++++++++++
 lib/message.h  |  1 -
 4 files changed, 34 insertions(+), 34 deletions(-)
---
diff --git a/lib/dia_dirs.c b/lib/dia_dirs.c
index 335bf285b..6aa3690ca 100644
--- a/lib/dia_dirs.c
+++ b/lib/dia_dirs.c
@@ -177,38 +177,6 @@ dia_config_ensure_dir (const char *filename)
 }
 
 
-/**
- * dia_message_filename:
- * @filename: A filename string as gotten from the filesystem.
- *
- * Returns an filename in UTF-8 encoding from filename in filesystem encoding.
- *
- * The value returned is a pointer to static array.
- *
- * Note: The string can be used AFTER the next call to this function
- *       Written like g_strerror()
- *
- * Returns: UTF-8 encoded copy of the filename.
- *
- * Since: dawn-of-time
- */
-const char *
-dia_message_filename(const gchar *filename)
-{
-  char *tmp;
-  GQuark msg_quark;
-
-  tmp = g_filename_display_name (filename);
-
-  /* Stick in the quark table so that we can return a static result */
-  msg_quark = g_quark_from_string (tmp);
-
-  g_clear_pointer (&tmp, g_free);
-
-  return g_quark_to_string (msg_quark);
-}
-
-
 /**
  * dia_relativize_filename:
  * @master: The main filename
diff --git a/lib/dia_dirs.h b/lib/dia_dirs.h
index 20a9489af..140d2880c 100644
--- a/lib/dia_dirs.h
+++ b/lib/dia_dirs.h
@@ -17,6 +17,7 @@
  */
 
 #pragma once
+
 #include <glib.h>
 
 G_BEGIN_DECLS
@@ -30,6 +31,5 @@ char        *dia_relativize_filename   (const char *master,
                                         const char *slave);
 char        *dia_absolutize_filename   (const char *master,
                                         const char *slave);
-const gchar *dia_message_filename      (const char *filename);
 
 G_END_DECLS
diff --git a/lib/message.c b/lib/message.c
index 6667b8edb..6f5e4760b 100644
--- a/lib/message.c
+++ b/lib/message.c
@@ -371,3 +371,36 @@ dia_log_message (const char *format, ...)
 
   g_clear_pointer (&log, g_free);
 }
+
+
+/**
+ * dia_message_filename:
+ * @filename: A filename string as gotten from the filesystem.
+ *
+ * Returns an filename in UTF-8 encoding from filename in filesystem encoding.
+ *
+ * The value returned is a pointer to static array.
+ *
+ * Note: The string can be used AFTER the next call to this function
+ *       Written like g_strerror()
+ *
+ * Returns: UTF-8 encoded copy of the filename.
+ *
+ * Since: dawn-of-time
+ */
+const char *
+dia_message_filename (const char *filename)
+{
+  char *tmp;
+  GQuark msg_quark;
+
+  tmp = g_filename_display_name (filename);
+
+  /* Stick in the quark table so that we can return a static result */
+  msg_quark = g_quark_from_string (tmp);
+
+  g_clear_pointer (&tmp, g_free);
+
+  return g_quark_to_string (msg_quark);
+}
+
diff --git a/lib/message.h b/lib/message.h
index 393cf5830..bdef43298 100644
--- a/lib/message.h
+++ b/lib/message.h
@@ -47,7 +47,6 @@ void        message_error          (const char      *format,
 void        dia_log_message        (const char      *format,
                                     ...) G_GNUC_PRINTF (1, 2);
 void        dia_log_message_enable (gboolean         yes);
-/* also declared in dia_dirs.h, where I think it does not belong! --hb */
 const char *dia_message_filename   (const char      *filename);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]