/home/doxygen/libascend/compiler/bit.h

Go to the documentation of this file.
00001 /*
00002  *  Bit lists
00003  *  by Tom Epperly
00004  *  Version: $Revision: 1.7 $
00005  *  Version control file: $RCSfile: bit.h,v $
00006  *  Date last modified: $Date: 1997/09/08 18:07:32 $
00007  *  Last modified by: $Author: ballan $
00008  *
00009  *  This file is part of the Ascend Language Interpreter.
00010  *
00011  *  Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00012  *
00013  *  The Ascend Language Interpreter is free software; you can redistribute
00014  *  it and/or modify it under the terms of the GNU General Public License as
00015  *  published by the Free Software Foundation; either version 2 of the
00016  *  License, or (at your option) any later version.
00017  *
00018  *  The Ascend Language Interpreter is distributed in hope that it will be
00019  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  *  General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License
00024  *  along with the program; if not, write to the Free Software Foundation,
00025  *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
00026  *  COPYING.
00027  */
00028 
00042 #ifndef ASC_BIT_H
00043 #define ASC_BIT_H
00044 
00045 #include <utilities/ascConfig.h>
00046 
00052 struct BitList {
00053   unsigned long length;
00054 };
00055 
00056 extern struct BitList *CreateBList(unsigned long len);
00061 extern struct BitList *CreateFBList(unsigned long len);
00066 extern struct BitList *ExpandBList(struct BitList *bl, unsigned long len);
00074 extern struct BitList *ExpandFBList(struct BitList *bl, unsigned long len);
00082 extern void DestroyBList(struct BitList *bl);
00087 extern struct BitList *CopyBList(CONST struct BitList *bl);
00094 extern void OverwriteBList(CONST struct BitList *src, struct BitList *target);
00102 extern unsigned long BitListBytes(CONST struct BitList *bl);
00107 extern void SetBit(struct BitList *bl, unsigned long pos);
00112 extern void ClearBit(struct BitList *bl, unsigned long pos);
00117 extern void CondSetBit(struct BitList *bl, unsigned long pos, int cond);
00122 ASC_DLLSPEC int ReadBit(CONST struct BitList *bl, unsigned long pos);
00127 extern void IntersectBLists(struct BitList *bl1, CONST struct BitList *bl2);
00133 extern void UnionBLists(struct BitList *bl1, CONST struct BitList *bl2);
00139 #ifdef NDEBUG
00140 
00141 #define BLength(bl) ((bl)->length)
00142 #else
00143 
00144 #define BLength(bl) BLengthF(bl)
00145 #endif
00146 extern unsigned long BLengthF(CONST struct BitList *bl);
00151 ASC_DLLSPEC int BitListEmpty(CONST struct BitList *bl);
00156 extern int CompBList(struct BitList *b1, struct BitList *b2);
00161 extern unsigned long FirstNonZeroBit(CONST struct BitList *bl);
00167 /* @} */
00168 
00169 #endif  /* ASC_BIT_H */
00170 

Generated on Thu Jul 17 04:00:09 2008 for libascend by  doxygen 1.5.1