You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

misc_8h_source.html 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.6"/>
  7. <title>The Netsukuku Project: src/misc.h Source File</title>
  8. <link href="../../tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="../../jquery.js"></script>
  10. <script type="text/javascript" src="../../dynsections.js"></script>
  11. <link href="../../navtree.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="../../resize.js"></script>
  13. <script type="text/javascript" src="../../navtree.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(initResizable);
  16. $(window).load(resizeHeight);
  17. </script>
  18. <link href="../../search/search.css" rel="stylesheet" type="text/css"/>
  19. <script type="text/javascript" src="../../search/search.js"></script>
  20. <script type="text/javascript">
  21. $(document).ready(function() { searchBox.OnSelectItem(0); });
  22. </script>
  23. <link href="../../doxygen.css" rel="stylesheet" type="text/css" />
  24. </head>
  25. <body>
  26. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  27. <div id="titlearea">
  28. <table cellspacing="0" cellpadding="0">
  29. <tbody>
  30. <tr style="height: 56px;">
  31. <td id="projectlogo"><img alt="Logo" src="../../Logo_netsukuku.jpg"/></td>
  32. <td style="padding-left: 0.5em;">
  33. <div id="projectname">The Netsukuku Project
  34. &#160;<span id="projectnumber">0.0.9</span>
  35. </div>
  36. <div id="projectbrief">An Alternative routing method</div>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. <!-- end header part -->
  43. <!-- Generated by Doxygen 1.8.6 -->
  44. <script type="text/javascript">
  45. var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
  46. </script>
  47. <div id="navrow1" class="tabs">
  48. <ul class="tablist">
  49. <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
  50. <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
  51. <li class="current"><a href="../../files.html"><span>Files</span></a></li>
  52. <li>
  53. <div id="MSearchBox" class="MSearchBoxInactive">
  54. <span class="left">
  55. <img id="MSearchSelect" src="../../search/mag_sel.png"
  56. onmouseover="return searchBox.OnSearchSelectShow()"
  57. onmouseout="return searchBox.OnSearchSelectHide()"
  58. alt=""/>
  59. <input type="text" id="MSearchField" value="Search" accesskey="S"
  60. onfocus="searchBox.OnSearchFieldFocus(true)"
  61. onblur="searchBox.OnSearchFieldFocus(false)"
  62. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  63. </span><span class="right">
  64. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
  65. </span>
  66. </div>
  67. </li>
  68. </ul>
  69. </div>
  70. <div id="navrow2" class="tabs2">
  71. <ul class="tablist">
  72. <li><a href="../../files.html"><span>File&#160;List</span></a></li>
  73. <li><a href="../../globals.html"><span>Globals</span></a></li>
  74. </ul>
  75. </div>
  76. </div><!-- top -->
  77. <div id="side-nav" class="ui-resizable side-nav-resizable">
  78. <div id="nav-tree">
  79. <div id="nav-tree-contents">
  80. <div id="nav-sync" class="sync"></div>
  81. </div>
  82. </div>
  83. <div id="splitbar" style="-moz-user-select:none;"
  84. class="ui-resizable-handle">
  85. </div>
  86. </div>
  87. <script type="text/javascript">
  88. $(document).ready(function(){initNavTree('d4/d08/misc_8h_source.html','../../');});
  89. </script>
  90. <div id="doc-content">
  91. <!-- window showing the filter options -->
  92. <div id="MSearchSelectWindow"
  93. onmouseover="return searchBox.OnSearchSelectShow()"
  94. onmouseout="return searchBox.OnSearchSelectHide()"
  95. onkeydown="return searchBox.OnSearchSelectKey(event)">
  96. <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>
  97. <!-- iframe showing the search results (closed by default) -->
  98. <div id="MSearchResultsWindow">
  99. <iframe src="javascript:void(0)" frameborder="0"
  100. name="MSearchResults" id="MSearchResults">
  101. </iframe>
  102. </div>
  103. <div class="header">
  104. <div class="headertitle">
  105. <div class="title">misc.h</div> </div>
  106. </div><!--header-->
  107. <div class="contents">
  108. <a href="../../d4/d08/misc_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>&#160;<span class="comment">/* This file is part of Netsukuku</span></div>
  109. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * (c) Copyright 2004 Andrea Lo Pumo aka AlpT &lt;alpt@freaknet.org&gt;</span></div>
  110. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
  111. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This source code is free software; you can redistribute it and/or</span></div>
  112. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * modify it under the terms of the GNU General Public License as published </span></div>
  113. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * by the Free Software Foundation; either version 2 of the License,</span></div>
  114. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * or (at your option) any later version.</span></div>
  115. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div>
  116. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * This source code is distributed in the hope that it will be useful,</span></div>
  117. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
  118. <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></div>
  119. <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Please refer to the GNU Public License for more details.</span></div>
  120. <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
  121. <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU Public License along with</span></div>
  122. <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * this source code; if not, write to:</span></div>
  123. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span></div>
  124. <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div>
  125. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
  126. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef MISC_H</span></div>
  127. <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define MISC_H</span></div>
  128. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
  129. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment">/*</span></div>
  130. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment"> * NMEMB: returns the number of members of the `x&#39; array</span></div>
  131. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> */</span></div>
  132. <div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a1aaef027c2540c4b3848ab5603c97adf"> 25</a></span>&#160;<span class="preprocessor">#define NMEMB(x) (sizeof((x))/sizeof(typeof((x)[0])))</span></div>
  133. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
  134. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment">/* </span></div>
  135. <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment"> * MILLISEC: converts a timeval struct to a int. The time will be returned in</span></div>
  136. <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment"> * milliseconds.</span></div>
  137. <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment"> */</span></div>
  138. <div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a196a8d532345b158a150af01f196c242"> 31</a></span>&#160;<span class="preprocessor">#define MILLISEC(x) (((x).tv_sec*1000)+((x).tv_usec/1000))</span></div>
  139. <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
  140. <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/*</span></div>
  141. <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment"> * MILLISEC_TO_TV: Converts `x&#39;, which is an int into `t&#39;, a timeval struct</span></div>
  142. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="comment"> */</span></div>
  143. <div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#aa911c93eee2bd5b1312317ba2d75af35"> 36</a></span>&#160;<span class="preprocessor">#define MILLISEC_TO_TV(x,t) \</span></div>
  144. <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">do{ \</span></div>
  145. <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor"> (t).tv_sec=(x)/1000; \</span></div>
  146. <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor"> (t).tv_usec=((x) - ((x)/1000)*1000)*1000; \</span></div>
  147. <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">}while(0)</span></div>
  148. <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div>
  149. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment">/* </span></div>
  150. <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment"> * Bit map related macros. </span></div>
  151. <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment"> */</span></div>
  152. <div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a57ad79bbf1da2778f9352732771339b9"> 45</a></span>&#160;<span class="preprocessor">#define SET_BIT(a,i) ((a)[(i)/CHAR_BIT] |= 1&lt;&lt;((i)%CHAR_BIT))</span></div>
  153. <div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a3dddc03c8e6df49ea7615405cc1faf4f"> 46</a></span>&#160;<span class="preprocessor">#define CLR_BIT(a,i) ((a)[(i)/CHAR_BIT] &amp;= ~(1&lt;&lt;((i)%CHAR_BIT)))</span></div>
  154. <div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a5339af2eb805f73f3c78db430e03d719"> 47</a></span>&#160;<span class="preprocessor">#define TEST_BIT(a,i) (((a)[(i)/CHAR_BIT] &amp; (1&lt;&lt;((i)%CHAR_BIT))) ? 1 : 0)</span></div>
  155. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div>
  156. <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">/*</span></div>
  157. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment"> * FIND_PTR</span></div>
  158. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment"> *</span></div>
  159. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment"> * Given an array of pointers `a&#39; of `n&#39; members, it searches for a member</span></div>
  160. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment"> * equal to the pointer `p&#39;. If it is found its position is returned,</span></div>
  161. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment"> * otherwise -1 is the value returned.</span></div>
  162. <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment"> */</span></div>
  163. <div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#aaf9df6e3c9d68033ee6162c4738e3ee1"> 56</a></span>&#160;<span class="preprocessor">#define FIND_PTR(p, a, n) \</span></div>
  164. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor">({ \</span></div>
  165. <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"> int _i, _ret; \</span></div>
  166. <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"> \</span></div>
  167. <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="preprocessor"> for(_i=0, _ret=-1; _i&lt;(n); _i++) \</span></div>
  168. <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor"> if((a)[_i] == (p)) { \</span></div>
  169. <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"> _ret=_i; \</span></div>
  170. <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"> break; \</span></div>
  171. <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"> } \</span></div>
  172. <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor"> _ret; \</span></div>
  173. <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor">})</span></div>
  174. <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div>
  175. <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment">/*</span></div>
  176. <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="comment"> * _return</span></div>
  177. <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="comment"> *</span></div>
  178. <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="comment"> * It is used in this case:</span></div>
  179. <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment"> * condition &amp;&amp; _return (ret);</span></div>
  180. <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="comment"> * Since it is not possible to use the standard return in that case, we trick</span></div>
  181. <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment"> * gcc.</span></div>
  182. <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment"> */</span></div>
  183. <div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="../../d4/d08/misc_8h.html#a8449f7a49a9aac590496ca70bfc11e55"> 76</a></span>&#160;<span class="preprocessor">#define _return(x) ({return (x); (x);})</span></div>
  184. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div>
  185. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
  186. <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment">/*\</span></div>
  187. <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment"> * * * Functions declaration * *</span></div>
  188. <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment">\*/</span></div>
  189. <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="keywordtype">char</span> <a class="code" href="../../d4/d08/misc_8h.html#ad1aea1bae314b44e08b53a5b5bf30394">xor_int</a>(<span class="keywordtype">int</span> i);</div>
  190. <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
  191. <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#acb6548d316f7cd3f28e77c2bd4eb3e33">swap_array</a>(<span class="keywordtype">int</span> nmemb, <span class="keywordtype">size_t</span> nmemb_sz, <span class="keywordtype">void</span> *src, <span class="keywordtype">void</span> *dst);</div>
  192. <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#a7b5a2df1e2b36c954653fd3e786a5405">swap_ints</a>(<span class="keywordtype">int</span> nmemb, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *y) ;</div>
  193. <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#a98da58b707cfc9acf75f8105a3508b89">swap_shorts</a>(<span class="keywordtype">int</span> nmemb, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> *x, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> *y);</div>
  194. <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div>
  195. <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="../../d4/d08/misc_8h.html#af7f747ea1b353be8609df593dc0a629a">rand_range</a>(<span class="keywordtype">int</span> _min, <span class="keywordtype">int</span> _max);</div>
  196. <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#a22bf64b8d655a21a09fc4a5bca7ddd2b">xsrand</a>(<span class="keywordtype">void</span>);</div>
  197. <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
  198. <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="keywordtype">char</span> *<a class="code" href="../../d4/d08/misc_8h.html#ae13480d8227e14c4ea764297d170d39c">last_token</a>(<span class="keywordtype">char</span> *<span class="keywordtype">string</span>, <span class="keywordtype">char</span> tok);</div>
  199. <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#a1b81740c73bef5d3a6c69149d2c66378">strip_char</a>(<span class="keywordtype">char</span> *<span class="keywordtype">string</span>, <span class="keywordtype">char</span> char_to_strip);</div>
  200. <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="keywordtype">char</span> **<a class="code" href="../../d4/d08/misc_8h.html#afa3287a0852a49ffaeb854b3a43efeeb">split_string</a>(<span class="keywordtype">char</span> *str, <span class="keyword">const</span> <span class="keywordtype">char</span> *div_str, <span class="keywordtype">int</span> *substrings,</div>
  201. <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordtype">int</span> max_substrings, <span class="keywordtype">int</span> max_substring_sz);</div>
  202. <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
  203. <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; </div>
  204. <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d4/d08/misc_8h.html#aec37f76b7523c94cbf893daa3011d561">find_int</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> *ia, <span class="keywordtype">int</span> nmemb);</div>
  205. <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
  206. <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#acb47fac99a597857da46e5527954ed11">xtimer</a>(u_int secs, u_int steps, <span class="keywordtype">int</span> *counter);</div>
  207. <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
  208. <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d4/d08/misc_8h.html#a00e04a1d03772af465554e244ab28870">check_and_create_dir</a>(<span class="keywordtype">char</span> *dir);</div>
  209. <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d4/d08/misc_8h.html#a928b1da945af8413e422d1749058d33a">file_exist</a>(<span class="keywordtype">char</span> *filename);</div>
  210. <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d4/d08/misc_8h.html#a8acb91fe62e69e1e7be98dd06b2410a2">exec_root_script</a>(<span class="keywordtype">char</span> *script, <span class="keywordtype">char</span> *argv);</div>
  211. <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
  212. <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d4/d08/misc_8h.html#ad3dd98cde966bc68b438e72af3c68527">do_nothing</a>(<span class="keywordtype">void</span>);</div>
  213. <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
  214. <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/*MISC_H*/</span><span class="preprocessor"></span></div>
  215. <div class="ttc" id="misc_8h_html_a8acb91fe62e69e1e7be98dd06b2410a2"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a8acb91fe62e69e1e7be98dd06b2410a2">exec_root_script</a></div><div class="ttdeci">int exec_root_script(char *script, char *argv)</div><div class="ttdef"><b>Definition:</b> misc.c:346</div></div>
  216. <div class="ttc" id="misc_8h_html_af7f747ea1b353be8609df593dc0a629a"><div class="ttname"><a href="../../d4/d08/misc_8h.html#af7f747ea1b353be8609df593dc0a629a">rand_range</a></div><div class="ttdeci">int rand_range(int _min, int _max)</div><div class="ttdef"><b>Definition:</b> misc.c:101</div></div>
  217. <div class="ttc" id="misc_8h_html_ad3dd98cde966bc68b438e72af3c68527"><div class="ttname"><a href="../../d4/d08/misc_8h.html#ad3dd98cde966bc68b438e72af3c68527">do_nothing</a></div><div class="ttdeci">void do_nothing(void)</div><div class="ttdef"><b>Definition:</b> misc.c:388</div></div>
  218. <div class="ttc" id="misc_8h_html_a1b81740c73bef5d3a6c69149d2c66378"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a1b81740c73bef5d3a6c69149d2c66378">strip_char</a></div><div class="ttdeci">void strip_char(char *string, char char_to_strip)</div><div class="ttdef"><b>Definition:</b> misc.c:141</div></div>
  219. <div class="ttc" id="misc_8h_html_aec37f76b7523c94cbf893daa3011d561"><div class="ttname"><a href="../../d4/d08/misc_8h.html#aec37f76b7523c94cbf893daa3011d561">find_int</a></div><div class="ttdeci">int find_int(int x, int *ia, int nmemb)</div><div class="ttdef"><b>Definition:</b> misc.c:222</div></div>
  220. <div class="ttc" id="misc_8h_html_acb6548d316f7cd3f28e77c2bd4eb3e33"><div class="ttname"><a href="../../d4/d08/misc_8h.html#acb6548d316f7cd3f28e77c2bd4eb3e33">swap_array</a></div><div class="ttdeci">void swap_array(int nmemb, size_t nmemb_sz, void *src, void *dst)</div><div class="ttdef"><b>Definition:</b> misc.c:56</div></div>
  221. <div class="ttc" id="misc_8h_html_ae13480d8227e14c4ea764297d170d39c"><div class="ttname"><a href="../../d4/d08/misc_8h.html#ae13480d8227e14c4ea764297d170d39c">last_token</a></div><div class="ttdeci">char * last_token(char *string, char tok)</div><div class="ttdef"><b>Definition:</b> misc.c:130</div></div>
  222. <div class="ttc" id="misc_8h_html_acb47fac99a597857da46e5527954ed11"><div class="ttname"><a href="../../d4/d08/misc_8h.html#acb47fac99a597857da46e5527954ed11">xtimer</a></div><div class="ttdeci">void xtimer(u_int secs, u_int steps, int *counter)</div><div class="ttdef"><b>Definition:</b> misc.c:244</div></div>
  223. <div class="ttc" id="misc_8h_html_afa3287a0852a49ffaeb854b3a43efeeb"><div class="ttname"><a href="../../d4/d08/misc_8h.html#afa3287a0852a49ffaeb854b3a43efeeb">split_string</a></div><div class="ttdeci">char ** split_string(char *str, const char *div_str, int *substrings, int max_substrings, int max_substring_sz)</div><div class="ttdef"><b>Definition:</b> misc.c:167</div></div>
  224. <div class="ttc" id="misc_8h_html_a22bf64b8d655a21a09fc4a5bca7ddd2b"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a22bf64b8d655a21a09fc4a5bca7ddd2b">xsrand</a></div><div class="ttdeci">void xsrand(void)</div><div class="ttdef"><b>Definition:</b> misc.c:111</div></div>
  225. <div class="ttc" id="misc_8h_html_ad1aea1bae314b44e08b53a5b5bf30394"><div class="ttname"><a href="../../d4/d08/misc_8h.html#ad1aea1bae314b44e08b53a5b5bf30394">xor_int</a></div><div class="ttdeci">char xor_int(int i)</div><div class="ttdef"><b>Definition:</b> misc.c:34</div></div>
  226. <div class="ttc" id="misc_8h_html_a00e04a1d03772af465554e244ab28870"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a00e04a1d03772af465554e244ab28870">check_and_create_dir</a></div><div class="ttdeci">int check_and_create_dir(char *dir)</div><div class="ttdef"><b>Definition:</b> misc.c:295</div></div>
  227. <div class="ttc" id="misc_8h_html_a98da58b707cfc9acf75f8105a3508b89"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a98da58b707cfc9acf75f8105a3508b89">swap_shorts</a></div><div class="ttdeci">void swap_shorts(int nmemb, unsigned short *x, unsigned short *y)</div><div class="ttdef"><b>Definition:</b> misc.c:87</div></div>
  228. <div class="ttc" id="misc_8h_html_a7b5a2df1e2b36c954653fd3e786a5405"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a7b5a2df1e2b36c954653fd3e786a5405">swap_ints</a></div><div class="ttdeci">void swap_ints(int nmemb, unsigned int *x, unsigned int *y)</div><div class="ttdef"><b>Definition:</b> misc.c:82</div></div>
  229. <div class="ttc" id="misc_8h_html_a928b1da945af8413e422d1749058d33a"><div class="ttname"><a href="../../d4/d08/misc_8h.html#a928b1da945af8413e422d1749058d33a">file_exist</a></div><div class="ttdeci">int file_exist(char *filename)</div><div class="ttdef"><b>Definition:</b> misc.c:326</div></div>
  230. </div><!-- fragment --></div><!-- contents -->
  231. </div><!-- doc-content -->
  232. <!-- start footer part -->
  233. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  234. <ul>
  235. <li class="navelem"><a class="el" href="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="../../d4/d08/misc_8h.html">misc.h</a></li>
  236. <li class="footer">Generated on Wed Feb 19 2014 16:28:40 for The Netsukuku Project by
  237. <a href="http://www.doxygen.org/index.html">
  238. <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  239. </ul>
  240. </div>
  241. </body>
  242. </html>