[perl-glib] Add Glib::get_prgname and Glib::set_prgname



commit 6d97391c701e5abf0328ac2587e2c8a6821de39a
Author: Jeffrey Ratcliffe <jffry posteo net>
Date:   Wed Jan 29 00:00:00 2020 +0000

    Add Glib::get_prgname and Glib::set_prgname

 GUtils.xs | 18 +++++++-----------
 t/1.t     |  6 +++++-
 2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/GUtils.xs b/GUtils.xs
index 4403a01..9a12bd1 100644
--- a/GUtils.xs
+++ b/GUtils.xs
@@ -195,17 +195,13 @@ const gchar* g_get_user_special_dir (GUserDirectory directory);
 
 #endif
 
-##=for apidoc __function__
-##Set GLib's global program name.  Glib will set this to the value of $0 for
-##you when it loads; this function is provided to give you a way to set the
-##internal variable used by the GLib C library, since it knows nothing about
-##$0.
-##=cut
-##gchar_own * g_get_prgname ();
-##
-##=for apidoc __function__
-##=cut
-##void g_set_prgname (const gchar *prgname);
+=for apidoc __function__
+=cut
+gchar_own * g_get_prgname ();
+
+=for apidoc __function__
+=cut
+void g_set_prgname (const gchar *prgname);
 
 #if GLIB_CHECK_VERSION(2, 2, 0)
 
diff --git a/t/1.t b/t/1.t
index 17d8822..302cd00 100644
--- a/t/1.t
+++ b/t/1.t
@@ -13,7 +13,7 @@ use warnings;
 
 #########################
 
-use Test::More tests => 26;
+use Test::More tests => 28;
 BEGIN { use_ok('Glib') };
 
 #########################
@@ -52,6 +52,10 @@ SKIP: {
   is (Glib::get_application_name (), $appname);
 }
 
+is (Glib::get_prgname (), undef, 'before any calls to anything');
+Glib::set_prgname ('my_prgname');
+is (Glib::get_prgname (), 'my_prgname');
+
 SKIP: {
   skip "new 2.6 stuff", 6
     unless Glib->CHECK_VERSION (2,6,0);


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