g_strerror



I want to put $! into some gtk displayed strings, and if I'm not
mistaken it's locale charset bytes.  I know how to decode, but I
wondered if g_strerror could be offered, on the principle "why can't
someone else do it".

--- GUtils.xs   16 Sep 2007 00:10:12 +1000      1.10
+++ GUtils.xs   14 May 2008 10:36:07 +1000      
@@ -255,6 +255,24 @@
 ## Look for an executable in PATH, following execvp() rules
 #gchar*  g_find_program_in_path  (const gchar *program);
 
+=for apidoc __function__
+Return a string describing the given errno value, like "No such file
+or directory" for ENOENT.  This is translated into the user's
+preferred language and is a utf8 wide-char string (unlike a $!
+string (L<perlvar>) or POSIX::strerror (L<POSIX>) which are locale
+codeset bytes).
+=cut
+## note the returned string can be overwritten by the next call, so must copy
+const gchar *g_strerror (gint err);
+
+=for apidoc __function__
+Return a string describing the given signal number, like "Segmentation
+violation" for SIGSEGV.  This is translated into the user's preferred
+language and is a utf8 wide-char string.
+=cut
+## note the returned string can be overwritten by the next call, so must copy
+const gchar *g_strsignal (gint signum);
+
 ###
 ### Version information
 ###


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