001/*
002 * This file is part of lzo-java, an implementation of LZO in Java.
003 * https://github.com/shevek/lzo-java
004 *
005 * The Java portion of this library is:
006 * Copyright (C) 2011 Shevek <shevek@anarres.org>
007 * All Rights Reserved.
008 *
009 * The preprocessed C portion of this library is:
010 * Copyright (C) 2006-2011 Markus Franz Xaver Johannes Oberhumer
011 * All Rights Reserved.
012 *
013 * This library is free software; you can redistribute it and/or
014 * modify it under the terms of the GNU General Public License
015 * as published by the Free Software Foundation; either version
016 * 2 of the License, or (at your option) any later version.
017 *
018 * This library is distributed in the hope that it will be useful,
019 * but WITHOUT ANY WARRANTY; without even the implied warranty
020 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
021 * See the GNU General Public License for more details.
022 *
023 * You should have received a copy of the GNU General Public
024 * License along with the LZO library; see the file COPYING.
025 * If not, see <http://www.gnu.org/licenses/> or write to the
026 * Free Software Foundation, Inc., 51 Franklin Street, Fifth
027 * Floor, Boston, MA 02110-1301, USA.
028
029 * As a special exception, the copyright holders of this file
030 * give you permission to link this file with independent
031 * modules to produce an executable, regardless of the license
032 * terms of these independent modules, and to copy and distribute
033 * the resulting executable under terms of your choice, provided
034 * that you also meet, for each linked independent module,
035 * the terms and conditions of the license of that module. An
036 * independent module is a module which is not derived from or
037 * based on this library or file. If you modify this file, you may
038 * extend this exception to your version of the file, but
039 * you are not obligated to do so. If you do not wish to do so,
040 * delete this exception statement from your version.
041 */
042package org.anarres.lzo;
043
044/**
045 *
046 * @author shevek
047 */
048public class LzopConstants {
049
050    /** 9 bytes at the top of every lzo file */
051    /* pp */ static final byte[] LZOP_MAGIC = new byte[]{
052        -119, 'L', 'Z', 'O', 0, '\r', '\n', '\032', '\n'};
053    /** Version of lzop this emulates */
054    public static final int LZOP_VERSION = 0x1010;
055    /** Latest version of lzop this should be compatible with */
056    public static final int LZOP_COMPAT_VERSION = 0x0940;
057    public static final byte M_LZO1X_1 = 1;
058    public static final byte M_LZO1X_1_15 = 2;
059    public static final byte M_LZO1X_999 = 3;
060
061    /* header flags */
062    public static final long F_ADLER32_D = 0x00000001L;
063    public static final long F_ADLER32_C = 0x00000002L;
064    public static final long F_STDIN = 0x00000004L;
065    public static final long F_STDOUT = 0x00000008L;
066    public static final long F_NAME_DEFAULT = 0x00000010L;
067    public static final long F_DOSISH = 0x00000020L;
068    public static final long F_H_EXTRA_FIELD = 0x00000040L;
069    public static final long F_H_GMTDIFF = 0x00000080L;
070    public static final long F_CRC32_D = 0x00000100L;
071    public static final long F_CRC32_C = 0x00000200L;
072    public static final long F_MULTIPART = 0x00000400L;
073    public static final long F_H_FILTER = 0x00000800L;
074    public static final long F_H_CRC32 = 0x00001000L;
075    public static final long F_H_PATH = 0x00002000L;
076    public static final long F_MASK = 0x00003FFFL;
077
078    /* operating system & file system that created the file [mostly unused] */
079    public static final long F_OS_FAT = 0x00000000L;         /* DOS, OS2, Win95 */
080
081    public static final long F_OS_AMIGA = 0x01000000L;
082    public static final long F_OS_VMS = 0x02000000L;
083    public static final long F_OS_UNIX = 0x03000000L;
084    public static final long F_OS_VM_CMS = 0x04000000L;
085    public static final long F_OS_ATARI = 0x05000000L;
086    public static final long F_OS_OS2 = 0x06000000L;         /* OS2 */
087
088    public static final long F_OS_MAC9 = 0x07000000L;
089    public static final long F_OS_Z_SYSTEM = 0x08000000L;
090    public static final long F_OS_CPM = 0x09000000L;
091    public static final long F_OS_TOPS20 = 0x0a000000L;
092    public static final long F_OS_NTFS = 0x0b000000L;         /* Win NT/2000/XP */
093
094    public static final long F_OS_QDOS = 0x0c000000L;
095    public static final long F_OS_ACORN = 0x0d000000L;
096    public static final long F_OS_VFAT = 0x0e000000L;         /* Win32 */
097
098    public static final long F_OS_MFS = 0x0f000000L;
099    public static final long F_OS_BEOS = 0x10000000L;
100    public static final long F_OS_TANDEM = 0x11000000L;
101    public static final int F_OS_SHIFT = 24;
102    public static final long F_OS_MASK = 0xff000000L;
103
104    /* character set for file name encoding [mostly unused] */
105    public static final long F_CS_NATIVE = 0x00000000L;
106    public static final long F_CS_LATIN1 = 0x00100000L;
107    public static final long F_CS_DOS = 0x00200000L;
108    public static final long F_CS_WIN32 = 0x00300000L;
109    public static final long F_CS_WIN16 = 0x00400000L;
110    public static final long F_CS_UTF8 = 0x00500000L;         /* filename is UTF-8 encoded */
111
112    public static final int F_CS_SHIFT = 20;
113    public static final long F_CS_MASK = 0x00f00000L;
114
115    /* these bits must be zero */
116    public static final long F_RESERVED = ((F_MASK | F_OS_MASK | F_CS_MASK) ^ 0xffffffffL);
117}