summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools.h b/tools.h
index 73cca5a3..d2234c39 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 4.5 2016/12/23 13:56:35 kls Exp $
+ * $Id: tools.h 4.6 2017/03/16 16:04:43 kls Exp $
*/
#ifndef __TOOLS_H
@@ -242,6 +242,17 @@ cString dtoa(double d, const char *Format = "%f");
///< the decimal point, independent of the currently selected locale.
///< If Format is given, it will be used instead of the default.
cString itoa(int n);
+inline uint16_t Peek13(const uchar *p)
+{
+ uint16_t v = uint16_t(*p++ & 0x1F) << 8;
+ return v + (*p & 0xFF);
+}
+inline void Poke13(uchar *p, uint16_t v)
+{
+ v |= uint16_t(*p & ~0x1F) << 8;
+ *p++ = v >> 8;
+ *p = v & 0xFF;
+}
cString AddDirectory(const char *DirName, const char *FileName);
bool EntriesOnSameFileSystem(const char *File1, const char *File2);
///< Checks whether the given files are on the same file system. If either of the
@@ -744,6 +755,11 @@ public:
}
};
+inline int CompareInts(const void *a, const void *b)
+{
+ return *(const int *)a > *(const int *)b;
+}
+
inline int CompareStrings(const void *a, const void *b)
{
return strcmp(*(const char **)a, *(const char **)b);