aboutsummaryrefslogtreecommitdiffstats
path: root/HostnameMeter.c
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf.devel@gmail.com>2009-04-05 11:51:34 +0300
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:26 +0200
commit702a055ada42e05340e6dd61b86760ff2446c159 (patch)
treeb25687c188c3646378d43bc8b5c05757c1e596d3 /HostnameMeter.c
parent8f33fa7a49b4c60564309f356a37f2a1dfe20c34 (diff)
parent1767b21eb219fb9ac332aca9f7c3abecd97b6b39 (diff)
downloaddebian_htop-702a055ada42e05340e6dd61b86760ff2446c159.tar.gz
debian_htop-702a055ada42e05340e6dd61b86760ff2446c159.tar.bz2
debian_htop-702a055ada42e05340e6dd61b86760ff2446c159.zip
Imported Debian patch 0.8.1+svn149-1debian/0.8.1+svn149-1
Diffstat (limited to 'HostnameMeter.c')
-rw-r--r--HostnameMeter.c33
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: ",
+};

© 2014-2024 Faster IT GmbH | imprint | privacy policy