]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMUSimulator/include/FMIL/Util/JM/jm_types.h
Renamed org.simantics.fmil to org.simantics.fmil.core to prevent having bundles and...
[simantics/fmil.git] / org.simantics.fmil.core / native / FMUSimulator / include / FMIL / Util / JM / jm_types.h
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
7      This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     FMILIB_License.txt file for more details.
11
12     You should have received a copy of the FMILIB_License.txt file
13     along with this program. If not, contact Modelon AB <http://www.modelon.com>.
14 */
15
16 #ifndef JM_TYPES_H
17 #define JM_TYPES_H
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 #include <fmilib_config.h>
22
23 /**
24         @file jm_types.h Types used in the Utils module.
25
26         */
27 /** 
28 \defgroup jm_utils Utilities 
29 \addtogroup jm_utils
30   * @{
31 */
32 /** \brief A constant string.*/
33 typedef const char* jm_string;
34 /** \brief A void pointer.*/
35 typedef void* jm_voidp;
36
37 /** \brief Mapping between a string and an integer ID */
38 typedef struct jm_name_ID_map_t {
39     jm_string name;
40     unsigned int ID;
41 } jm_name_ID_map_t;
42
43 /** \brief Return status codes */
44 typedef enum {  
45         jm_status_error = -1,
46         jm_status_success = 0,
47         jm_status_warning = 1
48 } jm_status_enu_t;
49
50 /** \brief Log levels supported via the logger functions in ::jm_callbacks */
51 typedef enum {  
52         jm_log_level_nothing = 0, /** \brief Must be first in this enum. May be usefull in application relying solely on jm_get_last_error() */
53         jm_log_level_fatal, /** \brief Unrecoverable errors */
54         jm_log_level_error, /** \brief Errors that may be not critical for some FMUs. */
55         jm_log_level_warning, /** \brief Non-critical issues */
56         jm_log_level_info, /** \brief Informative messages */
57         jm_log_level_verbose, /** \brief Verbose messages */
58         jm_log_level_debug, /** \brief Debug messages. Only enabled if library is configured with FMILIB_ENABLE_LOG_LEVEL_DEBUG */
59         jm_log_level_all /** \brief  Must be last in this enum. */
60 } jm_log_level_enu_t;
61
62 /** \brief Convert log level into a string */
63 FMILIB_EXPORT
64 const char* jm_log_level_to_string(jm_log_level_enu_t level);
65
66 /** @} */
67 #ifdef __cplusplus
68 }
69 #endif
70
71 /* JM_TYPES_H */
72 #endif