t=UTF-8
Last-Modified: Wed, 08 Jan 2025 13:33:46 GMT
Expires: Wed, 08 Jan 2025 17:33:46 GMT

<!DOCTYPE html>
<html lang='en'>
<head>
<title>cgit - Web front-end for git that you're looking at right now. Might have had a few additions from upstream.</title>
<meta name='generator' content='cgit v1.2.3-54-g00ecf'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit.css'/>
<script type='text/javascript' src='/cgit.js'></script>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='http://git.twilightsparkle.space/cgit/atom/html.h?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='https://git.twilightsparkle.space/cgit' title='cgit Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/cgit/'>cgit</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='392e07d28a23aec9942b9ed0d122e35d2d268fb9'/><select name='h' onchange='this.form.submit();'>
<option value='master' selected='selected'>master</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Web front-end for git that you're looking at right now. Might have had a few additions from upstream.</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit/about/'>about</a><a href='/cgit/'>summary</a><a href='/cgit/refs/?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9'>refs</a><a href='/cgit/log/html.h'>log</a><a href='/cgit/tree/html.h?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9'>tree</a><a href='/cgit/commit/html.h?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9' rel='nofollow'>commit</a><a class='active' href='/cgit/diff/html.h?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9'>diff</a><a href='/cgit/stats/html.h'>stats</a><a href='https://git.zx2c4.com/cgit/about'>homepage</a></td><td class='form'><form class='right' method='get' action='/cgit/log/html.h'>
<input type='hidden' name='id' value='392e07d28a23aec9942b9ed0d122e35d2d268fb9'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit/diff/?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9'>root</a>/<a href='/cgit/diff/html.h?id=392e07d28a23aec9942b9ed0d122e35d2d268fb9'>html.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='392e07d28a23aec9942b9ed0d122e35d2d268fb9'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option <style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span>include(CMakeFindDependencyMacro)

find_dependency(CURL REQUIRED)

include(&quot;${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake&quot;)
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3-54-g00ecf</a> (<a href='https://git-scm.com/'>git 2.39.0</a>) at 2025-01-08 13:33:47 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
n194' href='#n194'>194</a>
<a id='n195' href='#n195'>195</a>
<a id='n196' href='#n196'>196</a>
<a id='n197' href='#n197'>197</a>
<a id='n198' href='#n198'>198</a>
<a id='n199' href='#n199'>199</a>
<a id='n200' href='#n200'>200</a>
<a id='n201' href='#n201'>201</a>
<a id='n202' href='#n202'>202</a>
<a id='n203' href='#n203'>203</a>
<a id='n204' href='#n204'>204</a>
<a id='n205' href='#n205'>205</a>
<a id='n206' href='#n206'>206</a>
<a id='n207' href='#n207'>207</a>
<a id='n208' href='#n208'>208</a>
<a id='n209' href='#n209'>209</a>
<a id='n210' href='#n210'>210</a>
<a id='n211' href='#n211'>211</a>
<a id='n212' href='#n212'>212</a>
<a id='n213' href='#n213'>213</a>
<a id='n214' href='#n214'>214</a>
<a id='n215' href='#n215'>215</a>
<a id='n216' href='#n216'>216</a>
<a id='n217' href='#n217'>217</a>
<a id='n218' href='#n218'>218</a>
<a id='n219' href='#n219'>219</a>
<a id='n220' href='#n220'>220</a>
<a id='n221' href='#n221'>221</a>
<a id='n222' href='#n222'>222</a>
<a id='n223' href='#n223'>223</a>
<a id='n224' href='#n224'>224</a>
<a id='n225' href='#n225'>225</a>
<a id='n226' href='#n226'>226</a>
<a id='n227' href='#n227'>227</a>
<a id='n228' href='#n228'>228</a>
<a id='n229' href='#n229'>229</a>
<a id='n230' href='#n230'>230</a>
<a id='n231' href='#n231'>231</a>
<a id='n232' href='#n232'>232</a>
<a id='n233' href='#n233'>233</a>
<a id='n234' href='#n234'>234</a>
<a id='n235' href='#n235'>235</a>
<a id='n236' href='#n236'>236</a>
<a id='n237' href='#n237'>237</a>
<a id='n238' href='#n238'>238</a>
<a id='n239' href='#n239'>239</a>
<a id='n240' href='#n240'>240</a>
<a id='n241' href='#n241'>241</a>
<a id='n242' href='#n242'>242</a>
<a id='n243' href='#n243'>243</a>
<a id='n244' href='#n244'>244</a>
<a id='n245' href='#n245'>245</a>
<a id='n246' href='#n246'>246</a>
<a id='n247' href='#n247'>247</a>
<a id='n248' href='#n248'>248</a>
<a id='n249' href='#n249'>249</a>
<a id='n250' href='#n250'>250</a>
<a id='n251' href='#n251'>251</a>
<a id='n252' href='#n252'>252</a>
<a id='n253' href='#n253'>253</a>
</pre></td>
<td class='lines'><pre><code><style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="cm">/* ui-refs.c: browse symbolic refs</span>
<span class="cm"> *</span>
<span class="cm"> * Copyright (C) 2006 Lars Hjemli</span>
<span class="cm"> *</span>
<span class="cm"> * Licensed under GNU General Public License v2</span>
<span class="cm"> *   (see COPYING for full license text)</span>
<span class="cm"> */</span>

<span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;cgit.h&quot;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;ui-refs.h&quot;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;html.h&quot;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;ui-shared.h&quot;</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">cmp_age</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">age1</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">age2</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">age1</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">age2</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="n">age2</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">age1</span><span class="p">;</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">age1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">age2</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">age1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="o">+</span><span class="mi">1</span><span class="p">;</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="mi">-1</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">cmp_ref_name</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">b</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">a</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">b</span><span class="p">;</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="n">strcmp</span><span class="p">(</span><span class="n">r1</span><span class="o">-&gt;</span><span class="n">refname</span><span class="p">,</span><span class="w"> </span><span class="n">r2</span><span class="o">-&gt;</span><span class="n">refname</span><span class="p">);</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">cmp_branch_age</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">b</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">a</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">b</span><span class="p">;</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="n">cmp_age</span><span class="p">(</span><span class="n">r1</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">committer_date</span><span class="p">,</span><span class="w"> </span><span class="n">r2</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">committer_date</span><span class="p">);</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">get_ref_age</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">ref</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">	</span><span class="k">switch</span><span class="w"> </span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="o">-&gt;</span><span class="n">type</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">	</span><span class="k">case</span><span class="w"> </span><span class="no">OBJ_TAG</span><span class="p">:</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">tag</span><span class="w"> </span><span class="o">?</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">tag</span><span class="o">-&gt;</span><span class="n">tagger_date</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">	</span><span class="k">case</span><span class="w"> </span><span class="no">OBJ_COMMIT</span><span class="p">:</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">commit</span><span class="w"> </span><span class="o">?</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">committer_date</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">cmp_tag_age</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">b</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">a</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">r2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">**</span><span class="p">)</span><span class="n">b</span><span class="p">;</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="n">cmp_age</span><span class="p">(</span><span class="n">get_ref_age</span><span class="p">(</span><span class="n">r1</span><span class="p">),</span><span class="w"> </span><span class="n">get_ref_age</span><span class="p">(</span><span class="n">r2</span><span class="p">));</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">print_branch</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">ref</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">commitinfo</span><span class="w"> </span><span class="o">*</span><span class="n">info</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">commit</span><span class="p">;</span>
<span class="w">	</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">refname</span><span class="p">;</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">info</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="n">cgit_log_link</span><span class="p">(</span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span>
<span class="w">		      </span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">showmsg</span><span class="p">);</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td&gt;&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">OBJ_COMMIT</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">cgit_commit_link</span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">subject</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">		</span><span class="n">html_txt</span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">author</span><span class="p">);</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td colspan=&#39;2&#39;&gt;&quot;</span><span class="p">);</span>
<span class="w">		</span><span class="n">cgit_print_age</span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">date</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">		</span><span class="n">cgit_object_link</span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;/tr&gt;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">print_tag_header</span><span class="p">()</span>
<span class="p">{</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr class=&#39;nohover&#39;&gt;&lt;th class=&#39;left&#39;&gt;Tag&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39;&gt;Download&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39;&gt;Author&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39; colspan=&#39;2&#39;&gt;Age&lt;/th&gt;&lt;/tr&gt;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">print_tag_downloads</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">cgit_repo</span><span class="w"> </span><span class="o">*</span><span class="n">repo</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">ref</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">const</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">cgit_snapshot_format</span><span class="o">*</span><span class="w"> </span><span class="n">f</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">strbuf</span><span class="w"> </span><span class="n">filename</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">STRBUF_INIT</span><span class="p">;</span>
<span class="w">	</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">basename</span><span class="p">;</span>
<span class="w">	</span><span class="kt">int</span><span class="w"> </span><span class="n">free_ref</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">ref</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">strlen</span><span class="p">(</span><span class="n">ref</span><span class="p">)</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">2</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="p">;</span>

<span class="w">	</span><span class="n">basename</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cgit_repobasename</span><span class="p">(</span><span class="n">repo</span><span class="o">-&gt;</span><span class="n">url</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">prefixcmp</span><span class="p">(</span><span class="n">ref</span><span class="p">,</span><span class="w"> </span><span class="n">basename</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">ref</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="sc">&#39;v&#39;</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">ref</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="sc">&#39;V&#39;</span><span class="p">)</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">isdigit</span><span class="p">(</span><span class="n">ref</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
<span class="w">			</span><span class="n">ref</span><span class="o">++</span><span class="p">;</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">ref</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="n">ref</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fmtalloc</span><span class="p">(</span><span class="s">&quot;%s-%s&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">basename</span><span class="p">,</span><span class="w"> </span><span class="n">ref</span><span class="p">);</span>
<span class="w">			</span><span class="n">free_ref</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="w">		</span><span class="p">}</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">f</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cgit_snapshot_formats</span><span class="p">;</span><span class="w"> </span><span class="n">f</span><span class="o">-&gt;</span><span class="n">suffix</span><span class="p">;</span><span class="w"> </span><span class="n">f</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="n">repo</span><span class="o">-&gt;</span><span class="n">snapshots</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="n">f</span><span class="o">-&gt;</span><span class="n">bit</span><span class="p">))</span>
<span class="w">			</span><span class="k">continue</span><span class="p">;</span>
<span class="w">		</span><span class="n">strbuf_reset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">filename</span><span class="p">);</span>
<span class="w">		</span><span class="n">strbuf_addf</span><span class="p">(</span><span class="o">&amp;</span><span class="n">filename</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s%s&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">ref</span><span class="p">,</span><span class="w"> </span><span class="n">f</span><span class="o">-&gt;</span><span class="n">suffix</span><span class="p">);</span>
<span class="w">		</span><span class="n">cgit_snapshot_link</span><span class="p">(</span><span class="n">filename</span><span class="p">.</span><span class="n">buf</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">filename</span><span class="p">.</span><span class="n">buf</span><span class="p">);</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&amp;nbsp;&amp;nbsp;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">free_ref</span><span class="p">)</span>
<span class="w">		</span><span class="n">free</span><span class="p">((</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">ref</span><span class="p">);</span>
<span class="w">	</span><span class="n">strbuf_release</span><span class="p">(</span><span class="o">&amp;</span><span class="n">filename</span><span class="p">);</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">print_tag</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">refinfo</span><span class="w"> </span><span class="o">*</span><span class="n">ref</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">tag</span><span class="w"> </span><span class="o">*</span><span class="n">tag</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">taginfo</span><span class="w"> </span><span class="o">*</span><span class="n">info</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="w">	</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">refname</span><span class="p">;</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">object</span><span class="w"> </span><span class="o">*</span><span class="n">obj</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="p">;</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">obj</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">OBJ_TAG</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">tag</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">tag</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">obj</span><span class="p">;</span>
<span class="w">		</span><span class="n">obj</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tag</span><span class="o">-&gt;</span><span class="n">tagged</span><span class="p">;</span>
<span class="w">		</span><span class="n">info</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">tag</span><span class="p">;</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">tag</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="o">!</span><span class="n">info</span><span class="p">)</span>
<span class="w">			</span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="n">cgit_tag_link</span><span class="p">(</span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">);</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">repo</span><span class="o">-&gt;</span><span class="n">snapshots</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="p">(</span><span class="n">obj</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">OBJ_COMMIT</span><span class="p">))</span>
<span class="w">		</span><span class="n">print_tag_downloads</span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">repo</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">);</span>
<span class="w">	</span><span class="k">else</span>
<span class="w">		</span><span class="n">cgit_object_link</span><span class="p">(</span><span class="n">obj</span><span class="p">);</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">tagger</span><span class="p">)</span>
<span class="w">			</span><span class="n">html</span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">tagger</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">OBJ_COMMIT</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">author</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;td colspan=&#39;2&#39;&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">tagger_date</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">			</span><span class="n">cgit_print_age</span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">tagger_date</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">object</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">OBJ_COMMIT</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">cgit_print_age</span><span class="p">(</span><span class="n">ref</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">commit</span><span class="o">-&gt;</span><span class="n">date</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;/tr&gt;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">static</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">print_refs_link</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">path</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr class=&#39;nohover&#39;&gt;&lt;td colspan=&#39;5&#39;&gt;&quot;</span><span class="p">);</span>
<span class="w">	</span><span class="n">cgit_refs_link</span><span class="p">(</span><span class="s">&quot;[...]&quot;</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">path</span><span class="p">);</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/td&gt;&lt;/tr&gt;&quot;</span><span class="p">);</span>
<span class="p">}</span>

<span class="kt">void</span><span class="w"> </span><span class="nf">cgit_print_branches</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">maxcount</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">reflist</span><span class="w"> </span><span class="n">list</span><span class="p">;</span>
<span class="w">	</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>

<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr class=&#39;nohover&#39;&gt;&lt;th class=&#39;left&#39;&gt;Branch&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39;&gt;Commit message&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39;&gt;Author&lt;/th&gt;&quot;</span>
<span class="w">	     </span><span class="s">&quot;&lt;th class=&#39;left&#39; colspan=&#39;2&#39;&gt;Age&lt;/th&gt;&lt;/tr&gt;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="w">	</span><span class="n">list</span><span class="p">.</span><span class="n">alloc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">	</span><span class="n">for_each_branch_ref</span><span class="p">(</span><span class="n">cgit_refs_cb</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">list</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">repo</span><span class="o">-&gt;</span><span class="n">enable_remote_branches</span><span class="p">)</span>
<span class="w">		</span><span class="n">for_each_remote_ref</span><span class="p">(</span><span class="n">cgit_refs_cb</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">list</span><span class="p">);</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">maxcount</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">maxcount</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">)</span>
<span class="w">		</span><span class="n">maxcount</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">;</span>

<span class="w">	</span><span class="n">qsort</span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">,</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="p">(</span><span class="o">*</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">),</span><span class="w"> </span><span class="n">cmp_branch_age</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">repo</span><span class="o">-&gt;</span><span class="n">branch_sort</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">		</span><span class="n">qsort</span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">,</span><span class="w"> </span><span class="n">maxcount</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="p">(</span><span class="o">*</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">),</span><span class="w"> </span><span class="n">cmp_ref_name</span><span class="p">);</span>

<span class="w">	</span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">maxcount</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w">		</span><span class="n">print_branch</span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">maxcount</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">)</span>
<span class="w">		</span><span class="n">print_refs_link</span><span class="p">(</span><span class="s">&quot;heads&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="n">cgit_free_reflist_inner</span><span class="p">(</span><span class="o">&amp;</span><span class="n">list</span><span class="p">);</span>
<span class="p">}</span>

<span class="kt">void</span><span class="w"> </span><span class="nf">cgit_print_tags</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">maxcount</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">	</span><span class="k">struct</span><span class="w"> </span><span class="nc">reflist</span><span class="w"> </span><span class="n">list</span><span class="p">;</span>
<span class="w">	</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>

<span class="w">	</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="w">	</span><span class="n">list</span><span class="p">.</span><span class="n">alloc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">	</span><span class="n">for_each_tag_ref</span><span class="p">(</span><span class="n">cgit_refs_cb</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">list</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">		</span><span class="k">return</span><span class="p">;</span>
<span class="w">	</span><span class="n">qsort</span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">,</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="p">(</span><span class="o">*</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">),</span><span class="w"> </span><span class="n">cmp_tag_age</span><span class="p">);</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">maxcount</span><span class="p">)</span>
<span class="w">		</span><span class="n">maxcount</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">;</span>
<span class="w">	</span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">maxcount</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">)</span>
<span class="w">		</span><span class="n">maxcount</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">;</span>
<span class="w">	</span><span class="n">print_tag_header</span><span class="p">();</span>
<span class="w">	</span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">maxcount</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w">		</span><span class="n">print_tag</span><span class="p">(</span><span class="n">list</span><span class="p">.</span><span class="n">refs</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">maxcount</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">list</span><span class="p">.</span><span class="n">count</span><span class="p">)</span>
<span class="w">		</span><span class="n">print_refs_link</span><span class="p">(</span><span class="s">&quot;tags&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="n">cgit_free_reflist_inner</span><span class="p">(</span><span class="o">&amp;</span><span class="n">list</span><span class="p">);</span>
<span class="p">}</span>

<span class="kt">void</span><span class="w"> </span><span class="nf">cgit_print_refs</span><span class="p">()</span>
<span class="p">{</span>

<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;table class=&#39;list nowrap&#39;&gt;&quot;</span><span class="p">);</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">path</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="o">!</span><span class="n">strncmp</span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">path</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;heads&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">))</span>
<span class="w">		</span><span class="n">cgit_print_branches</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="w">	</span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">path</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="o">!</span><span class="n">strncmp</span><span class="p">(</span><span class="n">ctx</span><span class="p">.</span><span class="n">qry</span><span class="p">.</span><span class="n">path</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;tags&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">4</span><span class="p">))</span>
<span class="w">		</span><span class="n">cgit_print_tags</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="w">	</span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="n">cgit_print_branches</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="w">		</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;tr class=&#39;nohover&#39;&gt;&lt;td colspan=&#39;5&#39;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&quot;</span><span class="p">);</span>
<span class="w">		</span><span class="n">cgit_print_tags</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="n">html</span><span class="p">(</span><span class="s">&quot;&lt;/table&gt;&quot;</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3-54-g00ecf</a> (<a href='https://git-scm.com/'>git 2.39.0</a>) at 2025-01-08 13:33:47 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
