Blame libarchive/archive_pack_dev.h

Packit 08bd4c
/*	$NetBSD: pack_dev.h,v 1.8 2013/06/14 16:28:20 tsutsui Exp $	*/
Packit 08bd4c
Packit 08bd4c
/*-
Packit 08bd4c
 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
Packit 08bd4c
 * All rights reserved.
Packit 08bd4c
 *
Packit 08bd4c
 * This code is derived from software contributed to The NetBSD Foundation
Packit 08bd4c
 * by Charles M. Hannum.
Packit 08bd4c
 *
Packit 08bd4c
 * Redistribution and use in source and binary forms, with or without
Packit 08bd4c
 * modification, are permitted provided that the following conditions
Packit 08bd4c
 * are met:
Packit 08bd4c
 * 1. Redistributions of source code must retain the above copyright
Packit 08bd4c
 *    notice, this list of conditions and the following disclaimer.
Packit 08bd4c
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 08bd4c
 *    notice, this list of conditions and the following disclaimer in the
Packit 08bd4c
 *    documentation and/or other materials provided with the distribution.
Packit 08bd4c
 *
Packit 08bd4c
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
Packit 08bd4c
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
Packit 08bd4c
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
Packit 08bd4c
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
Packit 08bd4c
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Packit 08bd4c
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Packit 08bd4c
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 08bd4c
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Packit 08bd4c
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Packit 08bd4c
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Packit 08bd4c
 * POSSIBILITY OF SUCH DAMAGE.
Packit 08bd4c
 */
Packit 08bd4c
Packit 08bd4c
/* Originally from NetBSD's mknod(8) source. */
Packit 08bd4c
Packit 08bd4c
#ifndef	_PACK_DEV_H
Packit 08bd4c
#define	_PACK_DEV_H
Packit 08bd4c
Packit 08bd4c
typedef	dev_t pack_t(int, unsigned long [], const char **);
Packit 08bd4c
Packit 08bd4c
pack_t	*pack_find(const char *);
Packit 08bd4c
pack_t	 pack_native;
Packit 08bd4c
Packit 08bd4c
#define	major_netbsd(x)		((int32_t)((((x) & 0x000fff00) >>  8)))
Packit 08bd4c
#define	minor_netbsd(x)		((int32_t)((((x) & 0xfff00000) >> 12) | \
Packit 08bd4c
					   (((x) & 0x000000ff) >>  0)))
Packit 08bd4c
#define	makedev_netbsd(x,y)	((dev_t)((((x) <<  8) & 0x000fff00) | \
Packit 08bd4c
					 (((y) << 12) & 0xfff00000) | \
Packit 08bd4c
					 (((y) <<  0) & 0x000000ff)))
Packit 08bd4c
Packit 08bd4c
#endif	/* _PACK_DEV_H */