blob: 5e172118ab9212c98cb91d1dcb5782c06222cf13 (
plain) (
tree)
|
|
<!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.17 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
<hr><h1>sysdata.h</h1><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef SIZEDTYPES_H</span>
00002 <span class="preprocessor"></span><span class="preprocessor">#define SIZEDTYPES_H</span>
00003 <span class="preprocessor"></span><span class="comment">/*</span>
00004 <span class="comment"> * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the</span>
00005 <span class="comment"> * header files exported to user space</span>
00006 <span class="comment"> */</span>
00007 <span class="preprocessor">#ifdef USE_AUTOTOOLS</span>
00008 <span class="preprocessor"></span><span class="preprocessor">#include "config.h"</span>
00009 <span class="preprocessor">#endif</span>
00010 <span class="preprocessor"></span>
00011
00012 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">char</span> __s8;
00013 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> __u8;
00014
00015 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> __s16;
00016 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> __u16;
00017
00018 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span> __s32;
00019 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> __u32;
00020
00021 <span class="preprocessor">#if defined(__GNUC__) && !defined(__STRICT_ANSI__)</span>
00022 <span class="preprocessor"></span><span class="comment">//typedef __signed__ long long __s64;</span>
00023 <span class="comment">//typedef unsigned long long __u64;</span>
00024 <span class="preprocessor">#endif</span>
00025 <span class="preprocessor"></span>
00026
00027 <span class="preprocessor">#define __swap16(x) \</span>
00028 <span class="preprocessor"> ((__u16)( \</span>
00029 <span class="preprocessor"> (((__u16)(x) & (__u16)0x00ffU) << 8) | \</span>
00030 <span class="preprocessor"> (((__u16)(x) & (__u16)0xff00U) >> 8) ))</span>
00031 <span class="preprocessor"></span>
00032
00033 <span class="preprocessor">#define __swap32(x) \</span>
00034 <span class="preprocessor"> ((__u32)( \</span>
00035 <span class="preprocessor"> (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \</span>
00036 <span class="preprocessor"> (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \</span>
00037 <span class="preprocessor"> (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \</span>
00038 <span class="preprocessor"> (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))</span>
00039 <span class="preprocessor"></span>
00040
00041 <span class="preprocessor">#define __swap64(x) \</span>
00042 <span class="preprocessor"> ((__u64)( \</span>
00043 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \</span>
00044 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \</span>
00045 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \</span>
00046 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \</span>
00047 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \</span>
00048 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \</span>
00049 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \</span>
00050 <span class="preprocessor"> (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))</span>
00051 <span class="preprocessor"></span>
00052
00053
00054
00055 <span class="preprocessor">#ifndef WORDS_BIGENDIAN</span>
00056 <span class="preprocessor"></span>
00057 <span class="preprocessor">#define swordtoarch16(x) (x)</span>
00058 <span class="preprocessor"></span><span class="preprocessor">#define swordtoarch32(x) (x)</span>
00059 <span class="preprocessor"></span><span class="preprocessor">#define swordtoarch64(x) (x)</span>
00060 <span class="preprocessor"></span><span class="preprocessor">#define archtosword16(x) (x)</span>
00061 <span class="preprocessor"></span><span class="preprocessor">#define archtosword32(x) (x)</span>
00062 <span class="preprocessor"></span><span class="preprocessor">#define archtosword64(x) (x)</span>
00063 <span class="preprocessor"></span>
00064 <span class="preprocessor">#else </span>
00065 <span class="preprocessor"></span>
00066 <span class="preprocessor">#define swordtoarch16(x) __swap16(x)</span>
00067 <span class="preprocessor"></span><span class="preprocessor">#define swordtoarch32(x) __swap32(x)</span>
00068 <span class="preprocessor"></span><span class="preprocessor">#define swordtoarch64(x) __swap64(x)</span>
00069 <span class="preprocessor"></span><span class="preprocessor">#define archtosword16(x) __swap16(x)</span>
00070 <span class="preprocessor"></span><span class="preprocessor">#define archtosword32(x) __swap32(x)</span>
00071 <span class="preprocessor"></span><span class="preprocessor">#define archtosword64(x) __swap64(x)</span>
00072 <span class="preprocessor"></span>
00073
00074 <span class="preprocessor">#endif</span>
00075 <span class="preprocessor"></span>
00076
00077 <span class="preprocessor">#endif</span>
</pre></div><hr><address style="align: right;"><small>Generated on Thu Oct 31 12:11:28 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.17 </small></address>
</body>
</html>
|