#ifndef __INCLUDE_TAILER_H__ #define __INCLUDE_TAILER_H__ /* Functions for managing a "tailer file", which is similar to a tar * archive but, in order to support ordinary unadorned files * - stores metainformation after each archived file * - stores a single magic number at the very end. */ /* Magic number, occurs only once at the end of tailer file. Should it * change, be sure to update TAIL_MAGIC_LEN */ #define TAIL_MAGIC "#TAIL_GUARD#" #define TAIL_MAGIC_LEN 12 /* Maximum length of title associated with a stored file. Arbitrary, but * should it increase, metainfo size (currently 1 byte) must change * accordingly */ #define TAIL_MAX_TITLE_LENGTH 255 /* Each file's metainfo entry comprises (version 1,0): * - offset where actual contents start: 4-byte big-endian * - size of contents in bytes: 4-byte big-endian * - title, up to TAIL_MAX_TITLE_LENGTH bytes, non 0-terminated * - title length, 1 byte * - major/minor version number, 1 byte each * * A tailer file is either an unadorned one or a linked list of content+ * metainfo entries which goes backwards from the magic number. */ /* Functions for handling tailer data as memory buffers */ /* If a memory buffer
with of is unadorned has no such
* occurrences
*/
extern const unsigned char *defex_tailerp_find(const unsigned char *p, long size,
const char *title, long *sizep);
/* Given buffer with