FREERDP_API void freerdp_set_error_info(rdpRdp* rdp, UINT32 error);
FREERDP_API void freerdp_get_version(int* major, int* minor, int* revision);
+FREERDP_API char* freerdp_get_version_string(void);
+FREERDP_API char* freerdp_get_build_date(void);
+FREERDP_API char* freerdp_get_build_revision(void);
FREERDP_API freerdp* freerdp_new(void);
FREERDP_API void freerdp_free(freerdp* instance);
endif()
freerdp_library_add(${OPENSSL_LIBRARIES})
+
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()
*revision = FREERDP_VERSION_REVISION;
}
+char* freerdp_get_version_string(void)
+{
+ return FREERDP_VERSION_FULL;
+}
+
+char* freerdp_get_build_date(void)
+{
+ static char build_date[64];
+
+ snprintf(build_date, sizeof(build_date), "%s %s", __DATE__, __TIME__);
+
+ return build_date;
+}
+
+char* freerdp_get_build_revision(void)
+{
+ return GIT_REVISION;
+}
+
static wEventType FreeRDP_Events[] =
{
DEFINE_EVENT_ENTRY(WindowStateChange)
# See the License for the specific language governing permissions and
# limitations under the License.
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/version.h)
+
file(GLOB WINPR_HEADERS "winpr/*.h")
install(FILES ${WINPR_HEADERS} DESTINATION include/winpr COMPONENT headers)
install(DIRECTORY winpr/tools DESTINATION include/winpr COMPONENT headers FILES_MATCHING PATTERN "*.h")
--- /dev/null
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ * Version includes
+ *
+ * Copyright 2013 Thincast Technologies GmbH
+ * Copyright 2013 Bernhard Miklautz <bernhard.miklautz@thincast.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _WINPR_VERSION_H_
+#define _WINPR_VERSION_H_
+
+#define WINPR_VERSION_MAJOR ${WINPR_VERSION_MAJOR}
+#define WINPR_VERSION_MINOR ${WINPR_VERSION_MINOR}
+#define WINPR_VERSION_REVISION ${WINPR_VERSION_REVISION}
+#define WINPR_VERSION_SUFFIX "${WINPR_VERSION_SUFFIX}"
+#define WINPR_API_VERSION "${WINPR_API_VERSION}"
+#define WINPR_VERSION "${WINPR_VERSION}"
+#define WINPR_VERSION_FULL "${WINPR_VERSION_FULL}"
+#define GIT_REVISION "${GIT_REVISION}"
+
+#endif // _WINPR_VERSION_H_
#define INLINE inline
#endif
+WINPR_API void winpr_get_version(int* major, int* minor, int* revision);
+WINPR_API char* winpr_get_version_string(void);
+WINPR_API char* winpr_get_build_date(void);
+WINPR_API char* winpr_get_build_revision(void);
+
#endif /* WINPR_H */
print.c
stream.c
debug.c
+ winpr.c
cmdline.c
ssl.c)
set(${MODULE_PREFIX}_TESTS
TestIni.c
+ TestVersion.c
TestImage.c
TestBipBuffer.c
TestBacktrace.c
--- /dev/null
+
+#include <winpr/crt.h>
+
+#include <winpr/version.h>
+#include <winpr/winpr.h>
+
+int TestVersion(int argc, char* argv[])
+{
+ char *version;
+ char *git;
+ char *build;
+ int major = 0, minor = 0, revision = 0;
+
+ winpr_get_version(&major, &minor, &revision);
+ if (major != WINPR_VERSION_MAJOR)
+ return -1;
+
+ if (minor != WINPR_VERSION_MINOR)
+ return -1;
+
+ if (revision != WINPR_VERSION_REVISION)
+ return -1;
+
+ version = winpr_get_version_string();
+ if (!version)
+ return -1;
+
+ git = winpr_get_build_revision();
+ if (!git)
+ return -1;
+
+ if (strncmp(git, GIT_REVISION, sizeof(GIT_REVISION)))
+ return -1;
+
+ build = winpr_get_build_date();
+ if (!build)
+ return -1;
+
+ return 0;
+}
+
--- /dev/null
+/**
+ * WinPR: Windows Portable Runtime
+ * Debugging Utils
+ *
+ * Copyright 2015 Armin Novak <armin.novak@thincast.com>
+ * Copyright 2015 Thincast Technologies GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <winpr/winpr.h>
+#include <winpr/version.h>
+
+void winpr_get_version(int* major, int* minor, int* revision)
+{
+ if (major)
+ *major = WINPR_VERSION_MAJOR;
+ if (minor)
+ *minor = WINPR_VERSION_MINOR;
+ if (revision)
+ *revision = WINPR_VERSION_REVISION;
+}
+
+char* winpr_get_version_string(void)
+{
+ return WINPR_VERSION_FULL;
+}
+
+char* winpr_get_build_date(void)
+{
+ static char build_date[64];
+
+ snprintf(build_date, sizeof(build_date), "%s %s", __DATE__, __TIME__);
+
+ return build_date;
+}
+
+char* winpr_get_build_revision(void)
+{
+ return GIT_REVISION;
+}
+