aboutsummaryrefslogtreecommitdiffstats
path: root/doc/api-documentation/html/sysdata_8h-source.html
blob: 62f4c93a1ef2db48a80e5b279ec32356527e250d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>sysdata.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>sysdata.h</h1><div class="fragment"><pre>00001 <font class="preprocessor">#ifndef SIZEDTYPES_H</font>
00002 <font class="preprocessor"></font><font class="preprocessor">#define SIZEDTYPES_H</font>
00003 <font class="preprocessor"></font><font class="comment">/*</font>
00004 <font class="comment"> * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the</font>
00005 <font class="comment"> * header files exported to user space</font>
00006 <font class="comment"> */</font>
00007 <font class="preprocessor">#ifdef USE_AUTOTOOLS</font>
00008 <font class="preprocessor"></font><font class="preprocessor">#include "config.h"</font>
00009 <font class="preprocessor">#endif</font>
00010 <font class="preprocessor"></font>
00011 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">char</font> __s8;
00012 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> __u8;
00013 
00014 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">short</font> __s16;
00015 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font> __u16;
00016 
00017 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">int</font> __s32;
00018 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> __u32;
00019 
00020 <font class="preprocessor">#if defined(__GNUC__) &amp;&amp; !defined(__STRICT_ANSI__)</font>
00021 <font class="preprocessor"></font><font class="comment">//typedef __signed__ long long __s64;</font>
00022 <font class="comment">//typedef unsigned long long __u64;</font>
00023 <font class="preprocessor">#endif</font>
00024 <font class="preprocessor"></font>
00025 
00026 <font class="preprocessor">#define __swap16(x) \</font>
00027 <font class="preprocessor">        ((__u16)( \</font>
00028 <font class="preprocessor">                (((__u16)(x) &amp; (__u16)0x00ffU) &lt;&lt; 8) | \</font>
00029 <font class="preprocessor">                (((__u16)(x) &amp; (__u16)0xff00U) &gt;&gt; 8) ))</font>
00030 <font class="preprocessor"></font>
00031                 
00032 <font class="preprocessor">#define __swap32(x) \</font>
00033 <font class="preprocessor">        ((__u32)( \</font>
00034 <font class="preprocessor">                (((__u32)(x) &amp; (__u32)0x000000ffUL) &lt;&lt; 24) | \</font>
00035 <font class="preprocessor">                (((__u32)(x) &amp; (__u32)0x0000ff00UL) &lt;&lt;  8) | \</font>
00036 <font class="preprocessor">                (((__u32)(x) &amp; (__u32)0x00ff0000UL) &gt;&gt;  8) | \</font>
00037 <font class="preprocessor">                (((__u32)(x) &amp; (__u32)0xff000000UL) &gt;&gt; 24) ))</font>
00038 <font class="preprocessor"></font>
00039                 
00040 <font class="preprocessor">#define __swap64(x) \</font>
00041 <font class="preprocessor">        ((__u64)( \</font>
00042 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x00000000000000ffULL) &lt;&lt; 56) | \</font>
00043 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x000000000000ff00ULL) &lt;&lt; 40) | \</font>
00044 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x0000000000ff0000ULL) &lt;&lt; 24) | \</font>
00045 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x00000000ff000000ULL) &lt;&lt;  8) | \</font>
00046 <font class="preprocessor">                   (__u64)(((__u64)(x) &amp; (__u64)0x000000ff00000000ULL) &gt;&gt;  8) | \</font>
00047 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x0000ff0000000000ULL) &gt;&gt; 24) | \</font>
00048 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0x00ff000000000000ULL) &gt;&gt; 40) | \</font>
00049 <font class="preprocessor">                (__u64)(((__u64)(x) &amp; (__u64)0xff00000000000000ULL) &gt;&gt; 56) ))</font>
00050 <font class="preprocessor"></font>                
00051 
00052 
00053 
00054 <font class="preprocessor">#ifndef WORDS_BIGENDIAN</font>
00055 <font class="preprocessor"></font>
00056 <font class="preprocessor">#define swordtoarch16(x) (x)</font>
00057 <font class="preprocessor"></font><font class="preprocessor">#define swordtoarch32(x) (x)</font>
00058 <font class="preprocessor"></font><font class="preprocessor">#define swordtoarch64(x) (x)</font>
00059 <font class="preprocessor"></font><font class="preprocessor">#define archtosword16(x) (x)</font>
00060 <font class="preprocessor"></font><font class="preprocessor">#define archtosword32(x) (x)</font>
00061 <font class="preprocessor"></font><font class="preprocessor">#define archtosword64(x) (x)</font>
00062 <font class="preprocessor"></font>
00063 <font class="preprocessor">#else </font>
00064 <font class="preprocessor"></font>
00065 <font class="preprocessor">#define swordtoarch16(x) __swap16(x)</font>
00066 <font class="preprocessor"></font><font class="preprocessor">#define swordtoarch32(x) __swap32(x)</font>
00067 <font class="preprocessor"></font><font class="preprocessor">#define swordtoarch64(x) __swap64(x)</font>
00068 <font class="preprocessor"></font><font class="preprocessor">#define archtosword16(x) __swap16(x)</font>
00069 <font class="preprocessor"></font><font class="preprocessor">#define archtosword32(x) __swap32(x)</font>
00070 <font class="preprocessor"></font><font class="preprocessor">#define archtosword64(x) __swap64(x)</font>
00071 <font class="preprocessor"></font>
00072 
00073 <font class="preprocessor">#endif</font>
00074 <font class="preprocessor"></font>
00075 
00076 <font class="preprocessor">#endif</font>
</pre></div><hr><address align="right"><small>Generated on Thu Jun 20 22:13:00 2002 for The Sword Project by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>