+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+
+struct FlagDesc {
+ const char *name;
+ u32 flag;
+};
+
+std::wstring narrow_to_wide(const std::string& mbs);
+std::string wide_to_narrow(const std::wstring& wcs);
+std::string translatePassword(std::string playername, std::wstring password);
+std::string urlencode(std::string str);
+std::string urldecode(std::string str);
+u32 readFlagString(std::string str, const FlagDesc *flagdesc, u32 *flagmask);
+std::string writeFlagString(u32 flags, const FlagDesc *flagdesc, u32 flagmask);
+size_t mystrlcpy(char *dst, const char *src, size_t size);
+char *mystrtok_r(char *s, const char *sep, char **lasts);
+u64 read_seed(const char *str);
+bool parseColorString(const std::string &value, video::SColor &color, bool quiet);
+
+
+/**
+ * Returns a copy of \p str with spaces inserted at the right hand side to ensure
+ * that the string is \p len characters in length. If \p str is <= \p len then the
+ * returned string will be identical to str.
+ */
+inline std::string padStringRight(std::string str, size_t len)