gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31729 - in libmicrohttpd: . src/include src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r31729 - in libmicrohttpd: . src/include src/microhttpd
Date: Tue, 24 Dec 2013 12:28:30 +0100

Author: grothoff
Date: 2013-12-24 12:28:30 +0100 (Tue, 24 Dec 2013)
New Revision: 31729

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/include/platform.h
   libmicrohttpd/src/microhttpd/base64.c
   libmicrohttpd/src/microhttpd/base64.h
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/connection_https.c
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/internal.c
   libmicrohttpd/src/microhttpd/internal.h
   libmicrohttpd/src/microhttpd/md5.c
   libmicrohttpd/src/microhttpd/md5.h
   libmicrohttpd/src/microhttpd/reason_phrase.c
Log:
-hide symbols

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-12-24 03:07:27 UTC (rev 31728)
+++ libmicrohttpd/ChangeLog     2013-12-24 11:28:30 UTC (rev 31729)
@@ -1,3 +1,7 @@
+Tue Dec 24 12:27:39 CET 2013
+       Adding explicit annotations to hide symbols that are not for
+       export in the C code (gcc 4.0 or higher only). -CG
+
 Sun Dec 22 14:54:30 CET 2013
        Adding a few lines to avoid warnings from picky compilers. -CG
 

Modified: libmicrohttpd/src/include/platform.h
===================================================================
--- libmicrohttpd/src/include/platform.h        2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/include/platform.h        2013-12-24 11:28:30 UTC (rev 
31729)
@@ -111,5 +111,14 @@
 
 #include <plibc.h>
 
+#define GCC_VERSION (__GNUC__ * 10000                 \
+                     + __GNUC_MINOR__ * 100           \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION > 40000
+#define HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
+#else
+#define HIDDEN_SYMBOL
+#endif
 
+
 #endif

Modified: libmicrohttpd/src/microhttpd/base64.c
===================================================================
--- libmicrohttpd/src/microhttpd/base64.c       2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/base64.c       2013-12-24 11:28:30 UTC (rev 
31729)
@@ -26,14 +26,15 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 
-char * 
-BASE64Decode(const char* src) 
+HIDDEN_SYMBOL
+char *
+BASE64Decode(const char* src)
 {
   size_t in_len = strlen (src);
   char* dest;
   char* result;
-  
-  if (in_len % 4) 
+
+  if (in_len % 4)
     {
       /* Wrong base64 string length */
       return NULL;

Modified: libmicrohttpd/src/microhttpd/base64.h
===================================================================
--- libmicrohttpd/src/microhttpd/base64.h       2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/base64.h       2013-12-24 11:28:30 UTC (rev 
31729)
@@ -11,7 +11,8 @@
 
 #include "platform.h"
 
-char * 
+HIDDEN_SYMBOL
+char *
 BASE64Decode(const char* src);
 
 #endif /* !BASE64_H */

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/connection.c   2013-12-24 11:28:30 UTC (rev 
31729)
@@ -1850,6 +1850,7 @@
  * @return always #MHD_YES (we should continue to process the
  *         connection)
  */
+HIDDEN_SYMBOL
 int
 MHD_connection_handle_read (struct MHD_Connection *connection)
 {
@@ -1912,6 +1913,7 @@
  * @return always #MHD_YES (we should continue to process the
  *         connection)
  */
+HIDDEN_SYMBOL
 int
 MHD_connection_handle_write (struct MHD_Connection *connection)
 {
@@ -2112,6 +2114,7 @@
  * @return #MHD_YES if we should continue to process the
  *         connection (not dead yet), #MHD_NO if it died
  */
+HIDDEN_SYMBOL
 int
 MHD_connection_handle_idle (struct MHD_Connection *connection)
 {
@@ -2548,6 +2551,7 @@
  * @return #MHD_YES if we should continue to process the
  *         connection (not dead yet), #MHD_NO if it died
  */
+HIDDEN_SYMBOL
 int
 MHD_connection_epoll_update_ (struct MHD_Connection *connection)
 {
@@ -2595,6 +2599,7 @@
  *
  * @param connection connection to initialize
  */
+HIDDEN_SYMBOL
 void
 MHD_set_http_callbacks_ (struct MHD_Connection *connection)
 {

Modified: libmicrohttpd/src/microhttpd/connection_https.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection_https.c     2013-12-24 03:07:27 UTC 
(rev 31728)
+++ libmicrohttpd/src/microhttpd/connection_https.c     2013-12-24 11:28:30 UTC 
(rev 31729)
@@ -35,7 +35,7 @@
 
 
 /**
- * Give gnuTLS chance to work on the TLS handshake.  
+ * Give gnuTLS chance to work on the TLS handshake.
  *
  * @param connection connection to handshake on
  * @return #MHD_YES on error or if the handshake is progressing
@@ -51,13 +51,13 @@
   if (connection->state == MHD_TLS_CONNECTION_INIT)
     {
       ret = gnutls_handshake (connection->tls_session);
-      if (ret == GNUTLS_E_SUCCESS) 
+      if (ret == GNUTLS_E_SUCCESS)
        {
          /* set connection state to enable HTTP processing */
          connection->state = MHD_CONNECTION_INIT;
-         return MHD_YES;         
+         return MHD_YES;
        }
-      if ( (ret == GNUTLS_E_AGAIN) || 
+      if ( (ret == GNUTLS_E_AGAIN) ||
           (ret == GNUTLS_E_INTERRUPTED) )
        {
          /* handshake not done */
@@ -156,7 +156,7 @@
        return MHD_YES;
       return MHD_connection_handle_idle (connection);
     }
-#if EPOLL_SUPPORT   
+#if EPOLL_SUPPORT
   return MHD_connection_epoll_update_ (connection);
 #else
   return MHD_YES;
@@ -170,6 +170,7 @@
  *
  * @param connection which callbacks should be modified
  */
+HIDDEN_SYMBOL
 void
 MHD_set_https_callbacks (struct MHD_Connection *connection)
 {

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/daemon.c       2013-12-24 11:28:30 UTC (rev 
31729)
@@ -121,11 +121,13 @@
 /**
  * Handler for fatal errors.
  */
+HIDDEN_SYMBOL
 MHD_PanicCallback mhd_panic;
 
 /**
  * Closure argument for "mhd_panic".
  */
+HIDDEN_SYMBOL
 void *mhd_panic_cls;
 
 

Modified: libmicrohttpd/src/microhttpd/internal.c
===================================================================
--- libmicrohttpd/src/microhttpd/internal.c     2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/internal.c     2013-12-24 11:28:30 UTC (rev 
31729)
@@ -31,6 +31,7 @@
 /**
  * State to string dictionary.
  */
+HIDDEN_SYMBOL
 const char *
 MHD_state_to_string (enum MHD_CONNECTION_STATE state)
 {
@@ -90,7 +91,7 @@
  * fprintf-like helper function for logging debug
  * messages.
  */
-void
+void HIDDEN_SYMBOL
 MHD_DLOG (const struct MHD_Daemon *daemon, const char *format, ...)
 {
   va_list va;
@@ -115,6 +116,7 @@
  * @return length of the resulting val (strlen(val) maybe
  *  shorter afterwards due to elimination of escape sequences)
  */
+HIDDEN_SYMBOL
 size_t
 MHD_http_unescape (void *cls,
                   struct MHD_Connection *connection,
@@ -165,6 +167,7 @@
 }
 
 
+HIDDEN_SYMBOL
 time_t
 MHD_monotonic_time (void)
 {

Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h     2013-12-24 03:07:27 UTC (rev 
31728)
+++ libmicrohttpd/src/microhttpd/internal.h     2013-12-24 11:28:30 UTC (rev 
31729)
@@ -189,7 +189,7 @@
  * fprintf-like helper function for logging debug
  * messages.
  */
-void
+void HIDDEN_SYMBOL
 MHD_DLOG (const struct MHD_Daemon *daemon,
          const char *format, ...);
 #endif

Modified: libmicrohttpd/src/microhttpd/md5.c
===================================================================
--- libmicrohttpd/src/microhttpd/md5.c  2013-12-24 03:07:27 UTC (rev 31728)
+++ libmicrohttpd/src/microhttpd/md5.c  2013-12-24 11:28:30 UTC (rev 31729)
@@ -28,7 +28,7 @@
 /*
  * Note: this code is harmless on little-endian machines.
  */
-static void 
+static void
 byteReverse(unsigned char *buf,
            unsigned longs)
 {
@@ -60,7 +60,7 @@
  * reflect the addition of 16 longwords of new data.  MD5Update blocks
  * the data and converts bytes into longwords for this routine.
  */
-static void 
+static void
 MD5Transform(uint32_t buf[4],
             uint32_t in[16])
 {
@@ -150,7 +150,7 @@
  * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  * initialization constants.
  */
-void
+void HIDDEN_SYMBOL
 MD5Init(struct MD5Context *ctx)
 {
     ctx->buf[0] = 0x67452301;
@@ -166,7 +166,7 @@
  * Update context to reflect the concatenation of another buffer full
  * of bytes.
  */
-void
+void HIDDEN_SYMBOL
 MD5Update(struct MD5Context *ctx,
          const void *data,
          unsigned len)
@@ -215,49 +215,49 @@
 }
 
 /*
- * Final wrapup - pad to 64-byte boundary with the bit pattern 
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
-void 
-MD5Final(unsigned char digest[16],
-        struct MD5Context *ctx)
+void HIDDEN_SYMBOL
+MD5Final (unsigned char digest[16],
+          struct MD5Context *ctx)
 {
   unsigned count;
   unsigned char *p;
 
   /* Compute number of bytes mod 64 */
   count = (ctx->bits[0] >> 3) & 0x3F;
-  
+
   /* Set the first char of padding to 0x80.  This is safe since there is
      always at least one byte free */
   p = ctx->in + count;
   *p++ = 0x80;
-  
+
   /* Bytes of padding needed to make 64 bytes */
   count = 64 - 1 - count;
-  
+
   /* Pad out to 56 mod 64 */
-  if (count < 8) 
+  if (count < 8)
     {
       /* Two lots of padding:  Pad the first block to 64 bytes */
       memset(p, 0, count);
       byteReverse(ctx->in, 16);
       MD5Transform(ctx->buf, (uint32_t *) ctx->in);
-      
+
       /* Now fill the next block with 56 bytes */
       memset(ctx->in, 0, 56);
-    } 
-  else 
+    }
+  else
     {
       /* Pad block to 56 bytes */
       memset(p, 0, count - 8);
     }
   byteReverse(ctx->in, 14);
-  
+
   /* Append length in bits and transform */
   ((uint32_t *) ctx->in)[14] = ctx->bits[0];
   ((uint32_t *) ctx->in)[15] = ctx->bits[1];
-  
+
   MD5Transform(ctx->buf, (uint32_t *) ctx->in);
   byteReverse((unsigned char *) ctx->buf, 4);
   memcpy(digest, ctx->buf, 16);

Modified: libmicrohttpd/src/microhttpd/md5.h
===================================================================
--- libmicrohttpd/src/microhttpd/md5.h  2013-12-24 03:07:27 UTC (rev 31728)
+++ libmicrohttpd/src/microhttpd/md5.h  2013-12-24 11:28:30 UTC (rev 31729)
@@ -29,7 +29,7 @@
 
 #define MD5_DIGEST_SIZE 16
 
-struct MD5Context 
+struct MD5Context
 {
   uint32_t buf[4];
   uint32_t bits[2];
@@ -37,15 +37,16 @@
 };
 
 
-void 
+void  HIDDEN_SYMBOL
 MD5Init(struct MD5Context *ctx);
 
-void
+void HIDDEN_SYMBOL
 MD5Update(struct MD5Context *ctx,
          const void *buf,
          unsigned len);
 
-void MD5Final(unsigned char digest[MD5_DIGEST_SIZE],
-             struct MD5Context *ctx);
+void HIDDEN_SYMBOL
+MD5Final(unsigned char digest[MD5_DIGEST_SIZE],
+         struct MD5Context *ctx);
 
 #endif /* !MD5_H */

Modified: libmicrohttpd/src/microhttpd/reason_phrase.c
===================================================================
--- libmicrohttpd/src/microhttpd/reason_phrase.c        2013-12-24 03:07:27 UTC 
(rev 31728)
+++ libmicrohttpd/src/microhttpd/reason_phrase.c        2013-12-24 11:28:30 UTC 
(rev 31729)
@@ -148,11 +148,13 @@
   BLOCK (five_hundred),
 };
 
+
+HIDDEN_SYMBOL
 const char *
 MHD_get_reason_phrase_for (unsigned int code)
 {
-  if ( (code >= 100) && 
-       (code < 600) && 
+  if ( (code >= 100) &&
+       (code < 600) &&
        (reasons[code / 100].max > (code % 100)) )
     return reasons[code / 100].data[code % 100];
   return "Unknown";




reply via email to

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