]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI/fmi_xml_context.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / include / FMI / fmi_xml_context.h
1 /*\r
2     Copyright (C) 2012 Modelon AB\r
3 \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.
6 \r
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
11 \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
14 */\r
15 \r
16 \r
17 \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
20 **\r
21 */\r
22 \r
23 #ifndef FMI_XML_CONTEXT_H_\r
24 #define FMI_XML_CONTEXT_H_\r
25 \r
26 #include <stddef.h>\r
27 #include <JM/jm_callbacks.h>\r
28 #include <FMI/fmi_version.h>\r
29 \r
30 #ifdef __cplusplus\r
31 extern "C" {\r
32 #endif\r
33 \r
34 /** \addtogroup fmi_xml FMI XML parsing library.\r
35   @{\r
36   */\r
37 /**  \brief Library context is primarily used for handling callbacks\r
38 */\r
39 typedef struct fmi_xml_context_t fmi_xml_context_t;\r
40 \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
44 */\r
45 fmi_xml_context_t* fmi_xml_allocate_context( jm_callbacks* callbacks);\r
46 \r
47 /** \brief Free library context */\r
48 void fmi_xml_free_context(fmi_xml_context_t *context);\r
49 \r
50 void fmi_xml_set_configuration( fmi_xml_context_t* context, int configuration);\r
51 \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
54 \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
58 \r
59 /** \brief Parse FMI 1.0 XML file and create model description object.\r
60 \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
63 */\r
64 fmi1_xml_model_description_t* fmi1_xml_parse( fmi_xml_context_t* c, const char* fileName);\r
65 \r
66 /** \brief Parse FMI 2.0 XML file and create model description object.\r
67 \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
70 */\r
71 fmi2_xml_model_description_t* fmi2_xml_parse( fmi_xml_context_t* c, const char* fileName);\r
72 /** @} \r
73 */\r
74 #ifdef __cplusplus\r
75 }\r
76 #endif\r
77 #endif\r