Fawkes API  Fawkes Development Version
qa_hostinfo.cpp
1 
2 /***************************************************************************
3  * qa_hostinfo.h - QA for HostInfo
4  *
5  * Generated: Fri Jan 16 16:31:20 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 // Do not include in api reference
25 ///@cond QA
26 
27 #include <utils/system/hostinfo.h>
28 #include <cstdio>
29 
30 using namespace fawkes;
31 
32 int
33 main(int argc, char **argv)
34 {
35  HostInfo h;
36 
37  printf("Hostname: %s\n"
38  "Short hostname: %s\n"
39  "Domain name: %s\n"
40  "Architecture: %s\n"
41  "Sys Name: %s\n"
42  "Sys Release: %s\n"
43  "Sys Version: %s\n",
44  h.name(), h.short_name(), h.domain(), h.arch(),
45  h.sys_name(), h.sys_release(), h.sys_version());
46 
47  return 0;
48 }
49 
50 /// @endcond
const char * short_name()
Get short hostname (up to first dot).
Definition: hostinfo.cpp:114
const char * arch()
Get architecture (like i686 or x86_64).
Definition: hostinfo.cpp:134
Fawkes library namespace.
const char * domain()
Get domain name (after first dot or none if no dot in name).
Definition: hostinfo.cpp:124
Host information.
Definition: hostinfo.h:31
const char * sys_version()
Get system version (build date on Linux).
Definition: hostinfo.cpp:164
const char * name()
Get full hostname.
Definition: hostinfo.cpp:104
const char * sys_name()
Get system name (like Linux).
Definition: hostinfo.cpp:144
const char * sys_release()
Get system release (kernel version on Linux).
Definition: hostinfo.cpp:154