This file is indexed.

/usr/share/doc/libclustalo-doc/api/html/util_8h_source.html is in libclustalo-doc 1.2.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
<!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.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Clustal Omega: src/clustal/util.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="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="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Clustal Omega
   &#160;<span id="projectnumber">1.2.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_078e8be2a200f8a2ce3af8fa572ccadf.html">clustal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">util.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="util_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">/*********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Clustal Omega - Multiple sequence alignment</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2010 University College Dublin</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Clustal-Omega is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * modify it under the terms of the GNU General Public License as</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * published by the Free Software Foundation; either version 2 of the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * License, or (at your option) any later version.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * This file is part of Clustal-Omega.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> ********************************************************************/</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *  RCS $Id: util.h 230 2011-04-09 15:37:50Z andreas $</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;limits.h&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;strings.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;stdarg.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef CLUSTALO_UTIL_H</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#define CLUSTALO_UTIL_H</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="util_8h.html#a6d14a9e26af7aad1cb9a4006155be401">   29</a></span>&#160;<span class="preprocessor">#define CKMALLOC(b) CkMalloc((b), __FUNCTION__, __LINE__)</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="util_8h.html#a368b61529c2c0bee75519b56256be5e7">   30</a></span>&#160;<span class="preprocessor">#define CKCALLOC(c, s) CkCalloc((c), (s), __FUNCTION__, __LINE__)</span></div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="util_8h.html#a85df19c6ad8d9c4938f58863f9917d4a">   31</a></span>&#160;<span class="preprocessor">#define CKREALLOC(p, b) CkRealloc((p), (b), __FUNCTION__, __LINE__)</span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="util_8h.html#a911d2d6bfb17f86eda7d4af941f58051">   32</a></span>&#160;<span class="preprocessor">#define CKFREE(b) ((b)=CkFree((b), __FUNCTION__, __LINE__))</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifndef MAX</span></div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="util_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">   35</a></span>&#160;<span class="preprocessor">#define MAX(a,b) ((a)&gt;(b)?(a):(b))</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#ifndef MIN</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="util_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">   38</a></span>&#160;<span class="preprocessor">#define MIN(a,b) ((a)&lt;(b)?(a):(b))</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">/* STR_EQ: strings are equal, case sensitive */</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="util_8h.html#a71195150f11cd64ab4de648124a47c1a">   42</a></span>&#160;<span class="preprocessor">#define STR_EQ(a,b)         (strcmp((a),(b)) == 0)</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/*  STR_NC_EQ: strings are equal, ignoring case */</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="util_8h.html#a9e6be8088ce9b69a28c20081cabf64a4">   44</a></span>&#160;<span class="preprocessor">#define STR_NC_EQ(a,b)      (strcasecmp((a),(b)) == 0)</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">/* type boolean and false and true defined in stdbool.h */</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#ifndef TRUE</span></div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="util_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">   49</a></span>&#160;<span class="preprocessor">#define TRUE true</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#ifndef FALSE</span></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="util_8h.html#aa93f0eb578d23995850d61f7d61c55c1">   52</a></span>&#160;<span class="preprocessor">#define FALSE false</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">/* clashes with hhalign</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">#define FAIL -1</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">#define OK 0</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">/* don&#39;t use the following directly; use macros provided above instead</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keywordtype">void</span> *<a class="code" href="util_8h.html#a5fc3d869ab98caf740b58539efef01bb">CkMalloc</a>(<span class="keywordtype">size_t</span> size, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">int</span> line);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keywordtype">void</span> *<a class="code" href="util_8h.html#a4a66f56360f9c91a4845bdf9c192e08a">CkCalloc</a>(<span class="keywordtype">size_t</span> count, <span class="keywordtype">size_t</span> size, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">int</span> line);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keywordtype">void</span> *<a class="code" href="util_8h.html#a14acb2efac545e46035708957463d9e2">CkRealloc</a>(<span class="keywordtype">void</span> *ptr, <span class="keywordtype">size_t</span> bytes, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">int</span> line);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keywordtype">void</span> *<a class="code" href="util_8h.html#abcad90d2861523f68945f04b7bf81752">CkFree</a>(<span class="keywordtype">void</span> *ptr, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">int</span> line);</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keywordtype">char</span> *<a class="code" href="util_8h.html#a4d6fde7b9604e0301c18f68b252db010">CkStrdup</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="keywordtype">void</span> <a class="code" href="util_8h.html#a3270ec7cb14ad135fe11e6d1712fcd4c">PermutationArray</a>(<span class="keywordtype">int</span> **array, <span class="keyword">const</span> <span class="keywordtype">int</span> len);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keywordtype">void</span> <a class="code" href="util_8h.html#aa5ee9504afc548239113fc564b3a735e">RandomUniqueIntArray</a>(<span class="keywordtype">int</span> *array, <span class="keyword">const</span> <span class="keywordtype">int</span> array_len, <span class="keyword">const</span> <span class="keywordtype">int</span> max_value);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keywordtype">int</span> <a class="code" href="util_8h.html#a5a87ce594ee9e2157ccdefee1273372c">IntCmp</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *a, <span class="keyword">const</span> <span class="keywordtype">void</span> *b);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="util_8h.html#a9543f691bc0adaaec4000d133809657a">FileIsWritable</a>(<span class="keywordtype">char</span> *pcFileName);</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keywordtype">void</span> <a class="code" href="util_8h.html#a85ba9f38ea0620e5202479103159297b">QSortAndTrackIndex</a>(<span class="keywordtype">int</span> *piSortedIndices, <span class="keywordtype">int</span> *piArrayToSort,</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">int</span> uArrayLen, <span class="keyword">const</span> <span class="keywordtype">char</span> cOrder, <span class="keyword">const</span> <span class="keywordtype">bool</span> bOverwriteArrayToSort);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="util_8h_html_abcad90d2861523f68945f04b7bf81752"><div class="ttname"><a href="util_8h.html#abcad90d2861523f68945f04b7bf81752">CkFree</a></div><div class="ttdeci">void * CkFree(void *ptr, const char *function, const int line)</div><div class="ttdoc">Frees memory. </div><div class="ttdef"><b>Definition:</b> util.c:180</div></div>
<div class="ttc" id="util_8h_html_a4d6fde7b9604e0301c18f68b252db010"><div class="ttname"><a href="util_8h.html#a4d6fde7b9604e0301c18f68b252db010">CkStrdup</a></div><div class="ttdeci">char * CkStrdup(const char *s)</div><div class="ttdoc">safe version of strdup </div><div class="ttdef"><b>Definition:</b> util.c:207</div></div>
<div class="ttc" id="util_8h_html_a5fc3d869ab98caf740b58539efef01bb"><div class="ttname"><a href="util_8h.html#a5fc3d869ab98caf740b58539efef01bb">CkMalloc</a></div><div class="ttdeci">void * CkMalloc(size_t size, const char *function, const int line)</div><div class="ttdoc">Allocates memory (malloc) </div><div class="ttdef"><b>Definition:</b> util.c:79</div></div>
<div class="ttc" id="util_8h_html_a14acb2efac545e46035708957463d9e2"><div class="ttname"><a href="util_8h.html#a14acb2efac545e46035708957463d9e2">CkRealloc</a></div><div class="ttdeci">void * CkRealloc(void *ptr, size_t bytes, const char *function, const int line)</div><div class="ttdoc">Reallocates memory. </div><div class="ttdef"><b>Definition:</b> util.c:148</div></div>
<div class="ttc" id="util_8h_html_a3270ec7cb14ad135fe11e6d1712fcd4c"><div class="ttname"><a href="util_8h.html#a3270ec7cb14ad135fe11e6d1712fcd4c">PermutationArray</a></div><div class="ttdeci">void PermutationArray(int **array, const int len)</div><div class="ttdoc">Creates an int array of size len with len-1 random but unique integers with values 0–len-1...</div><div class="ttdef"><b>Definition:</b> util.c:237</div></div>
<div class="ttc" id="util_8h_html_a85ba9f38ea0620e5202479103159297b"><div class="ttname"><a href="util_8h.html#a85ba9f38ea0620e5202479103159297b">QSortAndTrackIndex</a></div><div class="ttdeci">void QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort, const int uArrayLen, const char cOrder, const bool bOverwriteArrayToSort)</div><div class="ttdoc">Sort a given int array in ascending or descending order, while keeping track of the element order...</div><div class="ttdef"><b>Definition:</b> util.c:403</div></div>
<div class="ttc" id="util_8h_html_aa5ee9504afc548239113fc564b3a735e"><div class="ttname"><a href="util_8h.html#aa5ee9504afc548239113fc564b3a735e">RandomUniqueIntArray</a></div><div class="ttdeci">void RandomUniqueIntArray(int *array, const int array_len, const int max_value)</div><div class="ttdoc">Creates an array filled with random, but unique ints of given range. Implementation of the Floyd algo...</div><div class="ttdef"><b>Definition:</b> util.c:293</div></div>
<div class="ttc" id="util_8h_html_a5a87ce594ee9e2157ccdefee1273372c"><div class="ttname"><a href="util_8h.html#a5a87ce594ee9e2157ccdefee1273372c">IntCmp</a></div><div class="ttdeci">int IntCmp(const void *a, const void *b)</div><div class="ttdoc">int comparison function for qsort </div><div class="ttdef"><b>Definition:</b> util.c:329</div></div>
<div class="ttc" id="util_8h_html_a9543f691bc0adaaec4000d133809657a"><div class="ttname"><a href="util_8h.html#a9543f691bc0adaaec4000d133809657a">FileIsWritable</a></div><div class="ttdeci">bool FileIsWritable(char *pcFileName)</div><div class="ttdoc">Test if file is writable. File may or may not exist. </div><div class="ttdef"><b>Definition:</b> util.c:466</div></div>
<div class="ttc" id="util_8h_html_a4a66f56360f9c91a4845bdf9c192e08a"><div class="ttname"><a href="util_8h.html#a4a66f56360f9c91a4845bdf9c192e08a">CkCalloc</a></div><div class="ttdeci">void * CkCalloc(size_t count, size_t size, const char *function, const int line)</div><div class="ttdoc">Allocates memory (calloc). Memory will be set to zero. </div><div class="ttdef"><b>Definition:</b> util.c:114</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>