diff options
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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+/"; |