diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:25 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:25 +0200 |
commit | 1767b21eb219fb9ac332aca9f7c3abecd97b6b39 (patch) | |
tree | 95ac07953f40ebbd6a674024ad4fc6b9f952e1f9 /HostnameMeter.c | |
parent | c74c38760df69bb87e93dff18cf91464e5d02f37 (diff) | |
download | debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.tar.gz debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.tar.bz2 debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.zip |
Imported Upstream version 0.8.1+svn149upstream/0.8.1+svn149
Diffstat (limited to 'HostnameMeter.c')
-rw-r--r-- | HostnameMeter.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/HostnameMeter.c b/HostnameMeter.c new file mode 100644 index 0000000..db3528c --- /dev/null +++ b/HostnameMeter.c @@ -0,0 +1,33 @@ +/* +htop +(C) 2004-2006 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ + +#include "HostnameMeter.h" +#include "Meter.h" + +#include <unistd.h> + +#include "debug.h" + +int HostnameMeter_attributes[] = { + HOSTNAME +}; + +static void HostnameMeter_setValues(Meter* this, char* buffer, int size) { + gethostname(buffer, size-1); +} + +MeterType HostnameMeter = { + .setValues = HostnameMeter_setValues, + .display = NULL, + .mode = TEXT_METERMODE, + .total = 100.0, + .items = 1, + .attributes = HostnameMeter_attributes, + .name = "Hostname", + .uiName = "Hostname", + .caption = "Hostname: ", +}; |