1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/xhtml;charset=UTF-8"/>
5 <title>Luayats: src/rstp/bitmap.h Source File
</title>
6 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css"/>
7 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css"/>
10 <!-- Generated by Doxygen 1.6.1 -->
11 <div class=
"navigation" id=
"top">
14 <li><a href=
"index.html"><span>Main
Page
</span></a></li>
15 <li><a href=
"annotated.html"><span>Classes
</span></a></li>
16 <li class=
"current"><a href=
"files.html"><span>Files
</span></a></li>
21 <li><a href=
"files.html"><span>File
List
</span></a></li>
22 <li><a href=
"globals.html"><span>File
Members
</span></a></li>
25 <h1>src/rstp/bitmap.h
</h1><a href=
"bitmap_8h.html">Go to the documentation of this file.
</a><div class=
"fragment"><pre class=
"fragment"><a name=
"l00001"></a>00001 <span class=
"comment">/************************************************************************
</span>
26 <a name=
"l00002"></a>00002 <span class=
"comment"> * RSTP library - Rapid Spanning Tree (
802.1t,
802.1w)
</span>
27 <a name=
"l00003"></a>00003 <span class=
"comment"> * Copyright (C)
2001-
2003 Optical Access
</span>
28 <a name=
"l00004"></a>00004 <span class=
"comment"> * Author: Alex Rozin
</span>
29 <a name=
"l00005"></a>00005 <span class=
"comment"> *
</span>
30 <a name=
"l00006"></a>00006 <span class=
"comment"> * This file is part of RSTP library.
</span>
31 <a name=
"l00007"></a>00007 <span class=
"comment"> *
</span>
32 <a name=
"l00008"></a>00008 <span class=
"comment"> * RSTP library is free software; you can redistribute it and/or modify it
</span>
33 <a name=
"l00009"></a>00009 <span class=
"comment"> * under the terms of the GNU Lesser General Public License as published by the
</span>
34 <a name=
"l00010"></a>00010 <span class=
"comment"> * Free Software Foundation; version
2.1 </span>
35 <a name=
"l00011"></a>00011 <span class=
"comment"> *
</span>
36 <a name=
"l00012"></a>00012 <span class=
"comment"> * RSTP library is distributed in the hope that it will be useful, but
</span>
37 <a name=
"l00013"></a>00013 <span class=
"comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of
</span>
38 <a name=
"l00014"></a>00014 <span class=
"comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
</span>
39 <a name=
"l00015"></a>00015 <span class=
"comment"> * General Public License for more details.
</span>
40 <a name=
"l00016"></a>00016 <span class=
"comment"> *
</span>
41 <a name=
"l00017"></a>00017 <span class=
"comment"> * You should have received a copy of the GNU Lesser General Public License
</span>
42 <a name=
"l00018"></a>00018 <span class=
"comment"> * along with RSTP library; see the file COPYING. If not, write to the Free
</span>
43 <a name=
"l00019"></a>00019 <span class=
"comment"> * Software Foundation, Inc.,
59 Temple Place - Suite
330, Boston, MA
</span>
44 <a name=
"l00020"></a>00020 <span class=
"comment"> *
02111-
1307, USA.
</span>
45 <a name=
"l00021"></a>00021 <span class=
"comment"> **********************************************************************/
</span>
46 <a name=
"l00022"></a>00022
47 <a name=
"l00023"></a>00023 <span class=
"preprocessor">#ifndef __BITMAP_H
</span>
48 <a name=
"l00024"></a>00024 <span class=
"preprocessor"></span><span class=
"preprocessor">#define __BITMAP_H
</span>
49 <a name=
"l00025"></a>00025 <span class=
"preprocessor"></span>
50 <a name=
"l00026"></a><a class=
"code" href=
"bitmap_8h.html#a00f8a86f3bc21109096ba9da4712ac13">00026</a> <span class=
"preprocessor">#define NUMBER_OF_PORTS
4</span>
51 <a name=
"l00027"></a>00027 <span class=
"preprocessor"></span>
52 <a name=
"l00028"></a><a class=
"code" href=
"structtagBITMAP.html">00028</a> <span class=
"keyword">typedef
</span> <span class=
"keyword">struct
</span><a class=
"code" href=
"structtagBITMAP.html">tagBITMAP
</a>
53 <a name=
"l00029"></a>00029 {
54 <a name=
"l00030"></a><a class=
"code" href=
"structtagBITMAP.html#a88f90e3dcbbe609f69a723f6811c99df">00030</a> <span class=
"keywordtype">unsigned
</span> <span class=
"keywordtype">long
</span> <a class=
"code" href=
"structtagBITMAP.html#a88f90e3dcbbe609f69a723f6811c99df">part0
</a>;
<span class=
"comment">/* Least Significant part */
</span>
55 <a name=
"l00031"></a>00031 }
<a class=
"code" href=
"structtagBITMAP.html">BITMAP_T
</a>;
56 <a name=
"l00032"></a>00032
57 <a name=
"l00033"></a><a class=
"code" href=
"bitmap_8h.html#ab29422ea15b829a539b64c5b655415b9">00033</a> <span class=
"preprocessor">#define BitmapClear(BitmapPtr) \
</span>
58 <a name=
"l00034"></a>00034 <span class=
"preprocessor"> { (BitmapPtr)-
>part0 =
0; }
</span>
59 <a name=
"l00035"></a>00035 <span class=
"preprocessor"></span>
60 <a name=
"l00036"></a><a class=
"code" href=
"bitmap_8h.html#a059b289e74985b853c502af3fc7787d3">00036</a> <span class=
"preprocessor">#define BitmapSetAllBits(BitmapPtr) \
</span>
61 <a name=
"l00037"></a>00037 <span class=
"preprocessor"> { (BitmapPtr)-
>part0 =
0xF; }
</span>
62 <a name=
"l00038"></a>00038 <span class=
"preprocessor"></span>
63 <a name=
"l00039"></a><a class=
"code" href=
"bitmap_8h.html#a6aaa5c8a51dbc220e4f9ccf57b31d1dd">00039</a> <span class=
"preprocessor">#define BitmapClearBits(BitmapPtr,BitmapBitsPtr) \
</span>
64 <a name=
"l00040"></a>00040 <span class=
"preprocessor"> { (BitmapPtr)-
>part0
&= ~((BitmapBitsPtr)-
>part0); }
</span>
65 <a name=
"l00041"></a>00041 <span class=
"preprocessor"></span>
66 <a name=
"l00042"></a><a class=
"code" href=
"bitmap_8h.html#a77103ef2ed1c44f144cf11dd15af631d">00042</a> <span class=
"preprocessor">#define BitmapSetBits(BitmapPtr,BitmapBitsPtr) \
</span>
67 <a name=
"l00043"></a>00043 <span class=
"preprocessor"> { (BitmapPtr)-
>part0 |= ((BitmapBitsPtr)-
>part0); }
</span>
68 <a name=
"l00044"></a>00044 <span class=
"preprocessor"></span>
69 <a name=
"l00045"></a><a class=
"code" href=
"bitmap_8h.html#a40ce4019ab4b3cd7a86e03525501ec1b">00045</a> <span class=
"preprocessor">#define BitmapOr(ResultPtr,BitmapPtr1,BitmapPtr2) \
</span>
70 <a name=
"l00046"></a>00046 <span class=
"preprocessor"> { (ResultPtr)-
>part0 = (BitmapPtr1)-
>part0 | (BitmapPtr2)-
>part0; }
</span>
71 <a name=
"l00047"></a>00047 <span class=
"preprocessor"></span>
72 <a name=
"l00048"></a><a class=
"code" href=
"bitmap_8h.html#a01aec92d4bbb0c00eb593ec07399cc63">00048</a> <span class=
"preprocessor">#define BitmapAnd(ResultPtr,BitmapPtr1,BitmapPtr2) \
</span>
73 <a name=
"l00049"></a>00049 <span class=
"preprocessor"> { (ResultPtr)-
>part0 = (BitmapPtr1)-
>part0
& (BitmapPtr2)-
>part0; }
</span>
74 <a name=
"l00050"></a>00050 <span class=
"preprocessor"></span>
75 <a name=
"l00051"></a><a class=
"code" href=
"bitmap_8h.html#adad1c02885aa3c91f8e8b41b561971ff">00051</a> <span class=
"preprocessor">#define BitmapNot(ResultPtr,BitmapPtr) \
</span>
76 <a name=
"l00052"></a>00052 <span class=
"preprocessor"> { (ResultPtr)-
>part0 = ~((BitmapPtr)-
>part0); }
</span>
77 <a name=
"l00053"></a>00053 <span class=
"preprocessor"></span>
78 <a name=
"l00054"></a>00054
79 <a name=
"l00055"></a>00055 <span class=
"comment">/* Return zero if identical */
</span>
80 <a name=
"l00056"></a><a class=
"code" href=
"bitmap_8h.html#a59cf1a5da2d65084efc0d33641e72e37">00056</a> <span class=
"preprocessor">#define BitmapCmp(BitmapPtr1,BitmapPtr2) \
</span>
81 <a name=
"l00057"></a>00057 <span class=
"preprocessor"> ((BitmapPtr1)-
>part0 != (BitmapPtr2)-
>part0)
</span>
82 <a name=
"l00058"></a>00058 <span class=
"preprocessor"></span>
83 <a name=
"l00059"></a><a class=
"code" href=
"bitmap_8h.html#ad7ed0022f8c1f5084e1d038994119167">00059</a> <span class=
"preprocessor">#define BitmapIsZero(BitmapPtr) \
</span>
84 <a name=
"l00060"></a>00060 <span class=
"preprocessor"> (!(BitmapPtr)-
>part0)
</span>
85 <a name=
"l00061"></a>00061 <span class=
"preprocessor"></span>
86 <a name=
"l00062"></a><a class=
"code" href=
"bitmap_8h.html#ab5437394f6c1c3125327b927e5c4a6a6">00062</a> <span class=
"preprocessor">#define BitmapIsAllOnes(BitmapPtr) \
</span>
87 <a name=
"l00063"></a>00063 <span class=
"preprocessor"> ((BitmapPtr)-
>part0 ==
0xF)
</span>
88 <a name=
"l00064"></a>00064 <span class=
"preprocessor"></span>
89 <a name=
"l00065"></a><a class=
"code" href=
"bitmap_8h.html#ae9bacb64cc0c534bba780fe50a4dff42">00065</a> <span class=
"preprocessor">#define BitmapGetBit(BitmapPtr,Bit) \
</span>
90 <a name=
"l00066"></a>00066 <span class=
"preprocessor"> ((BitmapPtr)-
>part0
& (
1 << (Bit)))
</span>
91 <a name=
"l00067"></a>00067 <span class=
"preprocessor"></span>
92 <a name=
"l00068"></a>00068 <span class=
"comment">/* Bit range [
0 ..
63] */
</span>
93 <a name=
"l00069"></a><a class=
"code" href=
"bitmap_8h.html#ae9694ff688a38a0a9e47d79f02112175">00069</a> <span class=
"preprocessor">#define BitmapSetBit(BitmapPtr,Bit) \
</span>
94 <a name=
"l00070"></a>00070 <span class=
"preprocessor"> {(BitmapPtr)-
>part0 |= (
1 << (Bit)); }
</span>
95 <a name=
"l00071"></a>00071 <span class=
"preprocessor"></span>
96 <a name=
"l00072"></a><a class=
"code" href=
"bitmap_8h.html#a1db13c1a8ea7e0273b972a595ae16161">00072</a> <span class=
"preprocessor">#define BitmapClearBit(BitmapPtr,Bit) \
</span>
97 <a name=
"l00073"></a>00073 <span class=
"preprocessor"> (BitmapPtr)-
>part0
&= ~(
1 << (Bit));
</span>
98 <a name=
"l00074"></a>00074 <span class=
"preprocessor"></span>
99 <a name=
"l00075"></a><a class=
"code" href=
"bitmap_8h.html#aa464665b8782046e0c12bfb4c144a218">00075</a> <span class=
"preprocessor">#define BitmapCopy(BitmapDstPtr,BitmapSrcPtr) \
</span>
100 <a name=
"l00076"></a>00076 <span class=
"preprocessor"> { (BitmapDstPtr)-
>part0 = (BitmapSrcPtr)-
>part0; }
</span>
101 <a name=
"l00077"></a>00077 <span class=
"preprocessor"></span>
102 <a name=
"l00078"></a><a class=
"code" href=
"bitmap_8h.html#a1c7bb39c53e524e7011dcf66bdfa6346">00078</a> <span class=
"preprocessor">#define BitmapXor(ResultPtr,BitmapPtr1,BitmapPtr2) \
</span>
103 <a name=
"l00079"></a>00079 <span class=
"preprocessor"> { (ResultPtr)-
>part0 = (BitmapPtr1)-
>part0 ^ (BitmapPtr2)-
>part0; }
</span>
104 <a name=
"l00080"></a>00080 <span class=
"preprocessor"></span>
105 <a name=
"l00081"></a>00081 <span class=
"preprocessor">#endif
</span><span class=
"comment">/* __BITMAP_H */
</span>
106 <a name=
"l00082"></a>00082
108 <hr size=
"1"/><address style=
"text-align: right;"><small>Generated on Sun Feb
14 12:
31:
42 2010 for Luayats by
109 <a href=
"http://www.doxygen.org/index.html">
110 <img class=
"footer" src=
"doxygen.png" alt=
"doxygen"/></a> 1.6.1 </small></address>