/usr/share/gtk-doc/html/lunar/lunar-lunardate.html is in liblunar-1-doc 2.0.1-2.3ubuntu1.
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LunarDate: liblunar Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="liblunar Reference Manual">
<link rel="up" href="index.html" title="liblunar Reference Manual">
<link rel="prev" href="lunar-lunarmain.html" title="Intialization">
<link rel="next" href="lunar-LunarCalendar.html" title="LunarCalendar">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#lunar-lunardate.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="lunar-lunarmain.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="lunar-LunarCalendar.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="lunar-lunardate"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="lunar-lunardate.top_of_page"></a>LunarDate</span></h2>
<p>LunarDate — Translate the date between solar and chinese lunar.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="lunar-lunardate.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">GQuark</span>
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-error-quark" title="lunar_date_error_quark ()">lunar_date_error_quark</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="returnvalue">LunarDate</span></a> *
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-new" title="lunar_date_new ()">lunar_date_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-set-solar-date" title="lunar_date_set_solar_date ()">lunar_date_set_solar_date</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-set-lunar-date" title="lunar_date_set_lunar_date ()">lunar_date_set_lunar_date</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-get-jieri" title="lunar_date_get_jieri ()">lunar_date_get_jieri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-strftime" title="lunar_date_strftime ()">lunar_date_strftime</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="lunar-lunardate.html#lunar-date-free" title="lunar_date_free ()">lunar_date_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="lunar-lunardate.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="lunar-lunardate.html#GDateHour" title="GDateHour">GDateHour</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate">LunarDate</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="lunar-lunardate.html#LUNAR-DATE-ERROR:CAPS" title="LUNAR_DATE_ERROR">LUNAR_DATE_ERROR</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="lunar-lunardate.html#LunarDateError" title="enum LunarDateError">LunarDateError</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="lunar-lunardate.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <lunar/lunar.h>
</pre>
</div>
<div class="refsect1">
<a name="lunar-lunardate.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="lunar-lunardate.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="lunar-date-error-quark"></a><h3>lunar_date_error_quark ()</h3>
<pre class="programlisting"><span class="returnvalue">GQuark</span>
lunar_date_error_quark (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-new"></a><h3>lunar_date_new ()</h3>
<pre class="programlisting"><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="returnvalue">LunarDate</span></a> *
lunar_date_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Allocates a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> and initializes it. Free the return value with <a class="link" href="lunar-lunardate.html#lunar-date-free" title="lunar_date_free ()"><code class="function">lunar_date_free()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.7.3.5"></a><h4>Returns</h4>
<p> a newly-allocated <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-set-solar-date"></a><h3>lunar_date_set_solar_date ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
lunar_date_set_solar_date (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>,
<em class="parameter"><code><span class="type">GDateYear</span> year</code></em>,
<em class="parameter"><code><span class="type">GDateMonth</span> month</code></em>,
<em class="parameter"><code><span class="type">GDateDay</span> day</code></em>,
<em class="parameter"><code><a class="link" href="lunar-lunardate.html#GDateHour" title="GDateHour"><span class="type">GDateHour</span></a> hour</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Sets the solar year, month, day and the hour for a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>.</p>
<div class="refsect3">
<a name="id-1.3.7.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>year</p></td>
<td class="parameter_description"><p>year to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>month</p></td>
<td class="parameter_description"><p>month to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>day</p></td>
<td class="parameter_description"><p>day to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hour</p></td>
<td class="parameter_description"><p>hour to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>location to store the error occuring, or NULL to ignore errors.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-set-lunar-date"></a><h3>lunar_date_set_lunar_date ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
lunar_date_set_lunar_date (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>,
<em class="parameter"><code><span class="type">GDateYear</span> year</code></em>,
<em class="parameter"><code><span class="type">GDateMonth</span> month</code></em>,
<em class="parameter"><code><span class="type">GDateDay</span> day</code></em>,
<em class="parameter"><code><a class="link" href="lunar-lunardate.html#GDateHour" title="GDateHour"><span class="type">GDateHour</span></a> hour</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> isleap</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Sets the lunar year, month, day and the hour for a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>. If the month is a leap month, you should set the isleap to TRUE.</p>
<div class="refsect3">
<a name="id-1.3.7.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>year</p></td>
<td class="parameter_description"><p>year to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>month</p></td>
<td class="parameter_description"><p>month to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>day</p></td>
<td class="parameter_description"><p>day to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hour</p></td>
<td class="parameter_description"><p>hour to set.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>isleap</p></td>
<td class="parameter_description"><p>indicate whether the month is a leap month.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>location to store the error occuring, or <span class="type">NULL</span> to ignore errors.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-get-jieri"></a><h3>lunar_date_get_jieri ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
lunar_date_get_jieri (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>);</pre>
<p>Returns the holiday of the date. The date must be valid.</p>
<div class="refsect3">
<a name="id-1.3.7.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.7.6.6"></a><h4>Returns</h4>
<p> a newly-allocated holiday string of the date.
This can be changed in $(datadir)/liblunar/holiday.dat file.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-strftime"></a><h3>lunar_date_strftime ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
lunar_date_strftime (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *format</code></em>);</pre>
<p>使用给定的格式来输出字符串。类似于strftime的用法。可使用的格式及输出如下:</p>
<p>%(YEAR)年%(MONTH)月%(DAY)日 公历:大写->二OO八年一月二十一日</p>
<p>%(year)年%(month)月%(day)日 公历:小写->2008年1月21日</p>
<p>%(NIAN)年%(YUE)月%(RI)日%(SHI)时 阴历:大写->丁亥年腊月十四日</p>
<p>%(nian)年%(yue)月%(ri)日%(shi)时 阴历:小写->2007年12月14日</p>
<p>%(Y60)年%(M60)月%(D60)日%(H60)时 干支:大写->丁亥年癸丑月庚申日</p>
<p>%(y60)年%(m60)月%(d60)日%(h60)时 干支:小写 not use</p>
<p>%(Y8)年%(M8)月%(D8)日%(H8)时 八字:大写->丁亥年癸丑月庚申日</p>
<p>%(y8)年%(m8)月%(d8)日%(h8)时 八字:小写 not use</p>
<p>%(shengxiao) 生肖:猪
%(jieri) 节日(节日、纪念日、节气等):立春</p>
<p>使用%(jieri)时,如果此日没有节日或节气,那么将为空。
节日可以自定义,只要按照格式修改$(prefix)/share/liblunar/hodiday.dat即可。</p>
<div class="refsect3">
<a name="id-1.3.7.7.15"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>specify the output format. this</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.7.7.16"></a><h4>Returns</h4>
<p> a newly-allocated output string, nul-terminated</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="lunar-date-free"></a><h3>lunar_date_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
lunar_date_free (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>);</pre>
<p>Frees a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> returned from <a class="link" href="lunar-lunardate.html#lunar-date-new" title="lunar_date_new ()"><code class="function">lunar_date_new()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.7.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="lunar-lunardate.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GDateHour"></a><h3>GDateHour</h3>
<pre class="programlisting">typedef guint8 GDateHour;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="LunarDate"></a><h3>LunarDate</h3>
<pre class="programlisting">typedef struct _LunarDate LunarDate;</pre>
<p>
The LUNARDate struct contains only private fields and should not be used directly.
</p>
</div>
<hr>
<div class="refsect2">
<a name="LUNAR-DATE-ERROR:CAPS"></a><h3>LUNAR_DATE_ERROR</h3>
<pre class="programlisting">#define LUNAR_DATE_ERROR (lunar_date_error_quark ())
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="LunarDateError"></a><h3>enum LunarDateError</h3>
<p>
</p>
<div class="refsect3">
<a name="id-1.3.8.5.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="LUNAR-DATE-ERROR-INTERNAL:CAPS"></a>LUNAR_DATE_ERROR_INTERNAL</p></td>
<td class="enum_member_description">
<p>a internal error was found.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="LUNAR-DATE-ERROR-DAY:CAPS"></a>LUNAR_DATE_ERROR_DAY</p></td>
<td class="enum_member_description">
<p>the day is out of the range.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="LUNAR-DATE-ERROR-YEAR:CAPS"></a>LUNAR_DATE_ERROR_YEAR</p></td>
<td class="enum_member_description">
<p>the year is out of the range.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="LUNAR-DATE-ERROR-LEAP:CAPS"></a>LUNAR_DATE_ERROR_LEAP</p></td>
<td class="enum_member_description">
<p>the <em class="parameter"><code>isleap</code></em> parameter of <a class="link" href="lunar-lunardate.html#lunar-date-set-lunar-date" title="lunar_date_set_lunar_date ()"><code class="function">lunar_date_set_lunar_date()</code></a> is not corret.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>
|