カレンダー操作プログラム(元号版) [詳細]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "number_set.h"
関数 | |
int | judge_month (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_days[HOLY_MAX]) |
DAY_DATE | get_today () |
void | row_holiday (char holiday_name[COL_CAL][HOLY_MAX][HOLY_NAME], int hol_max) |
void | year_month_gengoh_check (char chyear[10], char chmonth[10], int *year, int *month, int *gengoh) |
void | year_gengoh_check (char chmonth[10], int *year, int *gengoh) |
void | opreate_year_gengoh (char chyear[10]) |
void | input_1989_cal_gengoh (int year) |
void | month_print_calendar_h1_1 (int year, int month) |
void | month_print_calendar_s64_1 (int year, int month) |
void | print_calendar_three_1989 (int year[COL_CAL], int month[COL_CAL]) |
void | month_check (int month) |
void | syowa_year_mes () |
void | heisei_year_mes () |
void | syowa_fiscal_mes () |
void | heisei_fiscal_mes () |
void | input_ym_three_gengoh (int year, int month) |
void | input_ym_three_today_gengoh (int year, int month, DAY_DATE today) |
void | input_year_cal_gengoh (int year) |
void | input_fiscal_cal_gengoh (int year) |
void | input_1989_three (int year, int month) |
void | input_1989_1to3 (int year, int month) |
void | input_fiscal_1988 (int year) |
void | input_fiscal_1989 (int year) |
void | year_fiscal_check (char chyear[10], int *year, int *gengoh) |
void | make_holiday_1989 (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_num[HOLY_MAX], int *max_holidays) |
void | this_month_cal_gengoh () |
void | next_month_cal_gengoh () |
void | before_month_cal_gengoh () |
void | opreate_year_month_gengoh (char chyear[10], char chmonth[10]) |
void | this_year_cal_gengoh () |
void | next_year_cal_gengoh () |
void | before_year_cal_gengoh () |
void | opreate_fiscal_gengoh (char chyear[10]) |
void | this_fiscal_cal_gengoh () |
void | next_fiscal_cal_gengoh () |
void | before_fiscal_cal_gengoh () |
カレンダー操作プログラム(元号版)
void before_fiscal_cal_gengoh | ( | ) |
機能
前年度のカレンダーを表示する
処理詳細
(1) システム上の年と月を取得する
(2) 年をマイナス1する。 (3) 取得した月が1月〜3月の間であったら、年を1年マイナス
(4) 取得した年をinput_year_cal関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh内 関数input_fiscal_cal_gengoh
ファイルopreate_calendar.c内 関数get_today
void before_month_cal_gengoh | ( | ) |
機能
先月のカレンダーを表示する
処理詳細
(1) システム上の年月を取得する。
(2) 取得した年月を関数month_print_calendarで処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルopreate_calendar.c内 関数get_today
void before_year_cal_gengoh | ( | ) |
機能
昨年の年間カレンダーを表示する
処理詳細
(1) システム上の年を取得する
(2) 取得した年から1を引いた年をinput_year_cal_gengoh関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_year_cal_gengoh
ファイルopreate_calendar.c内 関数get_today
DAY_DATE get_today | ( | ) |
機能
システム上の年月日を取得する
today | 本日の日付が入った構造体型変数 |
被参照自作関数
ファイルopreate_calendar.c内 関数this_month_cal
ファイルopreate_calendar.c内 関数next_month_cal
ファイルopreate_calendar.c内 関数before_month_cal
ファイルopreate_calendar.c内 関数this_year_cal
ファイルopreate_calendar.c内 関数next_year_cal
ファイルopreate_calendar.c内 関数before_year_cal
ファイルopreate_calendar.c内 関数this_fiscal_cal
ファイルopreate_calendar.c内 関数next_fiscal_cal
ファイルopreate_calendar.c内 関数before_fiscal_cal
ファイルopreate_calendar.c内 関数this_three_month
ファイルopreate_calendar_gengoh.c内 関数this_month_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数next_month_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数before_month_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数this_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数next_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数before_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数this_fiscal_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数next_fiscal_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数before_year_cal_gengoh
参照自作関数
なし
void heisei_fiscal_mes | ( | ) |
機能
平成の使用可能な年の数値を表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_fiscal_check
参照自作関数
なし
void heisei_year_mes | ( | ) |
機能
平成の使用可能な年の数値を表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_month_gengoh_check
参照自作関数
なし
void input_1989_1to3 | ( | int | year, | |
int | month | |||
) |
機能 平成元年の表示する
year | 年 | |
month | 年 |
被参照自作関数
ファイルopreate_calendar_gengoh内 関数input_1989_cal_gengoh
参照自作関数
ファイルcalendar_main.c内 関数make_array
ファイルcalendar_main.c内 関数make_three_calendar_1989
ファイルcalendar_main.c内 関数make_holiday_1989
ファイルoutput_calendar_gengoh.c内 関数print_calendar_three_1989
ファイルoutput_calendar.c内 関数row_calendar_main
ファイルoutput_calendar.c内 関数row_holiday
void input_1989_cal_gengoh | ( | int | year | ) |
機能
平成元年(1989年)年間カレンダーを表示させる
year | 年 |
被参照自作関数
ファイルopreate_calendar_gengoh内 関数opreate_year_gengoh
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
ファイルopreate_calendar_gengoh.c内 関数input_1989_three
void input_1989_three | ( | int | year, | |
int | month | |||
) |
機能 1989年の4月~12月までのの3ヶ月カレンダーを表示する
year | 年 | |
month | 年 |
被参照自作関数
ファイルoutput_calendar_gengoh.c内 関数input_cal_1989_gengoh
ファイルoutput_calendar_gengoh.c内 関数input_fiscal_1988
ファイルoutput_calendar_gengoh.c内 関数input_fiscal_1989
参照自作関数
ファイルcalendar_main.c内 関数make_array
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_holiday
ファイルoutput_calendar_gengoh.c内 関数print_calendar_three_1989
ファイルoutput_calendar.c内 関数row_calendar_main
ファイルoutput_calendar.c内 関数row_holiday
void input_fiscal_1988 | ( | int | year | ) |
機能
昭和63年度のカレンダーを表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_fiscal_gengoh
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_1989_three
void input_fiscal_1989 | ( | int | year | ) |
機能
平成元年度のカレンダーを表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_fiscal_gengoh
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_1989_three
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
void input_fiscal_cal_gengoh | ( | int | year | ) |
機能
入力された年の年度カレンダーを表示させる
year | 年 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数next_fiscal_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数before_fiscal_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数opreate_fiscal_gengoh
参照自作関数
ファイルopeate_calendar_gengoh.c内 関数input_ym_three_gengoh
void input_year_cal_gengoh | ( | int | year | ) |
機能
入力された年の年間カレンダーを表示させる
処理詳細
横に3ヶ月分のカレンダーを表示する。
year | 年 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数next_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数before_year_cal_gengoh
ファイルopreate_calendar_gengoh内 関数opreate_year_gengoh
参照自作関数
ファイルoutput_calendar_gengoh.c内 関数input_ym_three_gengoh
void input_ym_three_gengoh | ( | int | year, | |
int | month | |||
) |
機能 先月、今月、来月の3ヶ月カレンダーを表示する(元号版)
処理詳細 (1) 入力/システムから獲得した月によって以下の処理をする。
(1.1) 月が1月なら、前年の12月からシステム上の年の2月までのカレンダーを作る。
(1.2) 月が12月なら、11月から翌年の1月までのカレンダーを作る。
(1.3) それ以外の月なら、前の月から翌月までのカレンダーを作る。
(2) 3ヶ月分のカレンダーが作成したら、横にカレンダーを表示する
year | 年 | |
month | 年 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_1988
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_1989
参照自作関数
ファイルopreate_calendar.c内 関数make_array
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_holiday
ファイルoutput_calendar_gengoh.c内 関数print_calendar_three_gengoh
ファイルoutput_calendar.c内 関数row_calendar_main
ファイルoutput_calendar.c内 関数row_holiday
void input_ym_three_today_gengoh | ( | int | year, | |
int | month, | |||
DAY_DATE | today | |||
) |
機能 先月、今月、来月の3ヶ月カレンダーを表示する(元号版)
処理詳細 (1) 入力/システムから獲得した月によって以下の処理をする。
(1.1) 月が1月なら、前年の12月からシステム上の年の2月までのカレンダーを作る。
(1.2) 月が12月なら、11月から翌年の1月までのカレンダーを作る。
(1.3) それ以外の月なら、前の月から翌月までのカレンダーを作る。
(2) 3ヶ月分のカレンダーが作成したら、横にカレンダーを表示する
year | 年 | |
month | 月 | |
today | システム上の日付 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数this_year_gengoh
ファイルopreate_calendar_gengoh.c内 関数this_fiscal_gengoh
参照自作関数
ファイルopreate_calendar.c内 関数make_array
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_holiday
ファイルoutput_calendar_gengoh.c内 関数print_calendar_three_gengoh
ファイルoutput_calendar.c内 関数row_calendar_main
ファイルoutput_calendar.c内 関数row_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
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 month_check | ( | int | month | ) |
機能
入力された月の有効範囲をチェックする
month | 月 |
被参照自作関数
ファイルghcal.c内 関数year_month_check_main
参照自作関数
ファイルerror_mes.c内 関数month_mes
ファイルopreate_calendar_gengoh.c内 関数year_month_gengoh_check
void month_print_calendar_h1_1 | ( | int | year, | |
int | month | |||
) |
機能
year年month月のカレンダーを祝日とともに表示する
処理詳細
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(4) 祝日名を表示する
year | 年 | |
month | 月 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_month_gengoh
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_hoildays.c内 関数judge_months
void month_print_calendar_s64_1 | ( | int | year, | |
int | month | |||
) |
機能
year年month月のカレンダーを祝日とともに表示する
処理詳細
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(4) 祝日名を表示する
year | 年 | |
month | 月 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_month_gengoh
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_holidays.c内 関数judge_month
void next_fiscal_cal_gengoh | ( | ) |
機能
翌年度のカレンダーを表示する
処理詳細
(1) システム上の年と月を取得する
(2) 年をプラス1する。
(3) 取得した月が1月〜3月の間であったら、年を1年マイナス
(4) 取得した年をinput_year_cal関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_cal_gengoh
ファイルopreate_calendar内 関数get_today
void next_month_cal_gengoh | ( | ) |
機能
来月のカレンダーを元号で表示する
処理詳細
(1) システム上の年月を取得する。
(2) 取得した年月を関数month_print_calendarで処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルopreate_calendar.c内 関数get_today
void next_year_cal_gengoh | ( | ) |
機能
翌年の年間カレンダーを表示する
処理詳細
(1) システム上の年を取得する
(2) 取得した年+1をinput_year_cal_gengoh関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_year_cal_gengoh
ファイルopreate_calendar.c内 関数get_today
void opreate_fiscal_gengoh | ( | char | chyear[10] | ) |
機能
year(元号形式)年のカレンダーを出すための操作を行う関数
chyear[] | 年 |
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_fiscal_check
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_1989
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_1988
ファイルopreate_calendar_gengoh.c内 関数input_fiscal_gengoh
void opreate_year_gengoh | ( | char | chyear[10] | ) |
機能
year(元号形式)年のカレンダーを出すための操作を行う関数
chyear[] | 年 |
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_gengoh_check
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_s64_1
ファイルopreate_calendar_gengoh.c内 関数input_year_cal_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_1989_cal_gengoh
void opreate_year_month_gengoh | ( | char | chyear[10], | |
char | chmonth[10] | |||
) |
機能
year(元号形式)年month月のカレンダーを出すための操作を行う関数
chyear[] | 年 | |
chmonth[] | 月 |
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_month_gengoh_check
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_s64_1
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_h1_1
void print_calendar_three_1989 | ( | int | year[COL_CAL], | |
int | month[COL_CAL] | |||
) |
機能 指定された3ヶ月分の年と月を表示する(平成元年版)
処理詳細
(1) 指定された3ヶ月分の年と月をバッファに入れる
(2) バッファを横に表示する
year[] | 年 | |
month[] | 月 |
被参照自作関数
ファイルopreate_calendar.c内 関数input_1989_three
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
参照自作関数
なし
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
参照自作関数
なし
void syowa_fiscal_mes | ( | ) |
機能
昭和の使用可能な年度を表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_fiscal_check
参照自作関数
なし
void syowa_year_mes | ( | ) |
機能
昭和の使用可能な年の数値を表示する
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数year_month_gengoh_check
参照自作関数
なし
void this_fiscal_cal_gengoh | ( | ) |
機能
今年度のカレンダーを表示する
処理詳細
(1) システム上の年と月を取得する
(2) 取得した月が1月〜3月の間であったら、年を1年マイナス
(3) 取得した年をinput_year_cal関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_today_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルopreate_calendar.c内 関数get_today
void this_month_cal_gengoh | ( | ) |
機能
今月のカレンダーを元号で表記する
処理詳細
(1) システム上の年月を取得する。
(2) 取得した年月を関数month_print_calendar_today_gengohで処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar_today
ファイルopreate_calendar.c内 関数get_today
void this_year_cal_gengoh | ( | ) |
機能
今年の年間カレンダーを表示する
処理詳細
(1) システム上の年を取得する
(2) 取得した年をinput_year_cal関数で処理
被参照自作関数
ファイルghcal.c内 関数argcheck
参照自作関数
ファイルoutput_calendar_gengoh.c内 関数input_ym_three_today_gengoh
ファイルoutput_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルoutput_calendar.c内 関数get_today
void year_fiscal_check | ( | char | chyear[10], | |
int * | year, | |||
int * | gengoh | |||
) |
機能
入力された元号年度の使用範囲をチェックする
chyear | 年 | |
*year | 数値化された西暦 | |
*gengoh | 数値化された元号 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_fiscal_gengoh
参照自作関数
ファイルerror_mes.c内 関数showa_fiscal_mes
ファイルerror_mes.c内 関数heisei_fiscal_mes
void year_gengoh_check | ( | char | chyear[10], | |
int * | year, | |||
int * | gengoh | |||
) |
機能
入力されたコマンドの利用範囲が正しいかどうか調べる
chyear[] | 年 | |
*year | 数値化された西暦 | |
*gengoh | 数値化された元号 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_gengoh
参照自作関数
ファイルerror_mes.c内 関数syowa_year_mes(); ファイルerror_mes.c内 関数heisei_year_mes();
void year_month_gengoh_check | ( | char | chmonth[10], | |
char | chyear[10], | |||
int * | year, | |||
int * | month, | |||
int * | gengoh | |||
) |
機能
入力されたコマンドの利用範囲が正しいかどうか調べる
chyear[] | 年 | |
chmonth[] | 月 | |
*year | 数値化された西暦 | |
*month | 数値化された月 | |
*gengoh | 数値化された元号 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_month_gengoh
参照自作関数
ファイルerror_mes.c内 関数syowa_year_mes
ファイルerror_mes.c内 関数heisei_year_mes
ファイルghcal.c内 関数month_check