///////////////////////////////////////////////////////////////////////////////
// MuldeR's Utilities for Qt
-// Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//Forward Declarations
class QProcess;
class QDir;
+template<typename K, typename V> class QHash;
///////////////////////////////////////////////////////////////////////////////
/** \cond INTERNAL
*/
+ //Interface version
+#define MUTILS_INTERFACE 3
+
//MUtils API
#ifdef _MSC_VER
# ifdef MUTILS_DLL_EXPORT
# define MUTILS_API
#endif
-#define MUTILS_MAKE_STRING_HELPER(X) #X
-#define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
-#define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
-
//Check Debug Flags
#if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
# define MUTILS_DEBUG (1)
#endif
#endif
+//Library initializer
+#define MUTILS_GLUE_NAME_HELPER(X,Y) X##Y
+#define MUTILS_GLUE_NAME(X,Y) MUTILS_GLUE_NAME_HELPER(X,Y)
+#if MUTILS_DEBUG
+#define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_d, MUTILS_INTERFACE)
+#else
+#define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_r, MUTILS_INTERFACE)
+#endif
+
+//Compiler warnings
+#define MUTILS_MAKE_STRING_HELPER(X) #X
+#define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
+#define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
+
/** \endcond INTERNAL
*/
*
* \param extraPaths A read-only pointer to a QStringList object containing additional paths that will be added (prepended) to the sub-process' `PATH` environment variable. This parameter can be `NULL`, in which case *no* additional paths are added.
*/
- MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL);
+ MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL, const QHash<QString, QString> *const extraEnv = NULL);
/**
* \brief Generates a *random* unsigned 32-Bit value.
* \return The function returns a *random* unsigned 32-Bit value.
*/
MUTILS_API quint32 next_rand_u32(void);
-
+ MUTILS_API quint32 next_rand_u32(const quint32 max);
+
/**
* \brief Generates a *random* unsigned 64-Bit value.
*
*/
MUTILS_API fp_parts_t break_fp(const double value);
- //Internal
+ //Internal (do *not* call directly!)
namespace Internal
{
- MUTILS_API int selfTest(const char *const buildKey, const bool debug);
- static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
+ MUTILS_API unsigned int MUTILS_INITIALIZER(const unsigned int interfaceId);
+ static const unsigned int init_flag = MUTILS_INITIALIZER(MUTILS_INTERFACE);
}
}