]> granicus.if.org Git - file/commitdiff
PR/129: Add smile
authorChristos Zoulas <christos@zoulas.com>
Wed, 17 Aug 2011 17:37:18 +0000 (17:37 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 17 Aug 2011 17:37:18 +0000 (17:37 +0000)
magic/Magdir/smile [new file with mode: 0644]
magic/Makefile.am

diff --git a/magic/Magdir/smile b/magic/Magdir/smile
new file mode 100644 (file)
index 0000000..bbdc96b
--- /dev/null
@@ -0,0 +1,34 @@
+
+#------------------------------------------------------------------------------
+# $File$
+# smile:  file(1) magic for Smile serialization
+#
+# The Smile serialization format uses a 4-byte header:
+#
+#   Constant byte #0: 0x3A (ASCII ':')
+#   Constant byte #1: 0x29 (ASCII ')')
+#   Constant byte #2: 0x0A (ASCII linefeed, '\n')
+#   Variable byte #3, consisting of bits:
+#     Bits 4-7 (4 MSB): 4-bit version number
+#     Bits 3: Reserved
+#     Bit 2 (mask 0x04): Whether raw binary (unescaped 8-bit) values may be present in content
+#     Bit 1 (mask 0x02): Whether shared String value checking was enabled during encoding, default false
+#     Bit 0 (mask 0x01): Whether shared property name checking was enabled during encoding, default true
+#
+# Reference: http://wiki.fasterxml.com/SmileFormatSpec
+# Created by: Pierre-Alexandre Meyer <pierre@mouraf.org>
+
+# Detection
+0      string          :)\n    Smile binary data
+
+# Versioning
+>3     byte&0xF0       x               version %d:
+
+# Properties
+>3     byte&0x04       0x04            binary raw,
+>3     byte&0x04       0x00            binary encoded,
+>3     byte&0x02       0x02            shared String values enabled,
+>3     byte&0x02       0x00            shared String values disabled,
+>3     byte&0x01       0x01            shared field names enabled
+>3     byte&0x01       0x00            shared field names disabled
+
index d233324857c4fcc0e7402ea6736f7cc10ffca4f3..5d1b83af249e23840e97dcc9d194adb91c3ec6b7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $File: Makefile.am,v 1.70 2011/08/03 16:55:40 christos Exp $
+# $File: Makefile.am,v 1.71 2011/08/08 09:05:38 christos Exp $
 #
 MAGIC_FRAGMENT_BASE = Magdir
 MAGIC_DIR = $(top_srcdir)/magic
@@ -192,6 +192,7 @@ $(MAGIC_FRAGMENT_DIR)/sinclair \
 $(MAGIC_FRAGMENT_DIR)/sisu \
 $(MAGIC_FRAGMENT_DIR)/sketch \
 $(MAGIC_FRAGMENT_DIR)/smalltalk \
+$(MAGIC_FRAGMENT_DIR)/smile \
 $(MAGIC_FRAGMENT_DIR)/sniffer \
 $(MAGIC_FRAGMENT_DIR)/softquad \
 $(MAGIC_FRAGMENT_DIR)/spec \