+int is_xm(unsigned char *buf, unsigned long len)
+{
+ static const char head[15] =
+ /* ASCII encoding of "Extended Module" */
+ "\x45\x78\x74\x65\x6e\x64\x65\x64\x20\x4d\x6f\x64\x75\x6c\x65";
+
+ if (len >= sizeof head && memcmp(head, buf, sizeof head) == 0)
+ return 1;
+ return 0;
+}
+
+int is_it(unsigned char *buf, unsigned long len)
+{
+ static const char head[4] =
+ /* ASCII encoding of "IMPM" */
+ "\x49\x4d\x50\x4d";
+
+ if (len >= sizeof head && memcmp(head, buf, sizeof head) == 0)
+ return 1;
+ return 0;
+}
+
+int is_s3m(unsigned char *buf, unsigned long len)
+{
+ static const char head[4] =
+ /* ASCII encoding of "SCRM" */
+ "\x53\x43\x52\x4d";
+
+ if (len < 0x2c + sizeof head)
+ return 0;
+ if (memcmp(head, buf+0x2c, sizeof head) == 0)
+ return 1;
+ return 0;
+}
+