📄 rq_fpml_equity.c
字号:
/*** rq_fpml_equity.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_equity.h"#include <stdlib.h>voidrq_fpml_equity_init(struct rq_fpml_equity *p){ p->description = NULL; p->instrument_id = NULL; p->currency = NULL; p->exchange_id = NULL; p->related_exchange_id = NULL; p->clearance_system = NULL;}voidrq_fpml_equity_clear(struct rq_fpml_equity *p){ if (p->description) { free((char *)p->description); p->description = NULL; } if (p->instrument_id) { free((char *)p->instrument_id); p->instrument_id = NULL; } if (p->currency) { free((char *)p->currency); p->currency = NULL; } if (p->exchange_id) { free((char *)p->exchange_id); p->exchange_id = NULL; } if (p->related_exchange_id) { free((char *)p->related_exchange_id); p->related_exchange_id = NULL; } if (p->clearance_system) { free((char *)p->clearance_system); p->clearance_system = NULL; }}intrq_fpml_equity_write_xml(struct rq_fpml_equity *p, rq_stream_t output_stream){ rq_stream_write_string(output_stream, "<equity>"); rq_stream_write_string(output_stream, "<description>"); rq_stream_write_string(output_stream, p->description); rq_stream_write_string(output_stream, "</description>"); rq_stream_write_string(output_stream, "<instrumentId>"); rq_stream_write_string(output_stream, p->instrument_id); rq_stream_write_string(output_stream, "</instrumentId>"); rq_stream_write_string(output_stream, "<currency>"); rq_stream_write_string(output_stream, p->currency); rq_stream_write_string(output_stream, "</currency>"); rq_stream_write_string(output_stream, "<exchangeId>"); rq_stream_write_string(output_stream, p->exchange_id); rq_stream_write_string(output_stream, "</exchangeId>"); rq_stream_write_string(output_stream, "<relatedExchangeId>"); rq_stream_write_string(output_stream, p->related_exchange_id); rq_stream_write_string(output_stream, "</relatedExchangeId>"); rq_stream_write_string(output_stream, "<clearanceSystem>"); rq_stream_write_string(output_stream, p->clearance_system); rq_stream_write_string(output_stream, "</clearanceSystem>"); rq_stream_write_string(output_stream, "</equity>"); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -