1*b6cee71dSXin LI 2*b6cee71dSXin LI#------------------------------------------------------------------------------ 3*b6cee71dSXin LI# $File: smile,v 1.1 2011/08/17 17:37:18 christos Exp $ 4*b6cee71dSXin LI# smile: file(1) magic for Smile serialization 5*b6cee71dSXin LI# 6*b6cee71dSXin LI# The Smile serialization format uses a 4-byte header: 7*b6cee71dSXin LI# 8*b6cee71dSXin LI# Constant byte #0: 0x3A (ASCII ':') 9*b6cee71dSXin LI# Constant byte #1: 0x29 (ASCII ')') 10*b6cee71dSXin LI# Constant byte #2: 0x0A (ASCII linefeed, '\n') 11*b6cee71dSXin LI# Variable byte #3, consisting of bits: 12*b6cee71dSXin LI# Bits 4-7 (4 MSB): 4-bit version number 13*b6cee71dSXin LI# Bits 3: Reserved 14*b6cee71dSXin LI# Bit 2 (mask 0x04): Whether raw binary (unescaped 8-bit) values may be present in content 15*b6cee71dSXin LI# Bit 1 (mask 0x02): Whether shared String value checking was enabled during encoding, default false 16*b6cee71dSXin LI# Bit 0 (mask 0x01): Whether shared property name checking was enabled during encoding, default true 17*b6cee71dSXin LI# 18*b6cee71dSXin LI# Reference: http://wiki.fasterxml.com/SmileFormatSpec 19*b6cee71dSXin LI# Created by: Pierre-Alexandre Meyer <pierre@mouraf.org> 20*b6cee71dSXin LI 21*b6cee71dSXin LI# Detection 22*b6cee71dSXin LI0 string :)\n Smile binary data 23*b6cee71dSXin LI 24*b6cee71dSXin LI# Versioning 25*b6cee71dSXin LI>3 byte&0xF0 x version %d: 26*b6cee71dSXin LI 27*b6cee71dSXin LI# Properties 28*b6cee71dSXin LI>3 byte&0x04 0x04 binary raw, 29*b6cee71dSXin LI>3 byte&0x04 0x00 binary encoded, 30*b6cee71dSXin LI>3 byte&0x02 0x02 shared String values enabled, 31*b6cee71dSXin LI>3 byte&0x02 0x00 shared String values disabled, 32*b6cee71dSXin LI>3 byte&0x01 0x01 shared field names enabled 33*b6cee71dSXin LI>3 byte&0x01 0x00 shared field names disabled 34*b6cee71dSXin LI 35