From owner-freebsd-ports Tue Feb 26 5:30:13 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 40B7437B417 for ; Tue, 26 Feb 2002 05:30:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1QDU4n81711; Tue, 26 Feb 2002 05:30:04 -0800 (PST) (envelope-from gnats) Received: from dcspc2.cis.nctu.edu.tw (dcspc2.cis.nctu.edu.tw [140.113.88.232]) by hub.freebsd.org (Postfix) with ESMTP id 9C67737B402 for ; Tue, 26 Feb 2002 05:22:27 -0800 (PST) Received: (from yjchou@localhost) by dcspc2.cis.nctu.edu.tw (8.11.6/8.11.6) id g1QDMJV49584; Tue, 26 Feb 2002 21:22:19 +0800 (CST) (envelope-from yjchou) Message-Id: <200202261322.g1QDMJV49584@dcspc2.cis.nctu.edu.tw> Date: Tue, 26 Feb 2002 21:22:19 +0800 (CST) From: Chou Yeh-Jyi Reply-To: Chou Yeh-Jyi To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/35344: chinese/lunar: add big5 output messages Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35344 >Category: ports >Synopsis: chinese/lunar: add big5 output messages >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Feb 26 05:30:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Chou Yeh-Jyi >Release: FreeBSD 4.5-STABLE i386 >Organization: >Environment: System: FreeBSD dcspc2.cis.nctu.edu.tw 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Jan 30 16:53:33 CST 2002 root@dcspc2.cis.nctu.edu.tw:/usr/obj/usr/src/sys/Age i386 >Description: * Add big5 output messages. * Modify lunar man page. * New files: files/patch-03 files/patch-04 >How-To-Repeat: N/A >Fix: diff -urN /usr/ports/chinese/lunar/files/patch-03 lunar/files/patch-03 --- /usr/ports/chinese/lunar/files/patch-03 Thu Jan 1 08:00:00 1970 +++ lunar/files/patch-03 Tue Feb 26 21:02:48 2002 @@ -0,0 +1,120 @@ +--- lunar.c.orig Tue Feb 26 20:54:23 2002 ++++ lunar.c Tue Feb 26 21:01:38 2002 +@@ -118,6 +118,26 @@ + "四", "五", "六" + }; + ++static char *GanBIG5[] = { ++ "ヒ", "", "", "", "コ", ++ "", "┌", "ǒ", "ば", "" ++}; ++ ++static char *ZhiBIG5[] = { ++ "", "ぁ", "盙", "", "ò", "", ++ "と", "ゼ", "ビ", "ɑ", "Ζ", "ヨ" ++}; ++ ++static char *ShengXiaoBIG5[] = { ++ "公", "", "", "ㄟ", "纒", "矰", ++ "皑", "ο", "礥", "蔓", "", "睫" ++}; ++ ++static char *weekdayBIG5[] = { ++ "ら", "", "", "", ++ "", "き", "せ" ++}; ++ + + Date solar, lunar, gan, zhi, gan2, zhi2, lunar2; + +@@ -127,6 +147,7 @@ + int jieAlert; /* if there is uncertainty in JieQi calculation */ + + int showHZ = 0; /* output in hanzi */ ++int showB5 = 0; /* output in big5 */ + int showBM = 0; /* output in bitmap */ + char BMfile[] = BITMAPFILE; /* bit map file */ + char GZBM[NBM][BMRow][BMCol]; /* the bitmap array */ +@@ -139,7 +160,7 @@ + void CalGZ(); + int JieDate(), JieDate(); + void readBM(), display3(); +-void Report(), ReportE(), ReportBM(), ReportGB(); ++void Report(), ReportE(), ReportBM(), ReportGB(), ReportBIG5(); + void usage(), Error(); + + +@@ -162,6 +183,7 @@ + case 'l': if (inverse) leap=1; else usage(); break; + case 'h': showHZ = 1; break; + case 'b': showBM = 1; break; ++ case '5': showB5 = 1; break; + default: usage(); break; + } + } +@@ -213,13 +235,14 @@ + void usage() + { + printf("Usage:\n\n"); +- printf("Solar->Lunar:\t%s [-h] [-b] year month day [hour]\n", progname); ++ printf("Solar->Lunar:\t%s [-h] [-5] [-b] year month day [hour]\n", progname); + printf("\t\t(in Solar Calendar, 24 hour clock)\n\n"); +- printf("Lunar->Solar:\t%s [-h] [-b] -i [-l] year month day [hour]\n", ++ printf("Lunar->Solar:\t%s [-h] [-5] [-b] -i [-l] year month day [hour]\n", + progname); + printf("\t\t(in Lunar Calendar, 24 hour clock)\n"); + 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-5 means output in traditional chinese(BIG5)\n"); + printf("\t\t-b means output in \"bitmap\"\n\n"); + printf("Date range: about %d years from the Solar Date %d.%d.%d\n", Nyear, + SolarFirstDate.year, SolarFirstDate.month, SolarFirstDate.day); +@@ -578,6 +601,8 @@ + { + if (showHZ) + ReportGB(); ++ else if (showB5) ++ ReportBIG5(); + else if (showBM) + ReportBM(); + else +@@ -614,6 +639,39 @@ + if (lunar2.month==1) + printf("* %s\n", "年柱亦可能要修改"); + printf("* %s\n", "请查有节气时间之万年历"); ++ } ++} ++ ++ ++void ReportBIG5() ++{ ++ printf("%s%d%s%2d%s%2d%s%2d%s%s%s\n", "锭菌", ++ solar.year, "", solar.month, "る", solar.day, ++ "ら", solar.hour, "", ++ "琍戳", weekdayBIG5[solar.weekday]); ++ printf("%s%d%s%s%2d%s%2d%s%s%s%s%s\n", "潮菌", ++ lunar.year, "", (lunar.leap? "秥":""), ++ lunar.month, "る", lunar.day, "ら", ++ ZhiBIG5[zhi.hour], "", ++ "ネ╲妮", ShengXiaoBIG5[zhi.year]); ++ printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", "や", ++ GanBIG5[gan.year], ZhiBIG5[zhi.year], "", ++ GanBIG5[gan.month], ZhiBIG5[zhi.month], "る", ++ GanBIG5[gan.day], ZhiBIG5[zhi.day], "ら", ++ GanBIG5[gan.hour], ZhiBIG5[zhi.hour], ""); ++ printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", ++ "ノ琖衡崩衡ぇò", ++ GanBIG5[gan2.year], ZhiBIG5[zhi2.year], "", ++ GanBIG5[gan2.month], ZhiBIG5[zhi2.month], "る", ++ GanBIG5[gan2.day], ZhiBIG5[zhi2.day], "ら", ++ GanBIG5[gan2.hour], ZhiBIG5[zhi2.hour], ""); ++ if (jieAlert) ++ { ++ printf("* %s, %s\n", "琌ら竊", ++ "る琖璶э"); ++ if (lunar2.month==1) ++ printf("* %s\n", "琖ョ璶э"); ++ printf("* %s\n", "叫琩Τ竊丁ぇ窾菌"); + } + } + diff -urN /usr/ports/chinese/lunar/files/patch-04 lunar/files/patch-04 --- /usr/ports/chinese/lunar/files/patch-04 Thu Jan 1 08:00:00 1970 +++ lunar/files/patch-04 Tue Feb 26 21:03:08 2002 @@ -0,0 +1,44 @@ +--- lunar.1.orig Tue Aug 11 12:14:48 1992 ++++ lunar.1 Tue Feb 26 21:00:38 2002 +@@ -4,13 +4,15 @@ + .SH SYNTAX + .B lunar + [ +-.B\-h ++.B \-h + ] [ +-.B\-b ++.B \-5 + ] [ +-.B\-i ++.B \-b + ] [ +-.B\-l ++.B \-i ++] [ ++.B \-l + ] + .I year month day + [ +@@ -56,14 +58,16 @@ + The ganzhi of the j-th leap month is the same as that of the j-th month. + + The possible options are +-.IP b ++.IP \-b + output ganzhi in special "bitmap" characters. +-.IP h +-output hanzi or Chinese characters encoded in (highest-bit-set) GB code. +-.IP i ++.IP \-h ++output hanzi or Simplified Chinese characters encoded in (highest-bit-set) GB code. ++.IP \-5 ++output Traditional Chinese characters encoded in (highest-bit-set) BIG5 code. ++.IP \-i + convert a lunar date to solar date. + The default is to convert a solar date to a lunar date. +-.IP l ++.IP \-l + indicate the month is a lunar leap month. + This option is meaningful only when the "-i" option is used. + .SH COPYRIGHT >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message