Regenerate extensions hash.

This commit is contained in:
Moinak Ghosh 2014-09-12 17:00:36 +05:30
parent 3e9a46a602
commit 5a875f3174
5 changed files with 155 additions and 152 deletions

View file

@ -1689,7 +1689,7 @@ detect_type_by_data(uchar_t *buf, size_t len)
// PNM files // PNM files
if (identify_pnm_type(buf, len)) { if (identify_pnm_type(buf, len)) {
return (TYPE_TEXT|TYPE_PNM); return (TYPE_BINARY|TYPE_PNM);
} }
// MSDOS COM types, two byte and one byte magic numbers are checked // MSDOS COM types, two byte and one byte magic numbers are checked

View file

@ -11,142 +11,146 @@ struct ext_entry {
int type; int type;
int len; int len;
} extlist[] = { } extlist[] = {
{"c" , TYPE_TEXT, 1}, {"c" , TYPE_TEXT, 1},
{"h" , TYPE_TEXT, 1}, {"h" , TYPE_TEXT, 1},
{"cc" , TYPE_TEXT, 2}, {"cc" , TYPE_TEXT, 2},
{"cpp" , TYPE_TEXT, 3}, {"cpp" , TYPE_TEXT, 3},
{"c++" , TYPE_TEXT, 3}, {"c++" , TYPE_TEXT, 3},
{"hpp" , TYPE_TEXT, 3}, {"hpp" , TYPE_TEXT, 3},
{"txt" , TYPE_TEXT, 3}, {"txt" , TYPE_TEXT, 3},
{"text" , TYPE_TEXT, 4}, {"text" , TYPE_TEXT, 4},
{"html" , TYPE_TEXT|TYPE_MARKUP, 4}, {"html" , TYPE_TEXT|TYPE_MARKUP, 4},
{"htm" , TYPE_TEXT|TYPE_MARKUP, 3}, {"htm" , TYPE_TEXT|TYPE_MARKUP, 3},
{"xml" , TYPE_TEXT|TYPE_MARKUP, 3}, {"xml" , TYPE_TEXT|TYPE_MARKUP, 3},
{"info" , TYPE_TEXT, 4}, {"info" , TYPE_TEXT, 4},
{"ppm" , TYPE_TEXT, 3}, {"svg" , TYPE_TEXT, 3},
{"svg" , TYPE_TEXT, 3}, {"conf" , TYPE_TEXT, 4},
{"conf" , TYPE_TEXT, 4}, {"py" , TYPE_TEXT, 2},
{"py" , TYPE_TEXT, 2}, {"rb" , TYPE_TEXT, 2},
{"rb" , TYPE_TEXT, 2}, {"xpm" , TYPE_TEXT, 3},
{"xpm" , TYPE_TEXT, 3}, {"js" , TYPE_TEXT, 2},
{"js" , TYPE_TEXT, 2}, {"jsp" , TYPE_TEXT, 3},
{"jsp" , TYPE_TEXT, 3}, {"pl" , TYPE_TEXT, 2},
{"pl" , TYPE_TEXT, 2}, {"tcl" , TYPE_TEXT, 3},
{"tcl" , TYPE_TEXT, 3}, {"sh" , TYPE_TEXT, 2},
{"sh" , TYPE_TEXT, 2}, {"php" , TYPE_TEXT, 3},
{"php" , TYPE_TEXT, 3}, {"bat" , TYPE_TEXT, 3},
{"bat" , TYPE_TEXT, 3}, {"pm" , TYPE_TEXT, 2},
{"pm" , TYPE_TEXT, 2}, {"r" , TYPE_TEXT, 1},
{"r" , TYPE_TEXT, 1}, {"d" , TYPE_TEXT, 1},
{"d" , TYPE_TEXT, 1}, {"bas" , TYPE_TEXT, 3},
{"bas" , TYPE_TEXT, 3}, {"asm" , TYPE_TEXT, 3},
{"asm" , TYPE_TEXT, 3}, {"go" , TYPE_TEXT, 2},
{"go" , TYPE_TEXT, 2}, {"java" , TYPE_TEXT, 4},
{"java" , TYPE_TEXT, 4}, {"m4" , TYPE_TEXT, 2},
{"m4" , TYPE_TEXT, 2}, {"vb" , TYPE_TEXT, 2},
{"vb" , TYPE_TEXT, 2}, {"xslt" , TYPE_TEXT|TYPE_MARKUP, 4},
{"xslt" , TYPE_TEXT|TYPE_MARKUP, 4}, {"xsl" , TYPE_TEXT|TYPE_MARKUP, 3},
{"xsl" , TYPE_TEXT|TYPE_MARKUP, 3}, {"yacc" , TYPE_TEXT, 4},
{"yacc" , TYPE_TEXT, 4}, {"lex" , TYPE_TEXT, 3},
{"lex" , TYPE_TEXT, 3}, {"csv" , TYPE_TEXT, 3},
{"csv" , TYPE_TEXT, 3}, {"shtml" , TYPE_TEXT|TYPE_MARKUP, 5},
{"shtml" , TYPE_TEXT|TYPE_MARKUP, 5}, {"xhtml" , TYPE_TEXT|TYPE_MARKUP, 5},
{"xhtml" , TYPE_TEXT|TYPE_MARKUP, 5}, {"xht" , TYPE_TEXT|TYPE_MARKUP, 3},
{"xht" , TYPE_TEXT|TYPE_MARKUP, 3}, {"asp" , TYPE_TEXT, 3},
{"asp" , TYPE_TEXT, 3}, {"aspx" , TYPE_TEXT, 4},
{"aspx" , TYPE_TEXT, 4}, {"rss" , TYPE_TEXT|TYPE_MARKUP, 3},
{"rss" , TYPE_TEXT|TYPE_MARKUP, 3}, {"atom" , TYPE_TEXT|TYPE_MARKUP, 4},
{"atom" , TYPE_TEXT|TYPE_MARKUP, 4}, {"cgi" , TYPE_TEXT, 3},
{"cgi" , TYPE_TEXT, 3}, {"c#" , TYPE_TEXT, 2},
{"c#" , TYPE_TEXT, 2}, {"cob" , TYPE_TEXT, 3},
{"cob" , TYPE_TEXT, 3}, {"ada" , TYPE_TEXT, 3},
{"ada" , TYPE_TEXT, 3}, {"ini" , TYPE_TEXT, 3},
{"ini" , TYPE_TEXT, 3}, {"y" , TYPE_TEXT, 1},
{"y" , TYPE_TEXT, 1}, {"swg" , TYPE_TEXT, 3},
{"swg" , TYPE_TEXT, 3}, {"s" , TYPE_TEXT, 1},
{"s" , TYPE_TEXT, 1}, {"ps" , TYPE_TEXT, 2},
{"ps" , TYPE_TEXT, 2}, {"bib" , TYPE_TEXT, 3},
{"bib" , TYPE_TEXT, 3}, {"lua" , TYPE_TEXT, 3},
{"lua" , TYPE_TEXT, 3}, {"dtd" , TYPE_TEXT, 3},
{"dtd" , TYPE_TEXT, 3}, {"qml" , TYPE_TEXT|TYPE_MARKUP, 3},
{"qml" , TYPE_TEXT|TYPE_MARKUP, 3}, {"fa" , TYPE_TEXT|TYPE_DNA_SEQ, 2},
{"fa" , TYPE_TEXT|TYPE_DNA_SEQ, 2}, {"faa" , TYPE_TEXT|TYPE_DNA_SEQ, 3},
{"faa" , TYPE_TEXT|TYPE_DNA_SEQ, 3}, {"asn" , TYPE_TEXT|TYPE_MARKUP, 3},
{"asn" , TYPE_TEXT|TYPE_MARKUP, 3}, {"ffn" , TYPE_TEXT|TYPE_DNA_SEQ, 3},
{"ffn" , TYPE_TEXT|TYPE_DNA_SEQ, 3}, {"fna" , TYPE_TEXT|TYPE_DNA_SEQ, 3},
{"fna" , TYPE_TEXT|TYPE_DNA_SEQ, 3}, {"frn" , TYPE_TEXT|TYPE_DNA_SEQ, 3},
{"frn" , TYPE_TEXT|TYPE_DNA_SEQ, 3}, {"gbk" , TYPE_TEXT, 3},
{"gbk" , TYPE_TEXT, 3}, {"gff" , TYPE_TEXT, 3},
{"gff" , TYPE_TEXT, 3}, {"ptt" , TYPE_TEXT, 3},
{"ptt" , TYPE_TEXT, 3}, {"rnt" , TYPE_TEXT, 3},
{"rnt" , TYPE_TEXT, 3}, {"val" , TYPE_BINARY, 3},
{"val" , TYPE_BINARY, 3}, {"tcc" , TYPE_TEXT, 3},
{"tcc" , TYPE_TEXT, 3}, {"css" , TYPE_TEXT, 3},
{"css" , TYPE_TEXT, 3}, {"pod" , TYPE_TEXT, 3},
{"pod" , TYPE_TEXT, 3}, {"al" , TYPE_TEXT, 2},
{"al" , TYPE_TEXT, 2}, {"vim" , TYPE_TEXT, 3},
{"vim" , TYPE_TEXT, 3}, {"am" , TYPE_TEXT, 2},
{"am" , TYPE_TEXT, 2}, {"upp" , TYPE_TEXT, 3},
{"upp" , TYPE_TEXT, 3}, {"mom" , TYPE_TEXT, 3},
{"mom" , TYPE_TEXT, 3}, {"tmac" , TYPE_TEXT, 4},
{"tmac" , TYPE_TEXT, 4}, {"pdf" , TYPE_BINARY, 3},
{"pdf" , TYPE_BINARY, 3}, {"tif" , TYPE_BINARY|TYPE_TIFF, 3},
{"tif" , TYPE_BINARY|TYPE_TIFF, 3}, {"tiff" , TYPE_BINARY|TYPE_TIFF, 4},
{"tiff" , TYPE_BINARY|TYPE_TIFF, 4}, {"jpg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 3},
{"jpg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 3}, {"jpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 4},
{"jpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 4}, {"mjpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_MJPEG, 5},
{"mjpeg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_MJPEG, 5}, {"png" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3},
{"png" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3}, {"mp3" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"mp3" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"wma" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"wma" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"divx" , TYPE_BINARY|TYPE_COMPRESSED, 4},
{"divx" , TYPE_BINARY|TYPE_COMPRESSED, 4}, {"mp4" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_MP4, 3},
{"mp4" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_MP4, 3}, {"aac" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"aac" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"m4a" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"m4a" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"m4p" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"m4p" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"ofs" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"ofs" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"ofr" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"ofr" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"flac" , TYPE_BINARY|TYPE_FLAC, 4},
{"flac" , TYPE_BINARY|TYPE_FLAC, 4}, {"avi" , TYPE_BINARY|TYPE_AVI, 3},
{"avi" , TYPE_BINARY|TYPE_AVI, 3}, {"pac" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"pac" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"gif" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZW, 3},
{"gif" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZW, 3}, {"jp2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 3},
{"jp2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_JPEG, 3}, {"pjg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_PACKJPG, 3},
{"pjg" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_PACKJPG, 3}, {"gz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 2},
{"gz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 2}, {"tgz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3},
{"tgz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3}, {"bz2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_BZ2, 3},
{"bz2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_BZ2, 3}, {"tbz2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_BZ2, 4},
{"tbz2" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_BZ2, 4}, {"zip" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ZIP, 3},
{"zip" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ZIP, 3}, {"arj" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ARJ, 3},
{"arj" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ARJ, 3}, {"arc" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ARC, 3},
{"arc" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ARC, 3}, {"jar" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3},
{"jar" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_GZ, 3}, {"lz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZ, 2},
{"lz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZ, 2}, {"lzh" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"lzh" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"lha" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"lha" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"lzma" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 4},
{"lzma" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 4}, {"lzo" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZO, 3},
{"lzo" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZO, 3}, {"dmg" , TYPE_BINARY, 3},
{"dmg" , TYPE_BINARY, 3}, {"7z" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 2},
{"7z" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 2}, {"uha" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"uha" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"alz" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"alz" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"ace" , TYPE_BINARY|TYPE_COMPRESSED, 3},
{"ace" , TYPE_BINARY|TYPE_COMPRESSED, 3}, {"rar" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_RAR, 3},
{"rar" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_RAR, 3}, {"xz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 2},
{"xz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 2}, {"txz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 3},
{"txz" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_LZMA, 3}, {"pmd" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_PPMD, 3},
{"pmd" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_PPMD, 3}, {"zpaq" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ZPAQ, 4},
{"zpaq" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_COMPRESSED_ZPAQ, 4}, {"xcf" , TYPE_BINARY, 3},
{"xcf" , TYPE_BINARY, 3}, {"mo" , TYPE_BINARY, 2},
{"mo" , TYPE_BINARY, 2}, {"pyo" , TYPE_BINARY, 3},
{"pyo" , TYPE_BINARY, 3}, {"pyc" , TYPE_BINARY, 3},
{"pyc" , TYPE_BINARY, 3}, {"wav" , TYPE_BINARY, 3},
{"wav" , TYPE_BINARY, 3}, {"tta" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_AUDIO_COMPRESSED, 3},
{"tta" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_AUDIO_COMPRESSED, 3}, {"wv" , TYPE_BINARY|TYPE_COMPRESSED, 2},
{"wv" , TYPE_BINARY|TYPE_COMPRESSED, 2}, {"swf" , TYPE_BINARY, 3},
{"swf" , TYPE_BINARY, 3}, {"SVGZ" , TYPE_BINARY, 4},
{"SVGZ" , TYPE_BINARY, 4}, {"ODT" , TYPE_BINARY, 3},
{"ODT" , TYPE_BINARY, 3}, {"3DM" , TYPE_BINARY, 3},
{"3DM" , TYPE_BINARY, 3}, {"chm" , TYPE_BINARY, 3},
{"chm" , TYPE_BINARY, 3}, {"CHM" , TYPE_BINARY, 3},
{"CHM" , TYPE_BINARY, 3}, {"ppm" , TYPE_BINARY|TYPE_PNM, 3},
{"pbm" , TYPE_BINARY|TYPE_PNM, 3},
{"pgm" , TYPE_BINARY|TYPE_PNM, 3},
{"pnm" , TYPE_BINARY|TYPE_PNM, 3},
{"ppn" , TYPE_BINARY|TYPE_COMPRESSED|TYPE_PACKPNM, 3},
}; };
#endif #endif

View file

@ -10,7 +10,6 @@ html,TYPE_TEXT|TYPE_MARKUP
htm,TYPE_TEXT|TYPE_MARKUP htm,TYPE_TEXT|TYPE_MARKUP
xml,TYPE_TEXT|TYPE_MARKUP xml,TYPE_TEXT|TYPE_MARKUP
info,TYPE_TEXT info,TYPE_TEXT
ppm,TYPE_TEXT
svg,TYPE_TEXT svg,TYPE_TEXT
conf,TYPE_TEXT conf,TYPE_TEXT
py,TYPE_TEXT py,TYPE_TEXT
@ -138,8 +137,8 @@ ODT,TYPE_BINARY,TYPE_COMPRESSED|TYPE_COMPRESSED_ZIP
3DM,TYPE_BINARY 3DM,TYPE_BINARY
chm,TYPE_BINARY chm,TYPE_BINARY
CHM,TYPE_BINARY CHM,TYPE_BINARY
ppm,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PNM ppm,TYPE_BINARY|TYPE_PNM
pbm,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PNM pbm,TYPE_BINARY|TYPE_PNM
pgm,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PNM pgm,TYPE_BINARY|TYPE_PNM
pnm,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PNM pnm,TYPE_BINARY|TYPE_PNM
ppn,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PACKPNM ppn,TYPE_BINARY|TYPE_COMPRESSED|TYPE_PACKPNM

View file

@ -12,14 +12,14 @@
/* small adjustments to _a_ to make values distinct */ /* small adjustments to _a_ to make values distinct */
ub1 tab[] = { ub1 tab[] = {
125,0,0,220,125,0,82,82,113,0,0,113,0,0,113,125, 125,0,0,220,85,0,82,87,113,0,0,113,0,0,82,125,
0,0,7,32,0,113,82,0,0,183,0,131,0,7,220,120, 0,0,7,87,0,113,82,0,0,183,0,131,0,7,0,253,
0,0,0,0,85,0,0,0,0,113,125,113,0,7,22,0, 0,0,0,0,85,0,113,0,0,113,125,113,0,7,22,0,
82,0,7,113,125,125,0,0,0,113,113,85,220,0,0,85, 82,0,7,113,125,125,0,0,0,113,113,131,220,0,0,85,
0,82,0,0,113,0,85,183,82,88,11,85,55,113,0,0, 0,87,0,0,113,0,85,183,82,88,7,88,58,113,0,0,
124,0,113,125,0,125,0,235,0,82,125,55,0,22,0,92, 124,0,168,125,0,125,0,116,0,82,125,55,0,22,116,12,
0,125,113,7,0,40,0,0,82,61,0,42,0,11,177,15, 0,125,113,113,0,40,0,0,42,232,0,124,0,92,183,61,
0,0,0,0,0,6,0,0,56,11,0,0,164,47,0,0, 0,0,221,0,0,234,0,0,97,11,0,0,164,91,0,0,
}; };
/* The hash function */ /* The hash function */

View file

@ -8,7 +8,7 @@
extern ub1 tab[]; extern ub1 tab[];
#define PHASHLEN 0x80 /* length of hash mapping table */ #define PHASHLEN 0x80 /* length of hash mapping table */
#define PHASHNKEYS 137 /* How many keys were hashed */ #define PHASHNKEYS 141 /* How many keys were hashed */
#define PHASHRANGE 256 /* Range any input might map to */ #define PHASHRANGE 256 /* Range any input might map to */
#define PHASHSALT 0x9e3779b9 /* internal, initialize normal hash */ #define PHASHSALT 0x9e3779b9 /* internal, initialize normal hash */