Remmina - The GTK+ Remote Desktop Client  v1.3.1
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.c File Reference

Go to the source code of this file.

Data Structures

struct  lsb_distro_info
 
struct  distro_info
 

Typedefs

typedef struct lsb_distro_info LSBDistroInfo
 
typedef struct distro_info DistroInfo
 

Functions

gint remmina_utils_strpos (const gchar *haystack, const gchar *needle)
 
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...
 
static gchar * remmina_utils_read_distrofile (gchar *filename)
 OS related functions. 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 releated 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...
 

Variables

struct utsname u
 
static DistroInfo distroArray []
 

Typedef Documentation

◆ DistroInfo

typedef struct distro_info DistroInfo

◆ LSBDistroInfo

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 443 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 383 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 309 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 287 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 294 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 368 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 334 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 320 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 354 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 releated functions.

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

Definition at line 410 of file remmina_utils.c.

◆ remmina_utils_read_distrofile()

static gchar* remmina_utils_read_distrofile ( gchar *  filename)
static

OS related functions.

remmina_utils_read_distrofile.

Look for a distro version file /etc/xxx-release. Once found, read the file in and figure out which distribution.

Parameters
filenameThe file path of a Linux distribution release file.
distroSizeThe size of the distribition name.
distroThe full distro name.
Returns
Returns a string containing distro information verbatium from /etc/xxx-release (distro). Use g_free to free the string.

Definition at line 251 of file remmina_utils.c.

◆ remmina_utils_string_find()

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

Definition at line 140 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 172 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 192 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 particulary 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 219 of file remmina_utils.c.

◆ remmina_utils_strpos()

gint remmina_utils_strpos ( const gchar *  haystack,
const gchar *  needle 
)

Definition at line 122 of file remmina_utils.c.

Variable Documentation

◆ distroArray

DistroInfo distroArray[]
static

Definition at line 78 of file remmina_utils.c.

◆ u

struct utsname u

Definition at line 53 of file remmina_utils.c.