#include "xdgmime/xdgmime.h"
#include "libcitadel.h"
+#include "libcitadellocal.h"
void extract_key(char *target, char *source, char *key)
{
}
+unsigned int decode_hex(char *Source)
+{
+ int ret = 0;
+ if (*Source < 'A') {
+ ret += (*Source - '0');
+ }
+ else if (*Source > 'Z') {
+ ret += (*Source - 'a' + 10);
+ }
+ else {
+ ret += (*Source - 'A' + 10);
+ }
+
+ ret = ret << 4;
+
+ if (*(Source + 1) < 'A') {
+ ret += (*(Source + 1) - '0');
+ }
+ else if (*(Source + 1) > 'Z') {
+ ret += (*(Source + 1) - 'a' + 10);
+ }
+ else {
+ ret += (*(Source + 1) - 'A' + 10);
+ }
+ if (ret > 255)
+ return '?';
+ return ret;
+}
/*
* Convert "quoted-printable" to binary. Returns number of bytes decoded.
else if (encoded[pos] == '=')
{
ch = 0;
- sscanf(&encoded[pos+1], "%02x", &ch);
+ ch = decode_hex(&encoded[pos+1]);
pos += 3;
decoded[decoded_length++] = ch;
}
return "image/png";
else if ((len > 3) && !strncasecmp(&what[len - 4], ".ico", 4))
return "image/x-icon";
+ else if ((len > 3) && !strncasecmp(&what[len - 4], ".vcf", 4))
+ return "text/x-vcard";
else if ((len > 4) && !strncasecmp(&what[len - 5], ".html", 5))
return "text/html";
else if ((len > 3) && !strncasecmp(&what[len - 4], ".htm", 4))
return Icon->FileName;
}
-void ShutDownLibCitadel(void)
+void ShutDownLibCitadelMime(void)
{
DeleteHash(&IconHash);
}