efs.h 1.33 KB
/*
 * Common include file for filesystem tools.
 *
 * $Revision: 1.1.1.1 $
 */

#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>


#include <values.h>
#include <sys/fs/efs.h>
#include "efs_inode.h"

/*
 * Operators for manipulating the bitmap
 */
#define	bset(bp, b)	(*((bp) + ((b) >> 3)) |= 1 << ((b) & 7))
#define	bclr(bp, b)	(*((bp) + ((b) >> 3)) &= ~(1 << ((b) & 7)))
#define	btst(bp, b)	(*((bp) + ((b) >> 3)) & (1 << ((b) & 7)))

/*
 * Convenience stuff for easy thinking
 */
#define	bzero(buf, len)		memset((char *)(buf), 0, (len))
#define	bcopy(from, to, count)	memcpy((char *)(to), (char *)(from), (count))

extern int fs_fd;		/* descriptor filesystem is open on */
extern struct efs *fs;		/* pointer to superblock */
extern int error();		/* user provided error printer */
extern char *progname;		/* program running */
extern char *bitmap;		/* pointer to bitmap memory */

/* library exports */
extern struct efs_dinode *efs_iget();
extern void efs_iput();
extern void efs_mknod();
extern void efs_checksum();
extern void efs_extend();
extern void efs_write();
extern void efs_update();
extern ino_t efs_allocino();
extern void efs_bget();
extern void efs_bput();
extern daddr_t efs_bmap();
extern extent *efs_getextents();
extern void efs_enter();