.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Glib::Utils 3pm" .TH Glib::Utils 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Glib::Utils \- Miscellaneous utility functions .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Glib; \& Glib::set_application_name (Glib::get_real_name."\*(Aqs Cool Program"); \& \& print "app name is ".Glib::get_application_name()."\en"; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" 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 POSIX (which provides similar information) is available, and even work on platforms where \f(CW%ENV\fR 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 \f(CW$0\fR. .SH METHODS .IX Header "METHODS" .SS "string = Glib::get_application_name" .IX Subsection "string = Glib::get_application_name" Get the human-readable application name set by \f(CW\*(C`set_application_name\*(C'\fR. .PP Since: glib 2.2 .SS "Glib::set_application_name ($application_name)" .IX Subsection "Glib::set_application_name ($application_name)" .IP \(bu 4 \&\f(CW$application_name\fR (string) .PP Set the human-readable application name. .PP Since: glib 2.2 .SS "string = Glib::get_home_dir" .IX Subsection "string = Glib::get_home_dir" Find the current user's home directory, by system\-dependent/appropriate means. .SS "list = Glib::get_language_names" .IX Subsection "list = Glib::get_language_names" 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". .PP Since: glib 2.6 .SS "string = Glib::get_prgname" .IX Subsection "string = Glib::get_prgname" .SS "Glib::set_prgname ($prgname)" .IX Subsection "Glib::set_prgname ($prgname)" .IP \(bu 4 \&\f(CW$prgname\fR (string) .SS "string = Glib::get_real_name" .IX Subsection "string = Glib::get_real_name" Get the current user's real name. .SS "string = Glib::strerror ($err)" .IX Subsection "string = Glib::strerror ($err)" .IP \(bu 4 \&\f(CW$err\fR (integer) .PP 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 (perlvar) or POSIX::strerror (POSIX) which are locale codeset bytes). .SS "string = Glib::strsignal ($signum)" .IX Subsection "string = Glib::strsignal ($signum)" .IP \(bu 4 \&\f(CW$signum\fR (integer) .PP 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. .SS "list = Glib::get_system_config_dirs" .IX Subsection "list = Glib::get_system_config_dirs" Returns an ordered list of base directories in which to access system-wide configuration information. .PP Since: glib 2.6 .SS "list = Glib::get_system_data_dirs" .IX Subsection "list = Glib::get_system_data_dirs" Returns an ordered list of base directories in which to access system-wide application data. .PP Since: glib 2.6 .SS "string = Glib::get_tmp_dir" .IX Subsection "string = Glib::get_tmp_dir" Get the temp dir as appropriate for the current system. See the GLib docs for info on how it works. .SS "string = Glib::get_user_cache_dir" .IX Subsection "string = Glib::get_user_cache_dir" Gets the base directory in which to store non-essential, cached data specific to particular user. .PP Since: glib 2.6 .SS "string = Glib::get_user_config_dir" .IX Subsection "string = Glib::get_user_config_dir" Gets the base directory in which to store user-specific application configuration information such as user preferences and settings. .PP Since: glib 2.6 .SS "string = Glib::get_user_data_dir" .IX Subsection "string = Glib::get_user_data_dir" Get the base directory for application data such as icons that is customized for a particular user. .PP Since: glib 2.6 .SS "string = Glib::get_user_name" .IX Subsection "string = Glib::get_user_name" Get the current user's name by whatever system-dependent means necessary. .SS "string = Glib::get_user_special_dir ($directory)" .IX Subsection "string = Glib::get_user_special_dir ($directory)" .IP \(bu 4 \&\f(CW$directory\fR (Glib::UserDirectory) .PP Returns the full path of a special directory using its logical id. .PP Since: glib 2.14 .SH "ENUMS AND FLAGS" .IX Header "ENUMS AND FLAGS" .SS "enum Glib::UserDirectory" .IX Subsection "enum Glib::UserDirectory" .IP \(bu 4 \&'desktop' / 'G_USER_DIRECTORY_DESKTOP' .IP \(bu 4 \&'documents' / 'G_USER_DIRECTORY_DOCUMENTS' .IP \(bu 4 \&'download' / 'G_USER_DIRECTORY_DOWNLOAD' .IP \(bu 4 \&'music' / 'G_USER_DIRECTORY_MUSIC' .IP \(bu 4 \&'pictures' / 'G_USER_DIRECTORY_PICTURES' .IP \(bu 4 \&'public\-share' / 'G_USER_DIRECTORY_PUBLIC_SHARE' .IP \(bu 4 \&'templates' / 'G_USER_DIRECTORY_TEMPLATES' .IP \(bu 4 \&'videos' / 'G_USER_DIRECTORY_VIDEOS' .SH "SEE ALSO" .IX Header "SEE ALSO" Glib .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2003\-2011 by the gtk2\-perl team. .PP This software is licensed under the LGPL. See Glib for a full notice.