/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2011 Gary Mills
*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _PCFS_COMMON_H
#define _PCFS_COMMON_H
/*
* Common routines for the pcfs user-level utilities
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/isa_defs.h>
#include <sys/sysmacros.h>
#include "pcfs_bpb.h"
#define IN_RANGE(n, x, y) (((n) >= (x)) && ((n) <= (y)))
/*
* A macro implementing a ceiling function for integer divides.
*/
/*
* These defines should move into a kernel header file eventually
* and pcfs_mount may want to refuse to mount FAT32's that aren't "clean"
*
* If Windows shuts down properly it sets the fourth bit of the 8th
* and final reserved byte at the start of the FAT.
*/
/*
* Define some special logical drives we use.
*/
/*
* Function prototypes
*/
extern void header_for_dump(void);
extern void missing_arg(char *option);
extern void dump_bytes(uchar_t *b, int n);
extern void usage(void);
extern int yes(void);
/*
* The assumption here is that _BIG_ENDIAN implies sparc, and
* so in addition to swapping bytes we also have to construct
* packed structures by hand to avoid bus errors due to improperly
* aligned pointers.
*/
#ifdef _BIG_ENDIAN
#endif /* _BIG_ENDIAN */
#ifdef __cplusplus
}
#endif
#endif /* _PCFS_COMMON_H */