カレンダーを出力するプログラム [詳細]
#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) |
カレンダーを出力するプログラム
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
参照自作関数
なし