?? rq_fpml_calculation_period_dates.c
字號:
/*** rq_fpml_calculation_period_dates.c**** Written by Brett Hutley - brett@hutley.net**** Copyright (C) 2001 Brett Hutley**** This file is part of the Risk Quantify Library**** Risk Quantify is free software; you can redistribute it and/or** modify it under the terms of the GNU Library General Public** License as published by the Free Software Foundation; either** version 2 of the License, or (at your option) any later version.**** Risk Quantify is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU** Library General Public License for more details.**** You should have received a copy of the GNU Library General Public** License along with Risk Quantify; if not, write to the Free** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*//* -- includes ----------------------------------------------------- */#include "fpml/rq_fpml_calculation_period_dates.h"#include <stdlib.h>/* -- code --------------------------------------------------------- */void rq_fpml_calculation_period_dates_init(struct rq_fpml_calculation_period_dates *calculation_period_dates){ rq_fpml_adjustable_date_init(&calculation_period_dates->effective_date); rq_fpml_adjustable_date_init(&calculation_period_dates->termination_date); rq_fpml_business_day_adjustments_init(&calculation_period_dates->calculation_period_dates_adjustments); calculation_period_dates->first_period_start_date = NULL; calculation_period_dates->first_regular_period_start_date = 0; calculation_period_dates->last_regular_period_end_date = 0; rq_fpml_calculation_period_frequency_init(&calculation_period_dates->calculation_period_frequency);}void rq_fpml_calculation_period_dates_clear(struct rq_fpml_calculation_period_dates *calculation_period_dates){ rq_fpml_adjustable_date_clear(&calculation_period_dates->effective_date); rq_fpml_adjustable_date_clear(&calculation_period_dates->termination_date); rq_fpml_business_day_adjustments_clear(&calculation_period_dates->calculation_period_dates_adjustments); if (calculation_period_dates->first_period_start_date) { rq_fpml_adjustable_date_free(calculation_period_dates->first_period_start_date); calculation_period_dates->first_period_start_date = NULL; } calculation_period_dates->first_regular_period_start_date = 0; calculation_period_dates->last_regular_period_end_date = 0; rq_fpml_calculation_period_frequency_clear(&calculation_period_dates->calculation_period_frequency);}intrq_fpml_calculation_period_dates_write_xml(struct rq_fpml_calculation_period_dates *p, rq_stream_t output_stream){ rq_stream_write_string(output_stream, "<calculationPeriodDates>"); rq_fpml_adjustable_date_write_xml(&p->effective_date, output_stream); rq_fpml_adjustable_date_write_xml(&p->termination_date, output_stream); rq_fpml_business_day_adjustments_write_xml(&p->calculation_period_dates_adjustments, output_stream); rq_fpml_calculation_period_frequency_write_xml(&p->calculation_period_frequency, output_stream); rq_stream_write_string(output_stream, "</calculationPeriodDates>"); return 0;}void rq_fpml_calculation_period_dates_free(struct rq_fpml_calculation_period_dates *calculation_period_dates){ rq_fpml_calculation_period_dates_clear(calculation_period_dates); free(calculation_period_dates);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -