2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2011 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A/* Header flags - copied from conf.h of LZOP source code. */ 2N/A/* Some helper functions. On errors memory allocated by those function is free 2N/A * either on close() so no risk of leaks. This makes functions simpler. */ 2N/A/* Read block header from file, after successful exit file points to 2N/A * beginning of block data. */ 2N/A /* Free cached block data if any. */ 2N/A /* Last block has uncompressed data size == 0 and no other fields. */ 2N/A /* Read compressed data block size. */ 2N/A /* Read checksum of uncompressed data. */ 2N/A /* Read checksum of compressed data. */ 2N/A /* Incompressible data block. */ 2N/A/* Read block data into memory. File must be set to beginning of block data. 2N/A * Can't be called on last block. */ 2N/A/* Read block data, uncompressed and also store it in memory. */ 2N/A/* XXX Investigate possibility of in-place decompression to reduce memory 2N/A * footprint. Or try to uncompress directly to buf if possible. */ 2N/A /* Incompressible data. */ 2N/A /* Compressed data can be free now. */ 2N/A/* Jump to next block and read its header. */ 2N/A /* only jump if block was not decompressed (and read from disk) */ 2N/A /* FIXME: Don't do this for not easily seekable files. */ 2N/A /* grub_uint32_t filter; */ /* No filters support. Rarely used anyway. */ 2N/A "unsupported (too old) LZOP version");
2N/A /* Too new version, should upgrade minilzo? */ 2N/A "unsupported (too new) LZO version");
2N/A /* MAGIC is not included in check calculation. */ 2N/A /* Get back to start block. */ 2N/A /* Read first block - grub_lzopio_read() expects valid block. */ 2N/A /* Backward seek before last read block. */ 2N/A /* Forward to first block with requested data. */ 2N/A /* EOF, could be possible files with unknown size. */ 2N/A /* Block not decompressed yet. */ 2N/A /* Copy requested data into buffer. */ 2N/A /* Read next block if needed. */ 2N/A/* Release everything, including the underlying file object. */ 2N/A /* Device must not be closed twice. */