Remmina - The GTK+ Remote Desktop Client  v1.4.33
Remmina is a remote desktop client written in GTK+, aiming to be useful for system administrators and travellers, who need to work with lots of remote computers in front of either large monitors or tiny netbooks. Remmina supports multiple network protocols in an integrated and consistent user interface. Currently RDP, VNC, NX, XDMCP and SSH are supported.
remmina_utils.h File Reference

General utility functions, non-GTK related. More...

Go to the source code of this file.

Functions

G_BEGIN_DECLS gint remmina_utils_string_find (GString *haystack, gint start, gint end, const gchar *needle)
 
gint remmina_utils_string_replace (GString *str, gint pos, gint len, const gchar *replace)
 
guint remmina_utils_string_replace_all (GString *haystack, const gchar *needle, const gchar *replace)
 Replaces all occurrences of needle in haystack with replace. More...
 
gchar * remmina_utils_string_strip (const gchar *s)
 Strip
, and " from a given string. More...
 
gchar * remmina_utils_get_lang ()
 Return the current language defined in the LC_ALL. More...
 
const gchar * remmina_utils_get_kernel_name ()
 Return the OS name as in "uname -s". More...
 
const gchar * remmina_utils_get_kernel_release ()
 Return the OS version as in "uname -r". More...
 
const gchar * remmina_utils_get_kernel_arch ()
 Return the machine hardware name as in "uname -m". More...
 
gchar * remmina_utils_get_lsb_id ()
 Print the Distributor as specified by the lsb_release command. More...
 
gchar * remmina_utils_get_lsb_description ()
 Print the Distribution description as specified by the lsb_release command. More...
 
gchar * remmina_utils_get_lsb_release ()
 Print the Distribution release name as specified by the lsb_release command. More...
 
gchar * remmina_utils_get_lsb_codename ()
 Print the Distribution codename as specified by the lsb_release command. More...
 
GHashTable * remmina_utils_get_etc_release ()
 Print the distribution description if found. More...
 
const gchar * remmina_utils_get_os_info ()
 A sample function to show how use the other fOS related functions. More...
 
gchar * remmina_sha1_file (const gchar *filename)
 Create a hexadecimal string version of the SHA-1 digest of the contents of the named file. More...
 

Detailed Description

General utility functions, non-GTK related.

Definition in file remmina_utils.h.

Function Documentation

◆ remmina_sha1_file()

gchar* remmina_sha1_file ( const gchar *  filename)

Create a hexadecimal string version of the SHA-1 digest of the contents of the named file.

Returns
a newly allocated string which the caller should free() when finished.

If any error occurs while reading the file, (permission denied, file not found, etc.), this function returns NULL.

Taken from https://github.com/ttuegel/notmuch do PR in case of substantial modifications.

Definition at line 460 of file remmina_utils.c.

◆ remmina_utils_get_etc_release()

GHashTable* remmina_utils_get_etc_release ( )

Print the distribution description if found.

Test each known distribution specific information file and print it’s content.

Returns
a string or NULL. Caller must free it with g_free().

Definition at line 396 of file remmina_utils.c.

◆ remmina_utils_get_kernel_arch()

const gchar* remmina_utils_get_kernel_arch ( )

Return the machine hardware name as in "uname -m".

Returns
The machine hardware name or NULL.

Definition at line 326 of file remmina_utils.c.

◆ remmina_utils_get_kernel_name()

const gchar* remmina_utils_get_kernel_name ( )

Return the OS name as in "uname -s".

Returns
The OS name or NULL.

Definition at line 306 of file remmina_utils.c.

◆ remmina_utils_get_kernel_release()

const gchar* remmina_utils_get_kernel_release ( )

Return the OS version as in "uname -r".

Returns
The OS release or NULL.

Definition at line 312 of file remmina_utils.c.

◆ remmina_utils_get_lang()

gchar* remmina_utils_get_lang ( )

Return the current language defined in the LC_ALL.

Returns
a language string or en_US.

Definition at line 287 of file remmina_utils.c.

◆ remmina_utils_get_lsb_codename()

gchar* remmina_utils_get_lsb_codename ( )

Print the Distribution codename as specified by the lsb_release command.

Returns
the codename string or NULL. Caller must free it with g_free().

Definition at line 382 of file remmina_utils.c.

◆ remmina_utils_get_lsb_description()

gchar* remmina_utils_get_lsb_description ( )

Print the Distribution description as specified by the lsb_release command.

Returns
the Distribution description string or NULL. Caller must free it with g_free().

Definition at line 349 of file remmina_utils.c.

◆ remmina_utils_get_lsb_id()

gchar* remmina_utils_get_lsb_id ( )

Print the Distributor as specified by the lsb_release command.

Returns
the distributor ID string or NULL. Caller must free it with g_free().

Definition at line 336 of file remmina_utils.c.

◆ remmina_utils_get_lsb_release()

gchar* remmina_utils_get_lsb_release ( )

Print the Distribution release name as specified by the lsb_release command.

Returns
the Distribution release name string or NULL. Caller must free it with g_free().

Definition at line 369 of file remmina_utils.c.

◆ remmina_utils_get_os_info()

const gchar* remmina_utils_get_os_info ( )

A sample function to show how use the other fOS related functions.

Returns
a semicolon separated OS data like in "uname -srm".

Definition at line 424 of file remmina_utils.c.

◆ remmina_utils_string_find()

G_BEGIN_DECLS gint remmina_utils_string_find ( GString *  haystack,
gint  start,
gint  end,
const gchar *  needle 
)

Definition at line 141 of file remmina_utils.c.

◆ remmina_utils_string_replace()

gint remmina_utils_string_replace ( GString *  str,
gint  pos,
gint  len,
const gchar *  replace 
)

Definition at line 173 of file remmina_utils.c.

◆ remmina_utils_string_replace_all()

guint remmina_utils_string_replace_all ( GString *  haystack,
const gchar *  needle,
const gchar *  replace 
)

Replaces all occurrences of needle in haystack with replace.

Parameters
haystackThe input string to operate on. This string is modified in place.
needleThe string which should be replaced.
replaceThe replacement for needle.
Returns
Number of replacements made.

Definition at line 193 of file remmina_utils.c.

◆ remmina_utils_string_strip()

gchar* remmina_utils_string_strip ( const gchar *  s)

Strip
, and " from a given string.

This function is particularly useful with g_spawn_command_line_sync that does not strip control characters from the output.

Warning
the result should be freed.
Parameters
astring.
Returns
a newly allocated copy of string cleaned by ,
and "

Definition at line 220 of file remmina_utils.c.