*/
#include <cmath>
+#include <algorithm>
+#include <string>
+
#include <stdint.h>
#include <stdlib.h>
#include <cstdio>
return ret;
}
+string
+downcase (const string& str)
+{
+ string copy (str);
+ std::transform (copy.begin(), copy.end(), copy.begin(), ::tolower);
+ return copy;
+}
+
+const char*
+downcase (const char* str)
+{
+ char *copy = strdup (str);
+ for (char* p = copy; *p; ++p) {
+ *p = tolower (*p);
+ }
+ return copy;
+}
+
string
short_version (string orig, string::size_type target_length)
{