mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 17:56:16 +00:00
111 lines
21 KiB
HTML
111 lines
21 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Dash Core: src/compat.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(initResizable);
|
|
/* @license-end */</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Dash Core
|
|
 <span id="projectnumber">0.12.2.1</span>
|
|
</div>
|
|
<div id="projectbrief">P2P Digital Currency</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('compat_8h_source.html','');});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">compat.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="compat_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Copyright (c) 2009-2010 Satoshi Nakamoto</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Copyright (c) 2009-2015 The Bitcoin Core developers</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// Distributed under the MIT software license, see the accompanying</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// file COPYING or http://www.opensource.org/licenses/mit-license.php.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#ifndef BITCOIN_COMPAT_H</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#define BITCOIN_COMPAT_H</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#if defined(HAVE_CONFIG_H)</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="dash-config_8h.html">config/dash-config.h</a>"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#ifdef WIN32</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#ifdef _WIN32_WINNT</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#undef _WIN32_WINNT</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#define _WIN32_WINNT 0x0501</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef WIN32_LEAN_AND_MEAN</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define WIN32_LEAN_AND_MEAN 1</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#ifndef NOMINMAX</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#define NOMINMAX</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifdef FD_SETSIZE</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#undef FD_SETSIZE // prevent redefinition compiler warning</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#define FD_SETSIZE 1024 // max number of fds in fd_set</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <winsock2.h></span> <span class="comment">// Must be included before mswsock.h and windows.h</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <mswsock.h></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <windows.h></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <ws2tcpip.h></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <sys/fcntl.h></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include <sys/mman.h></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include <sys/socket.h></span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#include <sys/types.h></span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#include <net/if.h></span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#include <netinet/in.h></span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#include <netinet/tcp.h></span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#include <arpa/inet.h></span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#include <ifaddrs.h></span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#include <limits.h></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include <netdb.h></span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#include <unistd.h></span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#ifdef WIN32</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#define MSG_DONTWAIT 0</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="compat_8h.html#a26ef1173e2f2c0d3db27eca28397d723"> 52</a></span> <span class="keyword">typedef</span> u_int <a class="code" href="compat_8h.html#a26ef1173e2f2c0d3db27eca28397d723">SOCKET</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#include "errno.h"</span></div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="compat_8h.html#a6d24fe3ab2906c21c373505ca244f90b"> 54</a></span> <span class="preprocessor">#define WSAGetLastError() errno</span></div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="compat_8h.html#a4e535522ca96ce5a8c0934b424f5ee85"> 55</a></span> <span class="preprocessor">#define WSAEINVAL EINVAL</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="compat_8h.html#a10fefe81d89fa6e5e5d9a2aca151fe70"> 56</a></span> <span class="preprocessor">#define WSAEALREADY EALREADY</span></div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="compat_8h.html#a4ba23242bee4784b72a0a170e2f975a0"> 57</a></span> <span class="preprocessor">#define WSAEWOULDBLOCK EWOULDBLOCK</span></div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="compat_8h.html#a7ce1c171e08d68442124bf6189f8aec5"> 58</a></span> <span class="preprocessor">#define WSAEMSGSIZE EMSGSIZE</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="compat_8h.html#aef81890a7d46cb9dda85df9b96cba6b1"> 59</a></span> <span class="preprocessor">#define WSAEINTR EINTR</span></div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="compat_8h.html#ada8711ffab59910a2732cfa4b7c24e29"> 60</a></span> <span class="preprocessor">#define WSAEINPROGRESS EINPROGRESS</span></div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="compat_8h.html#ae57d56be40e06a6148c41bb9c1f66eb6"> 61</a></span> <span class="preprocessor">#define WSAEADDRINUSE EADDRINUSE</span></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="compat_8h.html#a56af87338d51ad86415f2e23cae43376"> 62</a></span> <span class="preprocessor">#define WSAENOTSOCK EBADF</span></div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="compat_8h.html#a26769957ec1a2beaf223f33b66ee64ab"> 63</a></span> <span class="preprocessor">#define INVALID_SOCKET (SOCKET)(~0)</span></div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="compat_8h.html#a633b0396ff93d336a088412a190a5072"> 64</a></span> <span class="preprocessor">#define SOCKET_ERROR -1</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor">#ifdef WIN32</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#ifndef S_IRUSR</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor">#define S_IRUSR 0400</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor">#define S_IWUSR 0200</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="compat_8h.html#ab99ded389af74001a6298fc9e44e74e5"> 73</a></span> <span class="preprocessor">#define MAX_PATH 1024</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL)</span></div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="compat_8h.html#a9f55d0e90dc8cc6b2287312435cdde48"> 78</a></span> <span class="preprocessor">#define MSG_NOSIGNAL 0</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="preprocessor">#ifndef WIN32</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// PRIO_MAX is not defined on Solaris</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="preprocessor">#ifndef PRIO_MAX</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="compat_8h.html#a66190d2aecfafef957fa492ce8a8c7f0"> 84</a></span> <span class="preprocessor">#define PRIO_MAX 20</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="compat_8h.html#a59ca83deecce4e6c8b6139e7eb2870b4"> 86</a></span> <span class="preprocessor">#define THREAD_PRIORITY_LOWEST PRIO_MAX</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="compat_8h.html#aff5dd15d0754df75650eb9c3bfa5f86f"> 87</a></span> <span class="preprocessor">#define THREAD_PRIORITY_BELOW_NORMAL 2</span></div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="compat_8h.html#af05a5c044382ba6895bcaad26325a693"> 88</a></span> <span class="preprocessor">#define THREAD_PRIORITY_NORMAL 0</span></div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="compat_8h.html#aa38e29b911337a6e5c70282f136473fa"> 89</a></span> <span class="preprocessor">#define THREAD_PRIORITY_ABOVE_NORMAL (-2)</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#if HAVE_DECL_STRNLEN == 0</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="keywordtype">size_t</span> <a class="code" href="compat_8h.html#a704976ad1d3be55ba3f6431c77ddf5f7">strnlen</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *start, <span class="keywordtype">size_t</span> max_len);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="preprocessor">#endif // HAVE_DECL_STRNLEN</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="compat_8h.html#a6bc22ed56c6264c63610e14d03a73423"> 96</a></span> <span class="keywordtype">bool</span> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="compat_8h.html#a6bc22ed56c6264c63610e14d03a73423">IsSelectableSocket</a>(<a class="code" href="compat_8h.html#a26ef1173e2f2c0d3db27eca28397d723">SOCKET</a> s) {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="preprocessor">#ifdef WIN32</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">return</span> (s < FD_SETSIZE);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="preprocessor">#endif // BITCOIN_COMPAT_H</span></div><div class="ttc" id="compat_8h_html_a26ef1173e2f2c0d3db27eca28397d723"><div class="ttname"><a href="compat_8h.html#a26ef1173e2f2c0d3db27eca28397d723">SOCKET</a></div><div class="ttdeci">u_int SOCKET</div><div class="ttdef"><b>Definition:</b> <a href="compat_8h_source.html#l00052">compat.h:52</a></div></div>
|
|
<div class="ttc" id="compat_8h_html_a6bc22ed56c6264c63610e14d03a73423"><div class="ttname"><a href="compat_8h.html#a6bc22ed56c6264c63610e14d03a73423">IsSelectableSocket</a></div><div class="ttdeci">static bool IsSelectableSocket(SOCKET s)</div><div class="ttdef"><b>Definition:</b> <a href="compat_8h_source.html#l00096">compat.h:96</a></div></div>
|
|
<div class="ttc" id="dash-config_8h_html"><div class="ttname"><a href="dash-config_8h.html">dash-config.h</a></div></div>
|
|
<div class="ttc" id="compat_8h_html_a704976ad1d3be55ba3f6431c77ddf5f7"><div class="ttname"><a href="compat_8h.html#a704976ad1d3be55ba3f6431c77ddf5f7">strnlen</a></div><div class="ttdeci">size_t strnlen(const char *start, size_t max_len)</div><div class="ttdef"><b>Definition:</b> <a href="strnlen_8cpp_source.html#l00012">strnlen.cpp:12</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="compat_8h.html">compat.h</a></li>
|
|
<li class="footer">Generated on Thu Dec 14 2017 13:15:02 for Dash Core by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|