]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI/fmi_xml_context.h
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / include / FMI / fmi_xml_context.h
diff --git a/org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI/fmi_xml_context.h b/org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI/fmi_xml_context.h
new file mode 100644 (file)
index 0000000..c61b7f0
--- /dev/null
@@ -0,0 +1,77 @@
+/*\r
+    Copyright (C) 2012 Modelon AB\r
+\r
+    This program is free software: you can redistribute it and/or modify\r
+    it under the terms of the BSD style license.
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    FMILIB_License.txt file for more details.\r
+\r
+    You should have received a copy of the FMILIB_License.txt file\r
+    along with this program. If not, contact Modelon AB <http://www.modelon.com>.\r
+*/\r
+\r
+\r
+\r
+/** \file fmi_xml_context.h\r
+*  \brief XML context is the entry point to the library. It is used to initialize, get FMI version and start parsing.\r
+**\r
+*/\r
+\r
+#ifndef FMI_XML_CONTEXT_H_\r
+#define FMI_XML_CONTEXT_H_\r
+\r
+#include <stddef.h>\r
+#include <JM/jm_callbacks.h>\r
+#include <FMI/fmi_version.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/** \addtogroup fmi_xml FMI XML parsing library.\r
+  @{\r
+  */\r
+/**  \brief Library context is primarily used for handling callbacks\r
+*/\r
+typedef struct fmi_xml_context_t fmi_xml_context_t;\r
+\r
+/** \brief Allocate library context \r
+       @param callbacks - the callbacks to be used for memory allocation and logging. Can be NULL if default callbacks are to be used.\r
+       @return A pointer to the newly allocated ::fmi_xml_context_t or NULL if memory allocation failed.\r
+*/\r
+fmi_xml_context_t* fmi_xml_allocate_context( jm_callbacks* callbacks);\r
+\r
+/** \brief Free library context */\r
+void fmi_xml_free_context(fmi_xml_context_t *context);\r
+\r
+void fmi_xml_set_configuration( fmi_xml_context_t* context, int configuration);\r
+\r
+/** \brief Parse XML file to identify FMI standard version (only beginning of the file is parsed). */\r
+fmi_version_enu_t fmi_xml_get_fmi_version( fmi_xml_context_t*, const char* fileName);\r
+\r
+/** ModelDescription is the entry point for the package*/\r
+typedef struct fmi1_xml_model_description_t fmi1_xml_model_description_t;\r
+typedef struct fmi2_xml_model_description_t fmi2_xml_model_description_t;\r
+\r
+/** \brief Parse FMI 1.0 XML file and create model description object.\r
+\r
+       Errors are reported via the ::jm_callbacks object passed to fmi_xml_allocate_context().\r
+       @return Model description object or NULL if parsing failed.\r
+*/\r
+fmi1_xml_model_description_t* fmi1_xml_parse( fmi_xml_context_t* c, const char* fileName);\r
+\r
+/** \brief Parse FMI 2.0 XML file and create model description object.\r
+\r
+       Errors are reported via the ::jm_callbacks object passed to fmi_xml_allocate_context().\r
+       @return Model description object or NULL if parsing failed.\r
+*/\r
+fmi2_xml_model_description_t* fmi2_xml_parse( fmi_xml_context_t* c, const char* fileName);\r
+/** @} \r
+*/\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif\r