カレンダー本体プログラム [詳細]
#include <stdio.h>
#include <string.h>
#include "number_set.h"
関数 | |
void | reset (int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL]) |
int | judge_month_1989 (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_num[HOLY_MAX]) |
int | is_leap (int year) |
int | month_days (int year, int month) |
int | day_of_week (int year, int month, int day) |
void | make_three_calendar (int year[COL_CAL], int month[COL_CAL], int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int *week_row) |
void | make_three_calendar_1989 (int year[COL_CAL], int month[COL_CAL], int cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], int *week_row) |
void | make_holiday (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_num[HOLY_MAX], int *max_holidays) |
void | make_holiday_1989 (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_num[HOLY_MAX], int *max_holidays) |
カレンダー本体プログラム
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 is_leap | ( | int | year | ) |
機能
年が閏年かどうかを調べる
year | 年 |
1 | 閏年 | |
0 | 閏年ではない |
被参照自作関数
ファイルcalendar_main.c内 関数month_days
参照自作関数
なし
備考
閏年の定義
(1) 400で割り切れる年
(2) 4で割れてかつ100で割り切れない年
このどちらかであれば閏年である
int judge_month_1989 | ( | int | year, | |
int | month, | |||
char | holiday_name[HOLY_MAX][HOLY_NAME], | |||
int | holiday_num[HOLY_MAX] | |||
) |
機能
入力された月による祝日有無を判定する(平成元年1月~3月)
year | 年 | |
month | 月 | |
holiday_name[][] | 祝日名代入する配列 | |
holiday_num[][] | 祝日日付代入配列(Ver1.1) |
m_holidays | 月ごとの祝日日数を返す |
被参照自作関数
ファイルcalendar_main.c内 関数make_calendar_1989
参照自作関数
ファイルinsert_holidays.c内 関数Jan_holiday_1989
ファイルinsert_holidays.c内 関数Feb_holiday
ファイルinsert_holidays.c内 関数Mar_holiday
void make_holiday | ( | int | year, | |
int | month, | |||
char | holiday_name[HOLY_MAX][HOLY_NAME], | |||
int | holiday_num[HOLY_MAX], | |||
int * | max_holidays | |||
) |
機能
year年month月の祝日名と祝日日付を代入する
year | 年 | |
month | 月 | |
holiday_name[][] | 祝日表示バッファ | |
*max_holidays | 3ヶ月間の最大祝日日数 | |
holiday_num[][] | 日付代入変数 |
被参照自作関数
ファイルopreate_calendar.c内 関数input_ym_three
ファイルopreate_calendar.c内 関数input_ym_three_today
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_today_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_1989_three
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_holidays.c内 関数judge_month
void make_holiday_1989 | ( | int | year, | |
int | month, | |||
char | holiday_name[HOLY_MAX][HOLY_NAME], | |||
int | holiday_num[HOLY_MAX], | |||
int * | max_holidays | |||
) |
機能
1989年1,2,3月の祝日名と祝日日付を代入する
year | 年 | |
month | 月 | |
holiday_name[][] | 祝日表示バッファ | |
*max_holidays | 3ヶ月間の最大祝日日数 | |
holiday_num[][] | 日付代入変数 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_holidays.c内 関数judge_month_1989
void make_three_calendar | ( | int | year[COL_CAL], | |
int | month[COL_CAL], | |||
int | cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], | |||
int * | week_row | |||
) |
機能
year年month月からの3ヶ月カレンダーを3次元配列配列に代入する
処理詳細
(1) 初日の曜日を取得する
(2) 月日数を取得する
(3) 3ヶ月分のカレンダーを入れる
year[] | 年 | |
month[] | 月 | |
cal_buf | [][][] カレンダーバッファ | |
*week_row | 週の行数 |
被参照自作関数
ファイルopreate_calendar.c内 関数input_ym_three
ファイルopreate_calendar.c内 関数input_ym_three_today
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_today_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_1989_three
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルcalendar_main.c内 関数reset
void make_three_calendar_1989 | ( | int | year[COL_CAL], | |
int | month[COL_CAL], | |||
int | cal_buf[COL_CAL][WEEK_ROW][WEEK_COL], | |||
int * | week_row | |||
) |
機能
1989年1月からの3ヶ月カレンダーを3次元配列配列に代入する
処理詳細
(1) 初日の曜日を取得する
(2) 月日数を取得する
(3) 3ヶ月分のカレンダーを入れる
year[] | 年 | |
month[] | 月 | |
cal_buf | [][][] カレンダーバッファ | |
*week_row | 週の行数 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルcalendar_main.c内 関数reset
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 reset | ( | int | cal_buf[COL_CAL][WEEK_ROW][WEEK_COL] | ) |
機能
配列を初期化する
cal_buf | [][] カレンダーバッファ |
被参照自作関数
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_three_calendar_1989
参照自作関数
なし