MeVisLab Toolbox Reference
mlUtilsSystemC.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_UTILS_SYSTEM_C_H
14 #define ML_UTILS_SYSTEM_C_H
15 
17 
18 #include "mlUtilities.h"
19 
20 // Include global compiler switches for the ML.
21 #include "mlConfig.h"
22 
23 #include "mlTypeDefs.h"
24 
25 #include <ThirdPartyWarningsDisable.h>
26 
27 // We always need stdlib.h for e.g., size_t.
28 #include <cstdlib>
29 
30 // We always need stdio.h for e.g., FILE in mlFileSystem.
31 #include <cstdio>
32 
33 #include <ThirdPartyWarningsRestore.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 //--------------------------------------------------------------------------------------------
40 //
43 //
44 //--------------------------------------------------------------------------------------------
45 
51 extern ML_UTILS_EXPORT int MLAlwaysTrue;
52 
59 
67 
68 //----------------------------------------------------------------------------------
70 //----------------------------------------------------------------------------------
71 
72 #ifdef WIN32
73 
74  // WIN32 case:
76  #define strcasecmp(a,b) _stricmp((a),(b))
77 
79  #define strncasecmp(a,b,c) _strnicmp((a),(b),(c))
80 
83  #define strtold(a,b) strtod((a),(b))
84 
87  [[deprecated("Use standard snprintf instead")]]
88  ML_UTILS_EXPORT int _MLsnprintf(char*s, size_t maxChars, const char* format, ...);
89  [[deprecated("Use standard sscanf instead")]]
90  ML_UTILS_EXPORT int _MLsscanf(const char*s, const char* format, ...);
91 #else
92 
94  ML_UTILS_EXPORT char* strlwr(char* a);
95 
97 #if defined(__APPLE__)
98  [[deprecated("Use standard snprintf instead")]]
99  ML_UTILS_EXPORT int _MLsnprintf(char*s, size_t maxChars, const char* format, ...);
100  [[deprecated("Use standard sscanf instead")]]
101 
102  [[nodiscard]]
103  ML_UTILS_EXPORT int _MLsscanf(const char*s, const char* format, ...);
104 #else
105  [[deprecated("Use standard snprintf instead")]]
106  ML_UTILS_EXPORT int _MLsnprintf(char*s, size_t maxChars, const char* format, ...) __attribute__((format(printf,3,4)));
107 
108  [[deprecated("Use standard sscanf instead")]]
109  [[nodiscard]]
110  ML_UTILS_EXPORT int _MLsscanf(const char*s, const char* format, ...) __attribute__((format(scanf,2,3)));
111 #endif
112 
113 #endif
114 
115 #define MLsnprintf _MLsnprintf
116 #define MLsscanf _MLsscanf
117 
126 [[nodiscard]]
127 ML_UTILS_EXPORT MLint64 MLint64Scan(const char* source, char** endPtr);
128 
137 [[nodiscard]]
138 ML_UTILS_EXPORT MLuint64 MLuint64Scan(const char* source, char** endPtr);
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif // __mlUtilsSystemC_H
146 
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Definition: mlTypeDefs.h:513
INT64 MLint64
Include 64 bit integer support for Windows or Unix.
Definition: mlTypeDefs.h:500
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.
Definition: mlUtilities.h:20
ML_UTILS_EXPORT int MLAlwaysFalse
Variable which is always false (=0), but non constant to make it impossible for compilers to detect t...
ML_UTILS_EXPORT int _MLsscanf(const char *s, const char *format,...)
ML_UTILS_EXPORT int MLAlwaysTrue
Variable which is always true (=1), but non constant to make it impossible for compilers to detect th...
ML_UTILS_EXPORT MLuint64 MLuint64Scan(const char *source, char **endPtr)
Reads an MLuint64 from a character string source and returns scanned value as MLuint64.
ML_UTILS_EXPORT int MLAlwaysExecuted()
A do-nothing function call which cannot be optimized away to avoid that function bodies etc.
ML_UTILS_EXPORT int _MLsnprintf(char *s, size_t maxChars, const char *format,...)
Deprecated compatibility helpers to handle the missing support for standard format specifiers for lon...
ML_UTILS_EXPORT MLint64 MLint64Scan(const char *source, char **endPtr)
Reads an MLint64 from a character string source and returns scanned value as MLint64.
boost::graph_traits< ml_graph_ptr >::vertex_descriptor source(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for u of the edge (u,v) represented by e.