[Chinese-commits] [lunar] 03/05: Imported Debian patch 2.2-3
Anthony Fok
foka at debian.org
Sat Sep 19 19:35:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
foka pushed a commit to branch master
in repository lunar.
commit 9ed1d4f5b72ddbf24c83b47c21346a598e29bc90
Author: Anthony Fok <foka at debian.org>
Date: Wed Jan 4 20:32:25 2006 +0800
Imported Debian patch 2.2-3
---
debian/changelog | 8 +++++++
debian/compat | 1 +
debian/control | 4 ++--
debian/copyright | 2 +-
debian/rules | 3 ---
lunar.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
6 files changed, 79 insertions(+), 9 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 379c004..023cc8f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+lunar (2.2-3) unstable; urgency=low
+
+ * Added --utf8 option. (Closes: Bug#288170)
+ * Updated Standards-Version: 3.6.2
+ * [lunar.c]: Added "#include <stdlib.h>" to remove compiler warnings.
+
+ -- Anthony Fok <foka at debian.org> Wed, 4 Jan 2006 20:32:25 +0800
+
lunar (2.2-2) unstable; urgency=medium
* Oops, I forgot to install lunar.bitmap and to specify its full path
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
index 2a2b563..4300f0f 100644
--- a/debian/control
+++ b/debian/control
@@ -3,12 +3,12 @@ Section: utils
Priority: optional
Maintainer: Anthony Fok <foka at debian.org>
Build-Depends: debhelper (>> 3.0.0)
-Standards-Version: 3.5.7
+Standards-Version: 3.6.2
Package: lunar
Architecture: any
Depends: ${shlibs:Depends}
-Description: Chinese Lunar Calendar conversion utility.
+Description: Chinese Lunar Calendar conversion utility
The program performs date conversion between the Gregorian Solar Calendar
(SC) and the Chinese Lunar Calendar (LC). Given a date in either calendar,
the program also outputs the corresponding "shengxiao" animal of the year)
diff --git a/debian/copyright b/debian/copyright
index c64e794..46a93dd 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -24,7 +24,7 @@ Copyright:
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The last version of this program was released on July 23, 1992 as
version 2.1a. This program was first released under the terms of GNU
diff --git a/debian/rules b/debian/rules
index 970da92..bf289c9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,9 +4,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=3
-
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
diff --git a/lunar.c b/lunar.c
index aa0ed7a..d2241c3 100644
--- a/lunar.c
+++ b/lunar.c
@@ -64,6 +64,7 @@ References:
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
/* "Bitmap" constants */
@@ -111,6 +112,26 @@ static char *weekday[] = {
"Thursday", "Friday", "Saturday"
};
+static char *GanUTF8[] = {
+ "甲", "乙", "丙", "丁", "戊",
+ "己", "庚", "辛", "壬", "癸"
+};
+
+static char *ZhiUTF8[] = {
+ "子", "丑", "寅", "卯", "辰", "巳",
+ "午", "未", "申", "酉", "戌", "亥"
+};
+
+static char *ShengXiaoUTF8[] = {
+ "鼠", "牛", "虎", "兔", "龙", "蛇",
+ "马", "羊", "猴", "鸡", "狗", "猪"
+};
+
+static char *weekdayUTF8[] = {
+ "日", "一", "二", "三",
+ "四", "五", "六"
+};
+
static char *GanGB[] = {
"��", "��", "��", "��", "��",
"��", "��", "��", "��", "��"
@@ -161,6 +182,7 @@ int jieAlert; /* if there is uncertainty in JieQi calculation */
int showHZ = 0; /* output in hanzi */
int showBM = 0; /* output in bitmap */
+int showHZ_UTF8 = 0; /* output in UTF-8-encoded hanzi */
int showHZ_GB = 0; /* output in GB-encoded hanzi */
int showHZ_B5 = 0; /* output in Big5-encoded hanzi */
char BMfile[] = "/usr/share/lunar/lunar.bitmap"; /* bit map file */
@@ -174,7 +196,7 @@ int make_yday(), make_mday(), GZcycle();
void CalGZ();
int CmpDate(), JieDate();
void readBM(), display3();
-void Report(), ReportE(), ReportBM(), ReportGB(), ReportB5();
+void Report(), ReportE(), ReportBM(), ReportUTF8(), ReportGB(), ReportB5();
void usage(), Error();
@@ -198,11 +220,17 @@ char *argv[];
case 'h': showHZ = 1; break;
case 'b': showBM = 1; break;
case '-':
- if (strncmp(argv[k], "--big5", 7) == 0) {
+ if (strncmp(argv[k], "--utf8", 7) == 0) {
+ showHZ = showHZ_UTF8 = 1;
+ showHZ_B5 = 0;
+ showHZ_GB = 0;
+ } else if (strncmp(argv[k], "--big5", 7) == 0) {
showHZ = showHZ_B5 = 1;
+ showHZ_UTF8 = 0;
showHZ_GB = 0;
} else if (strncmp(argv[k], "--gb", 5) == 0) {
showHZ = showHZ_GB = 1;
+ showHZ_UTF8 = 0;
showHZ_B5 = 0;
} else
usage();
@@ -267,6 +295,7 @@ void usage()
printf("\t\t-l means the month is a leap month (\"run4 yue4\")\n\n");
printf("\t\t-h means output in hanzi (GB)\n");
printf("\t\t-b means output in \"bitmap\"\n");
+ printf("\t\t--utf8 means output in hanzi (UTF-8)\n");
printf("\t\t--gb means output in hanzi (GB)\n");
printf("\t\t--big5 means output in hanzi (Big5)\n\n");
printf("Date range: about %d years from the Solar Date %d.%d.%d\n", Nyear,
@@ -621,7 +650,9 @@ int year;
void Report()
{
if (showHZ)
- if (showHZ_B5)
+ if (showHZ_UTF8)
+ ReportUTF8();
+ else if (showHZ_B5)
ReportB5();
else
ReportGB();
@@ -632,6 +663,39 @@ void Report()
}
+void ReportUTF8()
+{
+ printf("%s%d%s%2d%s%2d%s%2d%s%s%s\n", "阳历: ",
+ solar.year, "年", solar.month, "月", solar.day,
+ "日", solar.hour, "时 ",
+ "星期", weekdayUTF8[solar.weekday]);
+ printf("%s%d%s%s%2d%s%2d%s%s%s%s%s\n", "阴历: ",
+ lunar.year, "年", (lunar.leap? "闰":""),
+ lunar.month, "月", lunar.day, "日",
+ ZhiUTF8[zhi.hour], "时 ",
+ "生肖属", ShengXiaoUTF8[zhi.year]);
+ printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", "干支: ",
+ GanUTF8[gan.year], ZhiUTF8[zhi.year], "年 ",
+ GanUTF8[gan.month], ZhiUTF8[zhi.month], "月 ",
+ GanUTF8[gan.day], ZhiUTF8[zhi.day], "日 ",
+ GanUTF8[gan.hour], ZhiUTF8[zhi.hour], "时 ");
+ printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "用四柱神算推算之时辰八字: ",
+ GanUTF8[gan2.year], ZhiUTF8[zhi2.year], "年 ",
+ GanUTF8[gan2.month], ZhiUTF8[zhi2.month], "月 ",
+ GanUTF8[gan2.day], ZhiUTF8[zhi2.day], "日 ",
+ GanUTF8[gan2.hour], ZhiUTF8[zhi2.hour], "时 ");
+ if (jieAlert)
+ {
+ printf("* %s, %s\n", "是日为节",
+ "月柱可能要修改");
+ if (lunar2.month==1)
+ printf("* %s\n", "年柱亦可能要修改");
+ printf("* %s\n", "请查有节气时间之万年历");
+ }
+}
+
+
void ReportGB()
{
printf("%s%d%s%2d%s%2d%s%2d%s%s%s\n", "��������",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/lunar.git
More information about the Chinese-commits
mailing list