Pārlūkot izejas kodu

MHD_get_version_bin(): added new function

Evgeny Grin (Karlson2k) 3 gadi atpakaļ
vecāks
revīzija
86d8267347
2 mainītis faili ar 29 papildinājumiem un 2 dzēšanām
  1. 14 2
      src/include/microhttpd.h
  2. 15 0
      src/microhttpd/daemon.c

+ 14 - 2
src/include/microhttpd.h

@@ -1,7 +1,7 @@
 /*
      This file is part of libmicrohttpd
      Copyright (C) 2006-2021 Christian Grothoff (and other contributing authors)
-     Copyright (C) 2014-2021 Evgeny Grin (Karlson2k)
+     Copyright (C) 2014-2022 Evgeny Grin (Karlson2k)
 
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
@@ -96,7 +96,7 @@ extern "C"
  * they are parsed as decimal numbers.
  * Example: 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00097601
+#define MHD_VERSION 0x00097602
 
 /* If generic headers don't work on your platform, include headers
    which define 'va_list', 'size_t', 'ssize_t', 'intptr_t',
@@ -4427,6 +4427,18 @@ _MHD_EXTERN const char *
 MHD_get_version (void);
 
 
+/**
+ * Obtain the version of this library as a binary value.
+ *
+ * @return version binary value, e.g. "0x00090900" (#MHD_VERSION of
+ *         compiled MHD binary)
+ * @note Available since #MHD_VERSION 0x00097602
+ * @ingroup specialized
+ */
+_MHD_EXTERN uint32_t
+MHD_get_version_bin (void);
+
+
 /**
  * Types of information about MHD features,
  * used by #MHD_is_feature_supported().

+ 15 - 0
src/microhttpd/daemon.c

@@ -7974,6 +7974,21 @@ MHD_get_version (void)
 }
 
 
+/**
+ * Obtain the version of this library as a binary value.
+ *
+ * @return version binary value, e.g. "0x00090900" (#MHD_VERSION of
+ *         compiled MHD binary)
+ * @note Available since #MHD_VERSION 0x00097602
+ * @ingroup specialized
+ */
+_MHD_EXTERN uint32_t
+MHD_get_version_bin (void)
+{
+  return (uint32_t) MHD_VERSION;
+}
+
+
 /**
  * Get information about supported MHD features.
  * Indicate that MHD was compiled with or without support for