"Fossies" - the Fresh Open Source Software Archive

Member "file-5.35/magic/Magdir/smile" (17 Mar 2017, 1262 Bytes) of package /linux/misc/file-5.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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