X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.fmil.core%2Fnative%2FFMILibrary%2Fsrc%2FUtil%2Finclude%2FJM%2Fjm_types.h;fp=org.simantics.fmil.core%2Fnative%2FFMILibrary%2Fsrc%2FUtil%2Finclude%2FJM%2Fjm_types.h;h=2dc7293ce16a473c724dfe860859f2669cf7453b;hb=4bed8078f3f6d15b8539d7357b8815f8bfeec2c4;hp=0000000000000000000000000000000000000000;hpb=87cc423aefd98832c6c8d0979afc21551f8ceca3;p=simantics%2Ffmil.git diff --git a/org.simantics.fmil.core/native/FMILibrary/src/Util/include/JM/jm_types.h b/org.simantics.fmil.core/native/FMILibrary/src/Util/include/JM/jm_types.h new file mode 100644 index 0000000..2dc7293 --- /dev/null +++ b/org.simantics.fmil.core/native/FMILibrary/src/Util/include/JM/jm_types.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2012 Modelon AB + + This program is free software: you can redistribute it and/or modify + it under the terms of the BSD style license. + + This program 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 + FMILIB_License.txt file for more details. + + You should have received a copy of the FMILIB_License.txt file + along with this program. If not, contact Modelon AB . +*/ + +#ifndef JM_TYPES_H +#define JM_TYPES_H +#ifdef __cplusplus +extern "C" { +#endif +#include + +/** + @file jm_types.h Types used in the Utils module. + + */ +/** +\defgroup jm_utils Utilities +\addtogroup jm_utils + * @{ +*/ +/** \brief A constant string.*/ +typedef const char* jm_string; +/** \brief A void pointer.*/ +typedef void* jm_voidp; + +/** \brief Mapping between a string and an integer ID */ +typedef struct jm_name_ID_map_t { + jm_string name; + unsigned int ID; +} jm_name_ID_map_t; + +/** \brief Return status codes */ +typedef enum { + jm_status_error = -1, + jm_status_success = 0, + jm_status_warning = 1 +} jm_status_enu_t; + +/** \brief Log levels supported via the logger functions in ::jm_callbacks */ +typedef enum { + jm_log_level_nothing = 0, /** \brief Must be first in this enum. May be usefull in application relying solely on jm_get_last_error() */ + jm_log_level_fatal, /** \brief Unrecoverable errors */ + jm_log_level_error, /** \brief Errors that may be not critical for some FMUs. */ + jm_log_level_warning, /** \brief Non-critical issues */ + jm_log_level_info, /** \brief Informative messages */ + jm_log_level_verbose, /** \brief Verbose messages */ + jm_log_level_debug, /** \brief Debug messages. Only enabled if library is configured with FMILIB_ENABLE_LOG_LEVEL_DEBUG */ + jm_log_level_all /** \brief Must be last in this enum. */ +} jm_log_level_enu_t; + +/** \brief Convert log level into a string */ +FMILIB_EXPORT +const char* jm_log_level_to_string(jm_log_level_enu_t level); + +/** @} */ +#ifdef __cplusplus +} +#endif + +/* JM_TYPES_H */ +#endif