mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
New function. Returns the machine's name, or one of its names. Document
2005-06-22 Tor Lillqvist <tml@novell.com> * glib/gutils.c (g_get_host_name): New function. Returns the machine's name, or one of its names. Document that it is best-effort only, and not guaranteed to be unique or anything. (g_get_any_init): Get the host name here. On Unix use gethostname(), on Windows use GetComputerName(). (#5200) * glib/gutils.h * glib/glib.symbols: Add here, too. * tests/testglib.c: Test it.
This commit is contained in:
committed by
Tor Lillqvist
parent
da4aefe4a1
commit
477989f555
@@ -438,6 +438,7 @@ main (int argc,
|
||||
g_free (string);
|
||||
g_print ("user: %s\n", g_get_user_name ());
|
||||
g_print ("real: %s\n", g_get_real_name ());
|
||||
g_print ("host: %s\n", g_get_host_name ());
|
||||
s = g_get_home_dir ();
|
||||
g_print ("home: %s\n", s ? s : "NULL!");
|
||||
s = g_get_user_data_dir ();
|
||||
|
Reference in New Issue
Block a user