gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated: Updated MHD_*_get_in


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: Updated MHD_*_get_information() functions.
Date: Wed, 09 Aug 2017 19:09:07 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new c943867f Updated MHD_*_get_information() functions.
c943867f is described below

commit c943867f5f6c374e44ff0297fc388a3e4edb09e9
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Wed Aug 9 20:04:44 2017 +0300

    Updated MHD_*_get_information() functions.
---
 src/include/microhttpd2.h | 120 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 94 insertions(+), 26 deletions(-)

diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index f4e6443c..352e54cd 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -1,6 +1,7 @@
 /*
      This file is part of libmicrohttpd
-     Copyright (C) 2006-2017 Christian Grothoff (and other contributing 
authors)
+     Copyright (C) 2006-2017 Christian Grothoff, Karlson2k (Evgeny Grin)
+     (and other contributing authors)
 
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
@@ -53,6 +54,7 @@
  *   at the same time avoid symbol conflict with legacy names
  *   (so we can have one binary implementing old and new 
  *   library API at the same time via compatibility layer).
+ * - improve thread-safety
  */
 
 
@@ -1885,18 +1887,41 @@ union MHD_ConnectionInformation
 
 /**
  * Obtain information about the given connection.
+ * Use wrapper macro #MHD_connection_get_information() instead of direct use
+ * of this function.
  *
  * @param connection what connection to get information about
  * @param info_type what information is desired?
- * @param ... depends on @a info_type
- * @return NULL if this information is not available
- *         (or if the @a info_type is unknown)
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @param return_value_size size of union MHD_DaemonInformation at compile
+ *                          time
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
  * @ingroup specialized
  */
-_MHD_EXTERN const union MHD_ConnectionInformation *
-MHD_connection_get_information (struct MHD_Connection *connection,
-                               enum MHD_ConnectionInformationType info_type,
-                               ...);
+_MHD_EXTERN enum MHD_Bool
+MHD_connection_get_information_sz (struct MHD_Connection *connection,
+                                  enum MHD_ConnectionInformationType info_type,
+                                  union MHD_ConnectionInformation 
*return_value,
+                                  size_t return_value_size);
+
+
+/**
+ * Obtain information about the given connection.
+ *
+ * @param connection what connection to get information about
+ * @param info_type what information is desired?
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
+ * @ingroup specialized
+ */
+#define MHD_connection_get_information(connection,   \
+                                       info_type,    \
+                                       return_value) \
+        MHD_connection_get_information_sz 
((connection),(info_type),(return_value),sizeof(enum 
MHD_ConnectionInformationType))
 
 
 /**
@@ -1960,19 +1985,42 @@ enum MHD_RequestInformationType
 
 
 /**
- * Obtain information about the given connection.
+ * Obtain information about the given request.
+ * Use wrapper macro #MHD_request_get_information() instead of direct use
+ * of this function.
  *
- * @param connection what connection to get information about
+ * @param request what request to get information about
  * @param info_type what information is desired?
- * @param ... depends on @a info_type
- * @return NULL if this information is not available
- *         (or if the @a info_type is unknown)
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @param return_value_size size of union MHD_DaemonInformation at compile
+ *                          time
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
  * @ingroup specialized
  */
-_MHD_EXTERN const union MHD_RequestInformation *
-MHD_request_get_information (struct MHD_Request *request,
-                            enum MHD_RequestInformationType info_type,
-                            ...);
+_MHD_EXTERN enum MHD_Bool
+MHD_request_get_information_sz (struct MHD_Request *request,
+                               enum MHD_RequestInformationType info_type,
+                               union MHD_RequestInformation *return_value,
+                               size_t return_value_size);
+
+
+/**
+ * Obtain information about the given request.
+ *
+ * @param request what request to get information about
+ * @param info_type what information is desired?
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
+ * @ingroup specialized
+ */
+#define MHD_request_get_information (request,      \
+                                     info_type,    \
+                                     return_value) \
+        MHD_request_get_information_sz ((request), (info_type), 
(return_value), sizeof(union MHD_RequestInformation))
 
 
 /**
@@ -2043,18 +2091,38 @@ union MHD_DaemonInformation
 
 
 /**
- * Obtain information about the given daemon
- * (not fully implemented!).
+ * Obtain information about the given daemon.
+ * Use wrapper macro #MHD_daemon_get_information() instead of direct use
+ * of this function.
  *
  * @param daemon what daemon to get information about
  * @param info_type what information is desired?
- * @param ... depends on @a info_type
- * @return NULL if this information is not available
- *         (or if the @a info_type is unknown)
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @param return_value_size size of union MHD_DaemonInformation at compile
+ *                          time
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
  * @ingroup specialized
  */
-_MHD_EXTERN const union MHD_DaemonInformation *
-MHD_daemon_get_information (struct MHD_Daemon *daemon,
-                           enum MHD_DaemonInformationType info_type,
-                           ...);
+_MHD_EXTERN enum MHD_Bool
+MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
+                              enum MHD_DaemonInformationType info_type,
+                              union MHD_DaemonInformation *return_value,
+                              size_t return_value_size);
 
+/**
+ * Obtain information about the given daemon.
+ *
+ * @param daemon what daemon to get information about
+ * @param info_type what information is desired?
+ * @param[out] return_value pointer to union where requested information will
+ *                          be stored
+ * @return #MHD_YES on success, #MHD_NO on error
+ *         (@a info_type is unknown, NULL pointer etc.)
+ * @ingroup specialized
+ */
+#define MHD_daemon_get_information(daemon,       \
+                                   info_type,    \
+                                   return_value) \
+       MHD_daemon_get_information_sz((daemon), (info_type), (return_value), 
sizeof(union MHD_DaemonInformation));

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]