From 8f980a4164512cbac1705085092b61de90376539 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Wed, 14 May 2014 23:04:59 +0000 Subject: [PATCH] PR/346: New sereal magic --- magic/Magdir/sereal | 24 ++++++++++++++++++++++++ magic/Makefile.am | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 magic/Magdir/sereal diff --git a/magic/Magdir/sereal b/magic/Magdir/sereal new file mode 100644 index 00000000..21dabf5c --- /dev/null +++ b/magic/Magdir/sereal @@ -0,0 +1,24 @@ +#------------------------------------------------------------------------------ +# $File$ +# sereal: file(1) magic the Sereal binary serialization format +# +# From: Ævar Arnfjörð Bjarmason +# +# See the specification of the format at +# https://github.com/Sereal/Sereal/blob/master/sereal_spec.pod#document-header-format +# +# I'd have liked to do the byte&0xF0 matching against 0, 1, 2 ... by +# doing (byte&0xF0)>>4 here, but unfortunately that's not +# supported. So when we print out a message about an unknown format +# we'll print out e.g. 0x30 instead of the more human-readable +# 0x30>>4. +# +# See https://github.com/Sereal/Sereal/commit/35372ae01d in the +# Sereal.git repository for test Sereal data. +0 string \=srl Sereal data +!:mime application/sereal +>4 byte&0x0F x (version %d, +>4 byte&0xF0 0x00 uncompressed) +>4 byte&0xF0 0x10 compressed with non-incremental Snappy) +>4 byte&0xF0 0x20 compressed with incremental Snappy) +>4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4) diff --git a/magic/Makefile.am b/magic/Makefile.am index 7fa58436..bf93468a 100644 --- a/magic/Makefile.am +++ b/magic/Makefile.am @@ -1,5 +1,5 @@ # -# $File: Makefile.am,v 1.95 2014/01/31 01:51:32 christos Exp $ +# $File: Makefile.am,v 1.96 2014/03/07 17:25:17 christos Exp $ # MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic @@ -208,6 +208,7 @@ $(MAGIC_FRAGMENT_DIR)/securitycerts \ $(MAGIC_FRAGMENT_DIR)/selinux \ $(MAGIC_FRAGMENT_DIR)/sendmail \ $(MAGIC_FRAGMENT_DIR)/sequent \ +$(MAGIC_FRAGMENT_DIR)/sereal \ $(MAGIC_FRAGMENT_DIR)/sgi \ $(MAGIC_FRAGMENT_DIR)/sgml \ $(MAGIC_FRAGMENT_DIR)/sharc \ -- 2.40.0