kgzip.h revision 259065
11539Srgrimes/*
21539Srgrimes * Copyright (c) 1999 Global Technology Associates, Inc.
31539Srgrimes * All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
131539Srgrimes *
141539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
151539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
161539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
171539Srgrimes * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
181539Srgrimes * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
191539Srgrimes * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
201539Srgrimes * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
211539Srgrimes * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
221539Srgrimes * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
231539Srgrimes * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
241539Srgrimes * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251539Srgrimes *
261539Srgrimes * $FreeBSD: releng/10.0/usr.sbin/kgzip/kgzip.h 68313 2000-11-04 13:02:00Z rnordier $
271539Srgrimes */
281539Srgrimes
291539Srgrimes#include "kgz.h"
301539Srgrimes
311539Srgrimes#define F_AOUT	1		/* Format: a.out */
321539Srgrimes#define F_ELF	2		/* Format: ELF32 */
331539Srgrimes
341539Srgrimes/* Used by I/O routines */
351539Srgrimesstruct iodesc {
361539Srgrimes    const char *fname;		/* File name */
371539Srgrimes    int fd;			/* File descriptor */
381539Srgrimes};
395207Snate
4050473Speterextern const char *loader;	/* Default loader */
411539Srgrimesextern int format;		/* Output format */
421539Srgrimes
431539Srgrimesvoid kgzcmp(struct kgz_hdr *, const char *, const char *);
441539Srgrimesvoid kgzld(struct kgz_hdr *, const char *, const char *);
451539Srgrimes
46102287Spetervoid xclose(const struct iodesc *);
471539Srgrimesvoid xcopy(const struct iodesc *, const struct iodesc *, size_t, off_t);
481539Srgrimesvoid xzero(const struct iodesc *, size_t);
491539Srgrimessize_t xread(const struct iodesc *, void *, size_t, off_t);
5093032Simpvoid xwrite(const struct iodesc *, const void *, size_t);
511539Srgrimesvoid xseek(const struct iodesc *, off_t);
521539Srgrimes