186d7f5d3SJohn Marino 286d7f5d3SJohn Marino#------------------------------------------------------------------------------ 386d7f5d3SJohn Marino# $File: smile,v 1.1 2011/08/17 17:37:18 christos Exp $ 486d7f5d3SJohn Marino# smile: file(1) magic for Smile serialization 586d7f5d3SJohn Marino# 686d7f5d3SJohn Marino# The Smile serialization format uses a 4-byte header: 786d7f5d3SJohn Marino# 886d7f5d3SJohn Marino# Constant byte #0: 0x3A (ASCII ':') 986d7f5d3SJohn Marino# Constant byte #1: 0x29 (ASCII ')') 1086d7f5d3SJohn Marino# Constant byte #2: 0x0A (ASCII linefeed, '\n') 1186d7f5d3SJohn Marino# Variable byte #3, consisting of bits: 1286d7f5d3SJohn Marino# Bits 4-7 (4 MSB): 4-bit version number 1386d7f5d3SJohn Marino# Bits 3: Reserved 1486d7f5d3SJohn Marino# Bit 2 (mask 0x04): Whether raw binary (unescaped 8-bit) values may be present in content 1586d7f5d3SJohn Marino# Bit 1 (mask 0x02): Whether shared String value checking was enabled during encoding, default false 1686d7f5d3SJohn Marino# Bit 0 (mask 0x01): Whether shared property name checking was enabled during encoding, default true 1786d7f5d3SJohn Marino# 1886d7f5d3SJohn Marino# Reference: http://wiki.fasterxml.com/SmileFormatSpec 1986d7f5d3SJohn Marino# Created by: Pierre-Alexandre Meyer <pierre@mouraf.org> 2086d7f5d3SJohn Marino 2186d7f5d3SJohn Marino# Detection 2286d7f5d3SJohn Marino0 string :)\n Smile binary data 2386d7f5d3SJohn Marino 2486d7f5d3SJohn Marino# Versioning 2586d7f5d3SJohn Marino>3 byte&0xF0 x version %d: 2686d7f5d3SJohn Marino 2786d7f5d3SJohn Marino# Properties 2886d7f5d3SJohn Marino>3 byte&0x04 0x04 binary raw, 2986d7f5d3SJohn Marino>3 byte&0x04 0x00 binary encoded, 3086d7f5d3SJohn Marino>3 byte&0x02 0x02 shared String values enabled, 3186d7f5d3SJohn Marino>3 byte&0x02 0x00 shared String values disabled, 3286d7f5d3SJohn Marino>3 byte&0x01 0x01 shared field names enabled 3386d7f5d3SJohn Marino>3 byte&0x01 0x00 shared field names disabled 3486d7f5d3SJohn Marino 35