+// Doxygen doesn't like mp::util, so we use this instead
+namespace mp_util = metaproxy_1::util;
+
+int mp_util::memcmp2(const void *buf1, int len1,
+ const void *buf2, int len2)
+{
+ int d = len1 - len2;
+
+ // compare buffer (common length)
+ int c = memcmp(buf1, buf2, d > 0 ? len2 : len1);
+ if (c > 0)
+ return 1;
+ else if (c < 0)
+ return -1;
+
+ // compare (remaining bytes)
+ if (d > 0)
+ return 1;
+ else if (d < 0)
+ return -1;
+ return 0;
+}
+
+
+std::string mp_util::database_name_normalize(const std::string &s)