⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rq_fpml_product_selection.c

📁 风险财务控制库 Risk Quantify is an open source financial library, with a focus on managing the risk of fi
💻 C
字号:
/*** rq_fpml_product_selection.c**** Written by Brett Hutley - brett@hutley.net**** Copyright (C) 2002 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*/#include "fpml/rq_fpml_product_selection.h"#include <stdlib.h>voidrq_fpml_product_selection_init(struct rq_fpml_product_selection *p){    p->bullet_payment = NULL;    p->cap_floor = NULL;    p->fra = NULL;    p->swap = NULL;    p->swaption = NULL;    p->fx_single_leg = NULL;    p->fx_swap = NULL;    p->fx_simple_option = NULL;    p->fx_barrier_option = NULL;    p->fx_digital_option = NULL;    p->fx_average_rate_option = NULL;    p->equity_option = NULL;    p->strategy = NULL;}voidrq_fpml_product_selection_clear(struct rq_fpml_product_selection *p){    if (p->bullet_payment)    {        rq_fpml_bullet_payment_clear(p->bullet_payment);        free(p->bullet_payment);        p->bullet_payment = NULL;    }        if (p->cap_floor)    {        rq_fpml_cap_floor_clear(p->cap_floor);        free(p->cap_floor);        p->cap_floor = NULL;    }        if (p->fra)    {        rq_fpml_fra_clear(p->fra);        free(p->fra);        p->fra = NULL;    }        if (p->swap)    {        rq_fpml_swap_clear(p->swap);        free(p->swap);        p->swap = NULL;    }        if (p->swaption)    {        rq_fpml_swaption_clear(p->swaption);        free(p->swaption);        p->swaption = NULL;    }        if (p->fx_single_leg)    {        rq_fpml_fx_leg_clear(p->fx_single_leg);        free(p->fx_single_leg);        p->fx_single_leg = NULL;    }        if (p->fx_swap)    {        rq_fpml_fx_swap_clear(p->fx_swap);        free(p->fx_swap);        p->fx_swap = NULL;    }        if (p->fx_simple_option)    {        rq_fpml_fx_option_leg_clear(p->fx_simple_option);        free(p->fx_simple_option);        p->fx_simple_option = NULL;    }        if (p->fx_barrier_option)    {        rq_fpml_fx_barrier_option_clear(p->fx_barrier_option);        free(p->fx_barrier_option);        p->fx_barrier_option = NULL;    }        if (p->fx_digital_option)    {        rq_fpml_fx_digital_option_clear(p->fx_digital_option);        free(p->fx_digital_option);        p->fx_digital_option = NULL;    }        if (p->fx_average_rate_option)    {        rq_fpml_fx_average_rate_option_clear(p->fx_average_rate_option);        free(p->fx_average_rate_option);        p->fx_average_rate_option = NULL;    }        if (p->equity_option)    {        rq_fpml_equity_option_clear(p->equity_option);        free(p->equity_option);        p->equity_option = NULL;    }        if (p->strategy)    {        rq_fpml_strategy_clear(p->strategy);        free(p->strategy);        p->strategy = NULL;    }    }intrq_fpml_product_selection_write_xml(struct rq_fpml_product_selection *p, rq_stream_t output_stream){    rq_stream_write_string(output_stream, "<productSelection>");    rq_fpml_bullet_payment_write_xml(p->bullet_payment, output_stream);    rq_fpml_cap_floor_write_xml(p->cap_floor, output_stream);    rq_fpml_fra_write_xml(p->fra, output_stream);    rq_fpml_swap_write_xml(p->swap, output_stream);    rq_fpml_swaption_write_xml(p->swaption, output_stream);    rq_fpml_fx_leg_write_xml(p->fx_single_leg, output_stream);    rq_fpml_fx_swap_write_xml(p->fx_swap, output_stream);    rq_fpml_fx_option_leg_write_xml(p->fx_simple_option, output_stream);    rq_fpml_fx_barrier_option_write_xml(p->fx_barrier_option, output_stream);    rq_fpml_fx_digital_option_write_xml(p->fx_digital_option, output_stream);    rq_fpml_fx_average_rate_option_write_xml(p->fx_average_rate_option, output_stream);    rq_fpml_equity_option_write_xml(p->equity_option, output_stream);    rq_fpml_strategy_write_xml(p->strategy, output_stream);    rq_stream_write_string(output_stream, "</productSelection>");    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -