1176998Sphk/*-
2176998Sphk * Copyright (c) 2005-2008
3176998Sphk * All rights reserved.
4176998Sphk *
5176998Sphk * Redistribution and use in source and binary forms, with or without
6176998Sphk * modification, are permitted provided that the following conditions
7176998Sphk * are met:
8176998Sphk * 1. Redistributions of source code must retain the above copyright
9176998Sphk *    notice, this list of conditions and the following disclaimer.
10176998Sphk * 2. Redistributions in binary form must reproduce the above copyright
11176998Sphk *    notice, this list of conditions and the following disclaimer in the
12176998Sphk *    documentation and/or other materials provided with the distribution.
13176998Sphk *
14176998Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15176998Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16176998Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17176998Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18176998Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19176998Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20176998Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21176998Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22176998Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23176998Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24176998Sphk * SUCH DAMAGE.
25176998Sphk *
26176998Sphk * $FreeBSD$
27176998Sphk */
28176998Sphk
29176998Sphkstruct fifolog_file {
30176998Sphk	unsigned			magic;
31176998Sphk#define FIFOLOG_FILE_MAGIC		0x307ea50d
32176998Sphk
33219095Sphk	ssize_t				recsize;
34176998Sphk	off_t				logsize;
35176998Sphk	int				fd;
36176998Sphk
37176998Sphk	z_stream			*zs;
38176998Sphk
39176998Sphk	unsigned char			*recbuf;
40176998Sphk};
41176998Sphk
42176998Sphkconst char *fifolog_int_open(struct fifolog_file **ff, const char *fname, int mode);
43176998Sphkvoid fifolog_int_close(struct fifolog_file **ff);
44176998Sphkint fifolog_int_read(const struct fifolog_file *ff, off_t recno);
45176998Sphkconst char *fifolog_int_findend(const struct fifolog_file *ff, off_t *last);
46