2 Copyright (C) 2012 Modelon AB
\r
4 This program is free software: you can redistribute it and/or modify
\r
5 it under the terms of the BSD style license.
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
10 FMILIB_License.txt file for more details.
\r
12 You should have received a copy of the FMILIB_License.txt file
\r
13 along with this program. If not, contact Modelon AB <http://www.modelon.com>.
\r
18 /** \file fmi_xml_context.h
\r
19 * \brief XML context is the entry point to the library. It is used to initialize, get FMI version and start parsing.
\r
23 #ifndef FMI_XML_CONTEXT_H_
\r
24 #define FMI_XML_CONTEXT_H_
\r
27 #include <JM/jm_callbacks.h>
\r
28 #include <FMI/fmi_version.h>
\r
34 /** \addtogroup fmi_xml FMI XML parsing library.
\r
37 /** \brief Library context is primarily used for handling callbacks
\r
39 typedef struct fmi_xml_context_t fmi_xml_context_t;
\r
41 /** \brief Allocate library context
\r
42 @param callbacks - the callbacks to be used for memory allocation and logging. Can be NULL if default callbacks are to be used.
\r
43 @return A pointer to the newly allocated ::fmi_xml_context_t or NULL if memory allocation failed.
\r
45 fmi_xml_context_t* fmi_xml_allocate_context( jm_callbacks* callbacks);
\r
47 /** \brief Free library context */
\r
48 void fmi_xml_free_context(fmi_xml_context_t *context);
\r
50 void fmi_xml_set_configuration( fmi_xml_context_t* context, int configuration);
\r
52 /** \brief Parse XML file to identify FMI standard version (only beginning of the file is parsed). */
\r
53 fmi_version_enu_t fmi_xml_get_fmi_version( fmi_xml_context_t*, const char* fileName);
\r
55 /** ModelDescription is the entry point for the package*/
\r
56 typedef struct fmi1_xml_model_description_t fmi1_xml_model_description_t;
\r
57 typedef struct fmi2_xml_model_description_t fmi2_xml_model_description_t;
\r
59 /** \brief Parse FMI 1.0 XML file and create model description object.
\r
61 Errors are reported via the ::jm_callbacks object passed to fmi_xml_allocate_context().
\r
62 @return Model description object or NULL if parsing failed.
\r
64 fmi1_xml_model_description_t* fmi1_xml_parse( fmi_xml_context_t* c, const char* fileName);
\r
66 /** \brief Parse FMI 2.0 XML file and create model description object.
\r
68 Errors are reported via the ::jm_callbacks object passed to fmi_xml_allocate_context().
\r
69 @return Model description object or NULL if parsing failed.
\r
71 fmi2_xml_model_description_t* fmi2_xml_parse( fmi_xml_context_t* c, const char* fileName);
\r