kgzip.h revision 68313
176195Sbrian/* 276195Sbrian * Copyright (c) 1999 Global Technology Associates, Inc. 378412Sbrian * All rights reserved. 478412Sbrian * 578412Sbrian * Redistribution and use in source and binary forms, with or without 676195Sbrian * modification, are permitted provided that the following conditions 776195Sbrian * are met: 876195Sbrian * 1. Redistributions of source code must retain the above copyright 976195Sbrian * notice, this list of conditions and the following disclaimer. 1076195Sbrian * 2. Redistributions in binary form must reproduce the above copyright 1176195Sbrian * notice, this list of conditions and the following disclaimer in the 1276195Sbrian * documentation and/or other materials provided with the distribution. 1376195Sbrian * 1476195Sbrian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND 1576195Sbrian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1676195Sbrian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1776195Sbrian * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 1876195Sbrian * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 1976195Sbrian * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 2076195Sbrian * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 2176195Sbrian * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2276195Sbrian * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 2376195Sbrian * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 2476195Sbrian * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2576195Sbrian * 2676195Sbrian * $FreeBSD: head/usr.sbin/kgzip/kgzip.h 68313 2000-11-04 13:02:00Z rnordier $ 2776195Sbrian */ 2876195Sbrian 2976195Sbrian#include "kgz.h" 3076195Sbrian 3176195Sbrian#define F_AOUT 1 /* Format: a.out */ 3276195Sbrian#define F_ELF 2 /* Format: ELF32 */ 3376195Sbrian 3476195Sbrian/* Used by I/O routines */ 3576195Sbrianstruct iodesc { 3676195Sbrian const char *fname; /* File name */ 3776195Sbrian int fd; /* File descriptor */ 3876195Sbrian}; 3976195Sbrian 4076195Sbrianextern const char *loader; /* Default loader */ 4176195Sbrianextern int format; /* Output format */ 4276195Sbrian 4376327Sbrianvoid kgzcmp(struct kgz_hdr *, const char *, const char *); 4476327Sbrianvoid kgzld(struct kgz_hdr *, const char *, const char *); 4576196Sbrian 4676195Sbrianvoid xclose(const struct iodesc *); 4776196Sbrianvoid xcopy(const struct iodesc *, const struct iodesc *, size_t, off_t); 4876195Sbrianvoid xzero(const struct iodesc *, size_t); 4976195Sbriansize_t xread(const struct iodesc *, void *, size_t, off_t); 5076195Sbrianvoid xwrite(const struct iodesc *, const void *, size_t); 5176195Sbrianvoid xseek(const struct iodesc *, off_t); 5276195Sbrian