310 lines
7.6 KiB
HTML
310 lines
7.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Glib::Utils</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Glib::Utils</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-18<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Glib::Utils - Miscellaneous utility functions
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Glib;
|
|
Glib::set_application_name (Glib::get_real_name."'s Cool Program");
|
|
|
|
print "app name is ".Glib::get_application_name()."\n";
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
Here are some useful miscellaneous utilities.
|
|
GLib is a portability library, providing portable utility functions for
|
|
C programs. As such, most of these functions seem to violate the Glib
|
|
binding principle of not duplicating functionality that Perl already
|
|
provides, but there's a distinction for each one, i swear. The functions
|
|
for dealing with user information are provided on all GLib-supported
|
|
platforms, not just where <FONT SIZE="-1">POSIX</FONT> (which provides similar information) is
|
|
available, and even work on platforms where <TT>%ENV</TT> may not include the
|
|
expected information. Also, the ``application name'' referred to by
|
|
(set|get)_application_name is a human readable name, distinct from the
|
|
actual program name provided by Perl's own <TT>$0</TT>.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>string = Glib::get_application_name</H3>
|
|
|
|
|
|
|
|
Get the human-readable application name set by <TT>"set_application_name"</TT>.
|
|
<P>
|
|
|
|
Since: glib 2.2
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Glib::set_application_name ($application_name)</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">•<DD>
|
|
<TT>$application_name</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Set the human-readable application name.
|
|
<P>
|
|
|
|
Since: glib 2.2
|
|
<A NAME="lbAH"> </A>
|
|
<H3>string = Glib::get_home_dir</H3>
|
|
|
|
|
|
|
|
Find the current user's home directory, by system-dependent/appropriate
|
|
means.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>list = Glib::get_language_names</H3>
|
|
|
|
|
|
|
|
Computes a list of applicable locale names, which can be used to e.g. construct
|
|
locale-dependent filenames or search paths. The returned list is sorted from
|
|
most desirable to least desirable and always contains the default locale ``C''.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>string = Glib::get_prgname</H3>
|
|
|
|
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Glib::set_prgname ($prgname)</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2">•<DD>
|
|
<TT>$prgname</TT> (string)
|
|
</DL>
|
|
<A NAME="lbAL"> </A>
|
|
<H3>string = Glib::get_real_name</H3>
|
|
|
|
|
|
|
|
Get the current user's real name.
|
|
<A NAME="lbAM"> </A>
|
|
<H3>string = Glib::strerror ($err)</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3">•<DD>
|
|
<TT>$err</TT> (integer)
|
|
</DL>
|
|
<P>
|
|
|
|
Return a string describing the given errno value, like ``No such file
|
|
or directory'' for <FONT SIZE="-1">ENOENT.</FONT> This is translated into the user's
|
|
preferred language and is a utf8 wide-char string (unlike a $!
|
|
string (perlvar) or POSIX::strerror (<FONT SIZE="-1">POSIX</FONT>) which are locale
|
|
codeset bytes).
|
|
<A NAME="lbAN"> </A>
|
|
<H3>string = Glib::strsignal ($signum)</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="4">•<DD>
|
|
<TT>$signum</TT> (integer)
|
|
</DL>
|
|
<P>
|
|
|
|
Return a string describing the given signal number, like ``Segmentation
|
|
violation'' for <FONT SIZE="-1">SIGSEGV.</FONT> This is translated into the user's preferred
|
|
language and is a utf8 wide-char string.
|
|
<A NAME="lbAO"> </A>
|
|
<H3>list = Glib::get_system_config_dirs</H3>
|
|
|
|
|
|
|
|
Returns an ordered list of base directories in which to access system-wide
|
|
configuration information.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAP"> </A>
|
|
<H3>list = Glib::get_system_data_dirs</H3>
|
|
|
|
|
|
|
|
Returns an ordered list of base directories in which to access system-wide
|
|
application data.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAQ"> </A>
|
|
<H3>string = Glib::get_tmp_dir</H3>
|
|
|
|
|
|
|
|
Get the temp dir as appropriate for the current system. See the GLib docs
|
|
for info on how it works.
|
|
<A NAME="lbAR"> </A>
|
|
<H3>string = Glib::get_user_cache_dir</H3>
|
|
|
|
|
|
|
|
Gets the base directory in which to store non-essential, cached data specific
|
|
to particular user.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAS"> </A>
|
|
<H3>string = Glib::get_user_config_dir</H3>
|
|
|
|
|
|
|
|
Gets the base directory in which to store user-specific application
|
|
configuration information such as user preferences and settings.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAT"> </A>
|
|
<H3>string = Glib::get_user_data_dir</H3>
|
|
|
|
|
|
|
|
Get the base directory for application data such as icons that is customized
|
|
for a particular user.
|
|
<P>
|
|
|
|
Since: glib 2.6
|
|
<A NAME="lbAU"> </A>
|
|
<H3>string = Glib::get_user_name</H3>
|
|
|
|
|
|
|
|
Get the current user's name by whatever system-dependent means necessary.
|
|
<A NAME="lbAV"> </A>
|
|
<H3>string = Glib::get_user_special_dir ($directory)</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="5">•<DD>
|
|
<TT>$directory</TT> (Glib::UserDirectory)
|
|
</DL>
|
|
<P>
|
|
|
|
Returns the full path of a special directory using its logical id.
|
|
<P>
|
|
|
|
Since: glib 2.14
|
|
<A NAME="lbAW"> </A>
|
|
<H2>ENUMS AND FLAGS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAX"> </A>
|
|
<H3>enum Glib::UserDirectory</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="6">•<DD>
|
|
'desktop' / 'G_USER_DIRECTORY_DESKTOP'
|
|
<DT id="7">•<DD>
|
|
'documents' / 'G_USER_DIRECTORY_DOCUMENTS'
|
|
<DT id="8">•<DD>
|
|
'download' / 'G_USER_DIRECTORY_DOWNLOAD'
|
|
<DT id="9">•<DD>
|
|
'music' / 'G_USER_DIRECTORY_MUSIC'
|
|
<DT id="10">•<DD>
|
|
'pictures' / 'G_USER_DIRECTORY_PICTURES'
|
|
<DT id="11">•<DD>
|
|
'public-share' / 'G_USER_DIRECTORY_PUBLIC_SHARE'
|
|
<DT id="12">•<DD>
|
|
'templates' / 'G_USER_DIRECTORY_TEMPLATES'
|
|
<DT id="13">•<DD>
|
|
'videos' / 'G_USER_DIRECTORY_VIDEOS'
|
|
</DL>
|
|
<A NAME="lbAY"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Glib
|
|
<A NAME="lbAZ"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (C) 2003-2011 by the gtk2-perl team.
|
|
<P>
|
|
|
|
This software is licensed under the <FONT SIZE="-1">LGPL.</FONT> See Glib for a full notice.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="14"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="15"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="16"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="17"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DL>
|
|
<DT id="18"><A HREF="#lbAF">string = Glib::get_application_name</A><DD>
|
|
<DT id="19"><A HREF="#lbAG">Glib::set_application_name ($application_name)</A><DD>
|
|
<DT id="20"><A HREF="#lbAH">string = Glib::get_home_dir</A><DD>
|
|
<DT id="21"><A HREF="#lbAI">list = Glib::get_language_names</A><DD>
|
|
<DT id="22"><A HREF="#lbAJ">string = Glib::get_prgname</A><DD>
|
|
<DT id="23"><A HREF="#lbAK">Glib::set_prgname ($prgname)</A><DD>
|
|
<DT id="24"><A HREF="#lbAL">string = Glib::get_real_name</A><DD>
|
|
<DT id="25"><A HREF="#lbAM">string = Glib::strerror ($err)</A><DD>
|
|
<DT id="26"><A HREF="#lbAN">string = Glib::strsignal ($signum)</A><DD>
|
|
<DT id="27"><A HREF="#lbAO">list = Glib::get_system_config_dirs</A><DD>
|
|
<DT id="28"><A HREF="#lbAP">list = Glib::get_system_data_dirs</A><DD>
|
|
<DT id="29"><A HREF="#lbAQ">string = Glib::get_tmp_dir</A><DD>
|
|
<DT id="30"><A HREF="#lbAR">string = Glib::get_user_cache_dir</A><DD>
|
|
<DT id="31"><A HREF="#lbAS">string = Glib::get_user_config_dir</A><DD>
|
|
<DT id="32"><A HREF="#lbAT">string = Glib::get_user_data_dir</A><DD>
|
|
<DT id="33"><A HREF="#lbAU">string = Glib::get_user_name</A><DD>
|
|
<DT id="34"><A HREF="#lbAV">string = Glib::get_user_special_dir ($directory)</A><DD>
|
|
</DL>
|
|
<DT id="35"><A HREF="#lbAW">ENUMS AND FLAGS</A><DD>
|
|
<DL>
|
|
<DT id="36"><A HREF="#lbAX">enum Glib::UserDirectory</A><DD>
|
|
</DL>
|
|
<DT id="37"><A HREF="#lbAY">SEE ALSO</A><DD>
|
|
<DT id="38"><A HREF="#lbAZ">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:45 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|