output_calendar.c

カレンダーを出力するプログラム [詳細]

#include <stdio.h>
#include <string.h>
#include <time.h>
#include "number_set.h"

関数

int day_of_week (int year, int month, int day)
int month_days (int year, int month)
int judge_month (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_days[HOLY_MAX])
void month_print_calendar (int year, int month)
void month_print_calendar_today (int year, int month, int day)
void print_calendar_three (int year[COL_CAL], int month[COL_CAL])
void row_calendar_main (int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_max, int holiday_num[COL_CAL][HOLY_MAX])
void row_calendar_main_today (int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int week_max, int holiday_num[COL_CAL][HOLY_MAX], int month, int day, int arr_month[COL_CAL])
void row_holiday (char holiday_name[COL_CAL][HOLY_MAX][HOLY_NAME], int hol_max)

説明

カレンダーを出力するプログラム

作者:
y_okamon
バージョン:
1.0(2007.04.25)
1.01(2008.02.19)
関数this_fiscal_cal内 1月〜3月はyear-1年度になるように修正
1.1(2008.10.14)
土曜は青、日祝日は赤で表示するための仕様変更について
(1)関数month_print_calendar、関数row_calendar_main 土日祝日に色を付けられるように変更
(2)関数month_print_calendarと関数input_ym_theeeに祝日日付を入れる配列を新に設定

カレンダーを横に3個表示するときの仕様変更
(1) 3ヶ月分の年月を配列に入れたことにより、関数print_three_calendar内、ループで処理し行数を削減
(2) 関数row_calendar_main内、型変更に伴う処理コードの書き換え
(3) 関数row_calendar_mainが参照される関数を関数print_three_calendarから関数input_ym_threeに変更
(4) (3)から関数print_three_calendarの仮引数の数の削減に成功

その他の仕様変更
(1) カレンダー操作部分をファイルopreate_calendar.cに移行
(2) 関数row_calendar_main、関数row_calendar_main_todayから祝日表示部分を関数row_holidayに移行


関数

int day_of_week ( int  year,
int  month,
int  day 
)

機能
year年month月day日の曜日をツェラーの公式で算出して求める

引数:
year 
month 
day 
戻り値:
曜日 

被参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_s64_1
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_h1_1
ファイルcalendar_main.c内 関数make_calendar
ファイルcalendar_main.c内 関数make_three_calendar_1989
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Feb_holiday
ファイルinsert_holidays.c内 関数Mar_holiday
ファイルinsert_holidays.c内 関数Api_holiday
ファイルinsert_holidays.c内 関数May_holiday
ファイルinsert_holidays.c内 関数Jul_holiday
ファイルinsert_holidays.c内 関数Sep_holiday
ファイルinsert_holidays.c内 関数Oct_holiday
ファイルinsert_holidays.c内 関数Nov_holiday
ファイルinsert_holidays.c内 関数Dec_holiday

参照自作関数
なし

int judge_month ( int  year,
int  month,
char  holiday_name[HOLY_MAX][HOLY_NAME],
int  holiday_num[HOLY_MAX] 
)

機能
入力された月による祝日有無を判定する

引数:
year 
month 
holiday_name[][] 祝日名代入する配列
holiday_num[][] 祝日日付代入配列(Ver1.1)
戻り値:
m_holidays 月ごとの祝日日数を返す

被参照自作関数
ファイルcalendar_main.c内 関数make_calendar
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today

参照自作関数
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Feb_holiday
ファイルinsert_holidays.c内 関数Mar_holiday
ファイルinsert_holidays.c内 関数Api_holiday
ファイルinsert_holidays.c内 関数May_holiday
ファイルinsert_holidays.c内 関数Jul_holiday
ファイルinsert_holidays.c内 関数Sep_holiday
ファイルinsert_holidays.c内 関数Oct_holiday
ファイルinsert_holidays.c内 関数Nov_holiday
ファイルinsert_holidays.c内 関数Dec_holiday

int month_days ( int  year,
int  month 
)

機能
year年month月の月日数を取得する

引数:
year 
month 
戻り値:
月日数 

被参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_h1_1
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_three_calendar_1989

参照自作関数
ファイルcalendar_main.c内 関数is_leap

備考
2月のみ閏年は29日、平年は28日

void month_print_calendar ( int  year,
int  month 
)

機能
year年month月のカレンダーを祝日とともに表示する

処理詳細 
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(4) 祝日名を表示する

引数:
year 
month 

被参照自作関数
ファイルopreate_calendar.c内 関数next_month_cal
ファイルopreate_calendar.c内 関数before_month_cal
ファイルghcal.c内 関数argcheck

参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_holidays.c内 関数judge_month

void month_print_calendar_today ( int  year,
int  month,
int  day 
)

機能
year年month月のカレンダーを祝日とともに表示し、システム上の日付の日を白抜きにする

処理詳細 
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(3.4) システム上の日付なら文字色と背景色を反転
(4) 祝日名を表示する

引数:
year 
month 
day 

被参照自作関数
ファイルopreate_calendar.c内 関数this_month_cal

参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days

void print_calendar_three ( int  year[COL_CAL],
int  month[COL_CAL] 
)

機能 指定された3ヶ月分の年と月を表示する

処理詳細
(1) 指定された3ヶ月分の年と月をバッファに入れる
(2) バッファを横に表示する

引数:
year[] 
month[] 

被参照自作関数
ファイルopreate_calendar.c 関数input_ym_three
ファイルorpeate_calendar.c 関数input_ym_three_today

参照自作関数
なし

void row_calendar_main ( int  cal_buf[COL_CAL][WEEK_ROW][WEEK_COL],
int  week_max,
int  holiday_num[COL_CAL][HOLY_MAX] 
)

機能
カレンダーを横に表示させる

処理詳細
(1) 曜日を表示
(2) 日付を曜日ごと、祝日ごとに色分けする

引数:
cal_buf[][][] カレンダーバッファ
week_max 最大週数
holiday_num[][] 日付代入配列

被参照自作関数
ファイルopreate_calendar.c内 関数input_ym_three
ファイルopreate_calendar.c内 関数input_ym_three_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
ファイルopreate_calendar_gengoh.c内 関数input_1989_three

参照自作関数
なし

void row_calendar_main_today ( int  cal_buf[COL_CAL][WEEK_ROW][WEEK_COL],
int  week_max,
int  holiday_num[COL_CAL][HOLY_MAX],
int  month,
int  day,
int  arr_month[COL_CAL] 
)

機能
カレンダーを横に表示させる

処理詳細
(1) 曜日を表示
(2) 日付を曜日ごと、祝日ごとに色分けする
(3) システム上の日付を文字色と背景色と反転
(4) 祝日を表示する

引数:
cal_buf[][][] カレンダーバッファ
week_max 最大週数
holiday_num[][] 日付代入配列
month システム上の月
day システム上の年
arr_month 3ヶ月分の月

被参照自作関数
ファイルorpeate_calendar.c内 関数input_ym_three_today
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_today_gengoh

参照自作関数
なし

void row_holiday ( char  holiday_name[COL_CAL][HOLY_MAX][HOLY_NAME],
int  hol_max 
)

機能
3ヶ月分の祝日を横に表示させる

引数:
holiday_name[][][] 祝日
hol_max 最大祝日日数

被参照自作関数
ファイルopreate_calendar.c内 関数input_ym_three
ファイルopreate_calendar.c内 関数input_ym_three_today

参照自作関数
なし


13 Aug 2011に生成されました。  doxygen 1.6.1