bitmap.h revision 20253
120253Sjoerg/*- 220253Sjoerg * Copyright (c) 1996 by David L. Nugent <davidn@blaze.net.au>. 320253Sjoerg * All rights reserved. 420253Sjoerg * 520253Sjoerg * Redistribution and use in source and binary forms, with or without 620253Sjoerg * modification, are permitted provided that the following conditions 720253Sjoerg * are met: 820253Sjoerg * 1. Redistributions of source code must retain the above copyright 920253Sjoerg * notice, this list of conditions and the following disclaimer as 1020253Sjoerg * the first lines of this file unmodified. 1120253Sjoerg * 2. Redistributions in binary form must reproduce the above copyright 1220253Sjoerg * notice, this list of conditions and the following disclaimer in the 1320253Sjoerg * documentation and/or other materials provided with the distribution. 1420253Sjoerg * 3. All advertising materials mentioning features or use of this software 1520253Sjoerg * must display the following acknowledgement: 1620253Sjoerg * This product includes software developed by David L. Nugent. 1720253Sjoerg * 4. The name of the author may not be used to endorse or promote products 1820253Sjoerg * derived from this software without specific prior written permission. 1920253Sjoerg * 2020253Sjoerg * THIS SOFTWARE IS PROVIDED BY THE DAVID L. NUGENT ``AS IS'' AND 2120253Sjoerg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2220253Sjoerg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2320253Sjoerg * ARE DISCLAIMED. IN NO EVENT SHALL DAVID L. NUGENT BE LIABLE 2420253Sjoerg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2520253Sjoerg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2620253Sjoerg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2720253Sjoerg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2820253Sjoerg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2920253Sjoerg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3020253Sjoerg * SUCH DAMAGE. 3120253Sjoerg * 3220253Sjoerg * $Id$ 3320253Sjoerg */ 3420253Sjoerg 3520253Sjoerg#ifndef _BITMAP_H_ 3620253Sjoerg#define _BITMAP_H_ 3720253Sjoerg 3820253Sjoerg#include <sys/cdefs.h> 3920253Sjoerg 4020253Sjoergstruct bitmap 4120253Sjoerg{ 4220253Sjoerg int size; 4320253Sjoerg unsigned char *map; 4420253Sjoerg}; 4520253Sjoerg 4620253Sjoerg__BEGIN_DECLS 4720253Sjoergstruct bitmap bm_alloc __P((int size)); 4820253Sjoergvoid bm_dealloc __P((struct bitmap * bm)); 4920253Sjoergvoid bm_setbit __P((struct bitmap * bm, int pos)); 5020253Sjoergvoid bm_clrbit __P((struct bitmap * bm, int pos)); 5120253Sjoergint bm_isset __P((struct bitmap * bm, int pos)); 5220253Sjoergint bm_firstunset __P((struct bitmap * bm)); 5320253Sjoergint bm_lastset __P((struct bitmap * bm)); 5420253Sjoerg__END_DECLS 5520253Sjoerg 5620253Sjoerg#endif /* !_BITMAP_H */ 57