summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2015-09-08 11:08:06 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2015-09-08 11:08:06 +0200
commit4e3325b7f7e30d1013798d74b8e7e0b8471813b1 (patch)
treec5082d2ea7afddbec5cfeda720daee873d9f11aa /tools.c
parent3284e941c6ab7f59c4fbfa78d4976d756aec0731 (diff)
downloadvdr-4e3325b7f7e30d1013798d74b8e7e0b8471813b1.tar.gz
vdr-4e3325b7f7e30d1013798d74b8e7e0b8471813b1.tar.bz2
Implemented setup options for SVDRP peering
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 005e4027..2d5ff5e2 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 4.2 2015/08/29 12:11:20 kls Exp $
+ * $Id: tools.c 4.3 2015/09/06 10:47:05 kls Exp $
*/
#include "tools.h"
@@ -1322,6 +1322,20 @@ uchar *RgbToJpeg(uchar *Mem, int Width, int Height, int &Size, int Quality)
return jcd.mem;
}
+// --- GetHostName -----------------------------------------------------------
+
+const char *GetHostName(void)
+{
+ static char buffer[HOST_NAME_MAX] = "";
+ if (!*buffer) {
+ if (gethostname(buffer, sizeof(buffer)) < 0) {
+ LOG_ERROR;
+ strcpy(buffer, "vdr");
+ }
+ }
+ return buffer;
+}
+
// --- cBase64Encoder --------------------------------------------------------
const char *cBase64Encoder::b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";