Created
February 28, 2014 10:15
-
-
Save mather/9268600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Jhcal < Formula | |
homepage 'http://www2.tokai.or.jp/y_okamon/myfreesoft/jhcal/jhcal.html' | |
url 'http://www2.tokai.or.jp/y_okamon/myfreesoft/jhcal/jhcal-2.0.tar.gz' | |
sha1 'ae09d530c3e89da8624245f95378a7991b597101' | |
def install | |
system "make" | |
bin.install "jhcal" | |
end | |
def patches | |
DATA | |
end | |
end | |
__END__ | |
--- a/output_calendar.c | |
+++ b/output_calendar.c | |
@@ -78,7 +78,7 @@ void month_print_calendar(int year, int month) | |
/* ここから処理コードの記述 */ | |
printf(" %d年%2d月\n", year, month); /* 年月を表示 */ | |
- printf(" \x1b[31m日 \x1b[30m月 火 水 木 金 \x1b[34m土 \x1b[30m \n"); /* 日曜は赤、土曜は青 */ | |
+ printf(" \x1b[31m日 \x1b[0m月 火 水 木 金 \x1b[34m土 \x1b[0m \n"); /* 日曜は赤、土曜は青 */ | |
printf("%*s", 3 * week_val, ""); /* 1日より左側のスペースを表示する */ | |
for(i = 1; i <= mdays; i++){ /* 月末まで */ | |
@@ -94,7 +94,7 @@ void month_print_calendar(int year, int month) | |
if(week_val == 6){ /* 土曜日である */ | |
printf("\x1b[34m%3d", i); /* その日を青で表示 */ | |
}else{ /* そうでなければ */ | |
- printf("\x1b[30m%3d", i); /* その日は黒で表示する */ | |
+ printf("\x1b[0m%3d", i); /* その日は黒で表示する */ | |
} | |
} | |
if(++week_val == 7){ /* 日曜日になったら */ | |
@@ -104,9 +104,9 @@ void month_print_calendar(int year, int month) | |
} | |
if(day_of_week(year, month, mdays) != 6){ /* 月末が土曜日以外なら(ファイルcalendar_main.c) */ | |
- printf("\x1b[30m\n\n"); /* 2行改行する */ | |
+ printf("\x1b[0m\n\n"); /* 3行改行する */ | |
}else{ /* 月末が土曜日である*/ | |
- printf("\x1b[30m\n"); /* 1行改行する */ | |
+ printf("\x1b[0m\n"); /* 1行改行する */ | |
} | |
for(i = 0; i < m_holidays; i++) { /* 祝日名を表示 */ | |
printf("%2s\n", holiday_name[i]); | |
@@ -159,7 +159,7 @@ void month_print_calendar_today(int year, int month, int day) | |
/* ここから処理コードの記述 */ | |
printf(" %d年%2d月\n", year, month); /* 年月を表示 */ | |
- printf(" \x1b[31m日 \x1b[30m月 火 水 木 金 \x1b[34m土 \x1b[0m \n"); /* 日曜は赤、土曜は青 */ | |
+ printf(" \x1b[31m日 \x1b[0m月 火 水 木 金 \x1b[34m土 \x1b[0m \n"); /* 日曜は赤、土曜は青 */ | |
printf("%*s", 3 * week_val, ""); /* 1日より左側のスペースを表示する */ | |
for(i = 1; i <= mdays; i++){ /* 月末まで */ | |
@@ -280,7 +280,7 @@ void row_calendar_main(int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_max, i | |
/* ここから処理コードの記述 */ | |
for(i = 0; i < COL_CAL; i++){ /* 曜日を表示する */ | |
- printf(" \x1b[31m日 \x1b[30m月 火 水 木 金 \x1b[34m土\x1b[m "); /* 日曜は赤、土曜は青 */ | |
+ printf(" \x1b[31m日 \x1b[0m月 火 水 木 金 \x1b[34m土\x1b[m "); /* 日曜は赤、土曜は青 */ | |
} | |
printf("\n"); | |
@@ -302,7 +302,7 @@ void row_calendar_main(int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_max, i | |
printf("\x1b[31m%3d", cal_buf[j][i][k]); /* 赤で表示 */ | |
index[j]++; /* 指定された月の次の要素に行く */ | |
}else{ /* そうでない */ | |
- printf("\x1b[30m%3d", cal_buf[j][i][k]); /* 黒で表示 */ | |
+ printf("\x1b[0m%3d", cal_buf[j][i][k]); /* 黒で表示 */ | |
} | |
} | |
} | |
@@ -318,7 +318,7 @@ void row_calendar_main(int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_max, i | |
} | |
printf(" "); /* 2文字分空白 */ | |
} | |
- printf("\x1b[30m\n"); | |
+ printf("\x1b[0m\n"); | |
} | |
} | |
@@ -358,7 +358,7 @@ void row_calendar_main_today(int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_ | |
/* ここから処理コードの記述 */ | |
for(i = 0; i < COL_CAL; i++){ /* 曜日を表示する */ | |
- printf(" \x1b[31m日 \x1b[30m月 火 水 木 金 \x1b[34m土\x1b[0m "); /* 日曜は赤、土曜は青 */ | |
+ printf(" \x1b[31m日 \x1b[0m月 火 水 木 金 \x1b[34m土\x1b[0m "); /* 日曜は赤、土曜は青 */ | |
} | |
printf("\n"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文字色を黒限定ではなく、前景の色にするように変更するパッチ付き。