/usr/share/gtk-doc/html/lunar/lunar-lunardate.html is in liblunar-1-doc 2.0.1-2.2.
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 | <!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</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.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.18 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="lunar-lunarmain.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td> </td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">liblunar Reference Manual</th>
<td><a accesskey="n" href="lunar-LunarCalendar.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#lunar-lunardate.synopsis" class="shortcut">Top</a>
|
<a href="#lunar-lunardate.description" class="shortcut">Description</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 valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="lunar-lunardate.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <lunar/lunar.h>
typedef <a class="link" href="lunar-lunardate.html#GDateHour" title="GDateHour">GDateHour</a>;
<a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate">LunarDate</a>;
#define <a class="link" href="lunar-lunardate.html#LUNAR-DATE-ERROR:CAPS" title="LUNAR_DATE_ERROR">LUNAR_DATE_ERROR</a>
enum <a class="link" href="lunar-lunardate.html#LunarDateError" title="enum LunarDateError">LunarDateError</a>;
<span class="returnvalue">GQuark</span> <a class="link" href="lunar-lunardate.html#lunar-date-error-quark" title="lunar_date_error_quark ()">lunar_date_error_quark</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="returnvalue">LunarDate</span></a> * <a class="link" href="lunar-lunardate.html#lunar-date-new" title="lunar_date_new ()">lunar_date_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span> <a class="link" href="lunar-lunardate.html#lunar-date-set-solar-date" title="lunar_date_set_solar_date ()">lunar_date_set_solar_date</a> (<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>);
<span class="returnvalue">void</span> <a class="link" href="lunar-lunardate.html#lunar-date-set-lunar-date" title="lunar_date_set_lunar_date ()">lunar_date_set_lunar_date</a> (<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>);
<span class="returnvalue">gchar</span> * <a class="link" href="lunar-lunardate.html#lunar-date-get-jieri" title="lunar_date_get_jieri ()">lunar_date_get_jieri</a> (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>);
<span class="returnvalue">gchar</span> * <a class="link" href="lunar-lunardate.html#lunar-date-strftime" title="lunar_date_strftime ()">lunar_date_strftime</a> (<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>);
<span class="returnvalue">void</span> <a class="link" href="lunar-lunardate.html#lunar-date-free" title="lunar_date_free ()">lunar_date_free</a> (<em class="parameter"><code><a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a> *date</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="lunar-lunardate.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="lunar-lunardate.details"></a><h2>Details</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>
<pre class="programlisting">typedef enum {
LUNAR_DATE_ERROR_INTERNAL,
LUNAR_DATE_ERROR_DAY,
LUNAR_DATE_ERROR_YEAR,
LUNAR_DATE_ERROR_LEAP
} LunarDateError;
</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="LUNAR-DATE-ERROR-INTERNAL:CAPS"></a><span class="term"><code class="literal">LUNAR_DATE_ERROR_INTERNAL</code></span></p></td>
<td>a internal error was found.
</td>
</tr>
<tr>
<td><p><a name="LUNAR-DATE-ERROR-DAY:CAPS"></a><span class="term"><code class="literal">LUNAR_DATE_ERROR_DAY</code></span></p></td>
<td>the day is out of the range.
</td>
</tr>
<tr>
<td><p><a name="LUNAR-DATE-ERROR-YEAR:CAPS"></a><span class="term"><code class="literal">LUNAR_DATE_ERROR_YEAR</code></span></p></td>
<td>the year is out of the range.
</td>
</tr>
<tr>
<td><p><a name="LUNAR-DATE-ERROR-LEAP:CAPS"></a><span class="term"><code class="literal">LUNAR_DATE_ERROR_LEAP</code></span></p></td>
<td>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.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>
</td>
</tr></tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>date</code></em> :</span></p></td>
<td>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>year</code></em> :</span></p></td>
<td>year to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>month</code></em> :</span></p></td>
<td>month to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>day</code></em> :</span></p></td>
<td>day to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hour</code></em> :</span></p></td>
<td>hour to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store the error occuring, or NULL to ignore errors.</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>date</code></em> :</span></p></td>
<td>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>year</code></em> :</span></p></td>
<td>year to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>month</code></em> :</span></p></td>
<td>month to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>day</code></em> :</span></p></td>
<td>day to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hour</code></em> :</span></p></td>
<td>hour to set.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>isleap</code></em> :</span></p></td>
<td>indicate whether the month is a leap month.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store the error occuring, or <span class="type">NULL</span> to ignore errors.</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>date</code></em> :</span></p></td>
<td>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated holiday string of the date.
This can be changed in $(datadir)/liblunar/holiday.dat file.</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>date</code></em> :</span></p></td>
<td>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>specify the output format. this</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated output string, nul-terminated</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>date</code></em> :</span></p></td>
<td>a <a class="link" href="lunar-lunardate.html#LunarDate" title="LunarDate"><span class="type">LunarDate</span></a>
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|