netutils: cosmetic change of header files for c++ reference
authorEunBong Song <eunb.song@samsung.com>
Wed, 9 Aug 2017 01:03:32 +0000 (18:03 -0700)
committerEunBong Song <eunb.song@samsung.com>
Wed, 30 Aug 2017 04:16:44 +0000 (21:16 -0700)
This patch changes all header files for cplusplus reference.

Change-Id: I40a16b13291a3bb8c4c3e03a4c33cacf56168765
Signed-off-by: EunBong Song <eunb.song@samsung.com>
28 files changed:
apps/include/netutils/base64.h
apps/include/netutils/cJSON.h
apps/include/netutils/commandline.h
apps/include/netutils/connection.h
apps/include/netutils/dhcpc.h
apps/include/netutils/dhcpd.h
apps/include/netutils/discover.h
apps/include/netutils/ftpd.h
apps/include/netutils/httpd.h [new file with mode: 0644]
apps/include/netutils/ipmsfilter.h
apps/include/netutils/liblwm2m.h
apps/include/netutils/md5.h
apps/include/netutils/mdnsd.h
apps/include/netutils/mqtt_api.h
apps/include/netutils/ntpclient.h
apps/include/netutils/smtp.h
apps/include/netutils/telnetd.h
apps/include/netutils/tftp.h
apps/include/netutils/thttpd.h
apps/include/netutils/urldecode.h
apps/include/netutils/webserver/http_keyvalue_list.h
apps/include/netutils/webserver/http_server.h
apps/include/netutils/websocket.h
apps/include/netutils/wifi/slsi_wifi_api.h
apps/include/netutils/wifi/slsi_wifi_nvmap.h
apps/include/netutils/wifi/slsi_wifi_utils.h
apps/include/netutils/wslay/wslay.h
apps/include/netutils/xmlrpc.h

index 9f4fac1..c35916c 100644 (file)
 #include <tinyara/config.h>
 
 #ifdef __cplusplus
-// *INDENT-OFF*
-extern "C"
-{
-// *INDENT-ON*
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
 #endif
 
 /****************************************************************************
@@ -93,9 +93,9 @@ unsigned char *base64w_encode(const unsigned char *src, size_t len, unsigned cha
 unsigned char *base64w_decode(const unsigned char *src, size_t len, unsigned char *dst, size_t * out_len);
 #endif                                                 /* CONFIG_CODECS_BASE64 */
 
+#undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
+
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_BASE64_H */
index be28081..bf82783 100644 (file)
 #define __APPS_INCLUDE_NETUTILS_JSON_H
 
 #ifdef __cplusplus
-// *INDENT-OFF*
-extern "C"
-{
-// *INDENT-ON*
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
 #endif
 
 /****************************************************************************
@@ -236,9 +236,8 @@ cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int
 
 void cJSON_Minify(char *json);
 
+#undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_JSON_H */
index 3a8851d..17ecd4e 100644 (file)
 
 #include <stdio.h>
 
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 #define COMMAND_END_LIST {NULL, NULL, NULL, NULL, NULL}
 
 typedef void (*command_handler_t)(char *args, void *user_data);
@@ -56,3 +65,8 @@ void output_tlv(FILE *stream, uint8_t *buffer, size_t buffer_len, int indent);
 void dump_tlv(FILE *stream, int size, lwm2m_data_t *dataP, int indent);
 void output_data(FILE *stream, lwm2m_media_type_t format, uint8_t *buffer, int length, int indent);
 void print_status(FILE *stream, uint8_t status);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
index e5c9f43..391597d 100644 (file)
 #include <sys/socket.h>
 #include <sys/stat.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 #define LWM2M_STANDARD_PORT_STR "5683"
 #define LWM2M_STANDARD_PORT      5683
 
@@ -63,4 +70,9 @@ void connection_free(connection_t *connList);
 
 int connection_send(connection_t *connP, uint8_t *buffer, size_t length);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 3ff1168..8e0ceb2 100644 (file)
@@ -95,12 +95,10 @@ struct dhcpc_state {
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /**
@@ -135,9 +133,7 @@ void dhcpc_close(void *handle);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_DHCPC_H */
index 841ba4c..fb2531f 100644 (file)
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /**
@@ -108,9 +106,7 @@ int dhcpd_start(char *intf);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_DHCPD_H */
index 00c3d95..1f4df2d 100644 (file)
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
@@ -83,4 +91,9 @@ struct discover_info_s {
 
 int discover_start(struct discover_info_s *info);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_DISCOVER_H */
index 69bddac..b6e106c 100644 (file)
@@ -133,12 +133,10 @@ typedef FAR void *FTPD_SESSION;
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /****************************************************************************
@@ -229,8 +227,6 @@ EXTERN void ftpd_close(FTPD_SESSION handle);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_FTPD_H */
diff --git a/apps/include/netutils/httpd.h b/apps/include/netutils/httpd.h
new file mode 100644 (file)
index 0000000..874ed32
--- /dev/null
@@ -0,0 +1,218 @@
+/****************************************************************************
+ *
+ * Copyright 2016 Samsung Electronics All Rights Reserved.
+ *
+ * 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.
+ *
+ ****************************************************************************/
+/****************************************************************************
+ * apps/include/netutils/httpd.h
+ *
+ *   Copyright (C) 2007, 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Based on uIP which also has a BSD style license:
+ *
+ *   Author: Adam Dunkels <adam@sics.se>
+ *   Copyright (c) 2001-2005, Adam Dunkels.
+ *   All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __APPS_INCLUDE_NETUTILS_HTTPD_H
+#define __APPS_INCLUDE_NETUTILS_HTTPD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <tinyara/net/tcp.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <limits.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* As threads are created to handle each request, a stack must be allocated
+ * for the thread.  Use a default if the user provided no stacksize.
+ */
+
+#ifndef  CONFIG_NETUTILS_HTTPDSTACKSIZE
+#define CONFIG_NETUTILS_HTTPDSTACKSIZE 4096
+#endif
+
+#ifndef  CONFIG_NETUTILS_HTTPDFSSTATS
+#define CONFIG_NETUTILS_HTTPDFSSTATS
+#endif
+
+#ifndef CONFIG_NETUTILS_HTTPDFILESTATS
+#define CONFIG_NETUTILS_HTTPDFILESTATS
+#endif
+
+#undef CONFIG_NETUTILS_HTTPDNETSTATS
+
+/* For efficiency reasons, the size of the IO buffer should be a multiple
+ * of the TCP MSS value.  Also, the current design requires that the IO
+ * buffer be sufficiently large to contain the entire GET request.
+ *
+ * In the case where there are multiple network devices with different
+ * link layer protocols (CONFIG_NET_MULTILINK), each network device
+ * may support a different TCP MSS value.  Here we arbitrarily select
+ * the minimum MSS for that case.
+ */
+
+#define HTTPD_IOBUFFER_SIZE (3*MIN_TCP_MSS)
+
+/* This is the maximum size of a file path */
+
+#ifndef CONFIG_NETUTILS_HTTPD_MAXPATH
+#define CONFIG_NETUTILS_HTTPD_MAXPATH PATH_MAX
+#endif
+
+#define HTTPD_MAX_FILENAME CONFIG_NETUTILS_HTTPD_MAXPATH
+
+/* Other tunable values.  If you need to change these values, please create
+ * new configurations in apps/netutils/webserver/Kconfig
+ */
+
+#define HTTPD_MAX_CONTENTLEN  32
+#define HTTPD_MAX_HEADERLEN   180
+
+/****************************************************************************
+ * Public types
+ ****************************************************************************/
+
+
+struct httpd_fs_file {
+       char *data;
+       int  len;
+#if defined(CONFIG_NETUTILS_HTTPD_MMAP) || defined(CONFIG_NETUTILS_HTTPD_SENDFILE)
+       int  fd;
+#endif
+};
+
+struct httpd_state {
+       char                 ht_buffer[HTTPD_IOBUFFER_SIZE];    /* recv() buffer */
+       char                 ht_filename[HTTPD_MAX_FILENAME];   /* filename from GET command */
+#ifndef CONFIG_NETUTILS_HTTPD_KEEPALIVE_DISABLE
+       bool                 ht_keepalive;                      /* Connection: keep-alive */
+#endif
+       struct httpd_fs_file ht_file;   /* Fake file data to send */
+       int                  ht_sockfd;                         /* The socket descriptor from accept() */
+       char                *ht_scriptptr;
+       uint16_t             ht_scriptlen;
+       uint16_t             ht_sndlen;
+};
+
+struct httpd_fsdata_file {
+       const struct httpd_fsdata_file *next;
+       FAR const uint8_t              *name;
+       FAR const uint8_t              *data;
+       int                             len;
+#ifdef CONFIG_NETUTILS_HTTPDFSSTATS
+       uint16_t                        count;
+#endif
+};
+
+struct httpd_fsdata_file_noconst {
+       FAR struct httpd_fsdata_file *next;
+       FAR char                     *name;
+       FAR char                     *data;
+       int len;
+#ifdef CONFIG_NETUTILS_HTTPDFSSTATS
+       uint16_t                      count;
+#endif
+};
+
+typedef void (*httpd_cgifunction)(struct httpd_state *, char *);
+
+struct httpd_cgi_call {
+       struct httpd_cgi_call *next;
+       const char            *name;
+       httpd_cgifunction      function;
+};
+
+/* HTTPD CGI function declaration
+ *
+ * Description:
+ *   This macro is used for declaring a HTTPD CGI function. This function is
+ *   then added to the list of HTTPD CGI functions with the httpd_cgi_register()
+ *   function.
+
+ * Input Parameters:
+ *
+ *   name     The C variable name of the function
+ *   str      The string name of the function, used in the script file
+ *   function A pointer to the function that implements it
+ */
+
+#define HTTPD_CGI_CALL(name, str, function) \
+static void function(struct httpd_state *, char *); \
+static struct httpd_cgi_call name = {NULL, str, function}
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+void httpd_init(void);
+int httpd_listen(void);
+void httpd_cgi_register(struct httpd_cgi_call *cgi_call);
+uint16_t httpd_fs_count(char *name);
+
+const struct httpd_fsdata_file g_httpdfs_root[];
+const int g_httpd_numfiles;
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif                                                 /* __APPS_INCLUDE_NETUTILS_HTTPD_H */
index 28d73d2..326300f 100644 (file)
@@ -75,8 +75,7 @@
  * Public Data
  ****************************************************************************/
 
-#undef EXTERN
-#if defined(__cplusplus)
+#ifdef __cplusplus
 #define EXTERN extern "C"
 extern "C" {
 #else
@@ -108,7 +107,7 @@ extern "C" {
 EXTERN int ipmsfilter(FAR const char *ifname, FAR const struct in_addr *multiaddr, uint32_t fmode);
 
 #undef EXTERN
-#if defined(__cplusplus)
+#ifdef __cplusplus
 }
 #endif
 
index 70a42c2..91d161a 100644 (file)
 #define _LWM2M_CLIENT_H_
 
 #ifdef __cplusplus
-// *INDENT-OFF*
+#define EXTERN extern "C"
 extern "C" {
-// *INDENT-ON*
+#else
+#define EXTERN extern
 #endif
 
 #include <stdint.h>
@@ -651,9 +652,9 @@ int lwm2m_bootstrap_finish(lwm2m_context_t *contextP, void *sessionH);
 
 #endif
 
+#undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
+
 #endif
index b800d7e..f09947f 100644 (file)
 #ifdef CONFIG_CODECS_HASH_MD5
 
 #ifdef __cplusplus
-// *INDENT-OFF*
-extern "C"
-{
-// *INDENT-ON*
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
 #endif
 
 /****************************************************************************
@@ -113,10 +113,9 @@ void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
 void md5_sum(const uint8_t *addr, const size_t len, uint8_t *mac);
 char *md5_hash(const uint8_t *addr, const size_t len);
 
+#undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 #endif                                                 /* CONFIG_CODECS_HASH_MD5 */
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_MD5_H */
index 08eddfc..f5eb827 100644 (file)
@@ -79,6 +79,14 @@ struct mdns_service_info {
        unsigned int port;
 };
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 #if defined(CONFIG_NETUTILS_MDNS_RESPONDER_SUPPORT)
 
 /**
@@ -147,6 +155,12 @@ int mdnsd_resolve_hostname(char *hostname, int *ipaddr);
  */
 int mdnsd_discover_service(char *service_type, int discover_time_msec, struct mdns_service_info **service_list, int *num_of_services);
 
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif                                                 /*!__MDNSD_H__ */
 
 /** @} */// end of MDNS group
index 6caa82f..d2ee090 100644 (file)
  ****************************************************************************/
 #include <tinyara/config.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -209,6 +216,11 @@ int mqtt_subscribe(mqtt_client_t *handle, char *topic, uint8_t qos);
  */
 int mqtt_unsubscribe(mqtt_client_t *handle, char *topic);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif                                                 /* __MQTT_API_H__ */
 
 /** @} */// end of MQTT group
index 3f9113f..c36520e 100644 (file)
@@ -124,12 +124,10 @@ struct ntpc_server_s {
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /****************************************************************************
@@ -186,9 +184,7 @@ int ntpc_get_link_status(void);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_NTPCLIENT_H */
index facb581..dc5563b 100644 (file)
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /****************************************************************************
@@ -91,9 +89,7 @@ void smtp_close(FAR void *handle);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_SMTP_H */
index e0d2f76..7bc67a2 100644 (file)
@@ -109,12 +109,10 @@ struct telnetd_config_s {
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 /****************************************************************************
@@ -140,8 +138,6 @@ EXTERN int telnetd_start(FAR struct telnetd_config_s *config);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_TELNETD_H */
index de128c0..ef821b0 100644 (file)
  ****************************************************************************/
 
 #ifdef __cplusplus
-// *INDENT-OFF*
 #define EXTERN extern "C"
 extern "C" {
 #else
 #define EXTERN extern
-// *INDENT-ON*
 #endif
 
 int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary);
@@ -86,9 +84,7 @@ int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary);
 
 #undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
 
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_TFTP_H */
index 4d85809..1575e26 100644 (file)
@@ -63,8 +63,7 @@
  * Public Data
  ****************************************************************************/
 
-#undef EXTERN
-#if defined(__cplusplus)
+#ifdef __cplusplus
 #define EXTERN extern "C"
 extern "C" {
 #else
@@ -109,7 +108,7 @@ EXTERN int g_thttpdnsymbols;
 EXTERN int thttpd_main(int argc, char **argv);
 
 #undef EXTERN
-#if defined(__cplusplus)
+#ifdef __cplusplus
 }
 #endif
 
index b4c4251..3587eaf 100644 (file)
 #include <tinyara/config.h>
 
 #ifdef __cplusplus
-// *INDENT-OFF*
-extern "C"
-{
-// *INDENT-ON*
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
 #endif
 
 /****************************************************************************
@@ -87,9 +87,9 @@ void urlrawdecode(char *urlbuf);
 void urlrawencode(char *str, char *urlbuf);
 #endif                                                 /* CONFIG_CODECS_AVR_URLCODE */
 
+#undef EXTERN
 #ifdef __cplusplus
-// *INDENT-OFF*
 }
-// *INDENT-ON*
 #endif
+
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_URLDECODE_H */
index 08532f9..7595f1a 100644 (file)
 #include <stdio.h>
 #include <apps/netutils/webserver/http_server.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 /*****************************************************************************
  * Public Types
  ****************************************************************************/
@@ -116,5 +123,10 @@ int   http_keyvalue_list_delete_tail(struct http_keyvalue_list_t *list);
  */
 char *http_keyvalue_list_find(struct http_keyvalue_list_t *list, const char *key);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /** @} */
index 14d1e82..56beb95 100644 (file)
 #define HTTP_ERROR_404            "Not Found"
 #define HTTP_ERROR_500            "Internal Server Error"
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 /****************************************************************************
  * Public Types
  ****************************************************************************/
@@ -298,5 +305,11 @@ int http_send_response(struct http_client_t *client, int status, const char *bod
 int http_tls_init(struct http_server_t *server, struct ssl_config_t *ssl_config);
 #endif
 
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /** @} */
index b92cb3c..f0daf52 100644 (file)
@@ -553,7 +553,6 @@ websocket_return_t websocket_update_state(websocket_t *websocket, int state);
 websocket_return_t websocket_set_error(websocket_t *websocket, int val);
 
 #undef EXTERN
-#undef EXTERN
 #ifdef __cplusplus
 }
 #endif
index 788df5e..ce3fc02 100644 (file)
 #ifndef SLSI_WIFI_API_H_
 #define SLSI_WIFI_API_H_
 
-#ifdef  __cplusplus
-extern "C" {
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
 #endif
 
 /* interface name to use */
@@ -411,6 +415,7 @@ int8_t WiFiSetCountryCode(const char *country_code);
  */
 int8_t WiFiSaveConfig(void);
 
+#undef EXTERN
 #ifdef  __cplusplus
 }
 #endif
index 9d72cab..4ee6165 100644 (file)
 #ifndef SLSI_WIFI_NVMAP_H_
 #define SLSI_WIFI_NVMAP_H_
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
 #include <stdlib.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 /* struct containing all the values that needs to be read/written
  * from/to the non-volatile memory.
  * New values needs to be added to the end of the structure and needs to be
@@ -50,6 +55,7 @@ typedef struct slsi_wifi_nv_data {
 
 #define SLSI_WIFI_NV_DATA_SIZE                         (sizeof(slsi_wifi_nv_data_t))
 
+#undef EXTERN
 #ifdef  __cplusplus
 }
 #endif
index e818eb1..6dca039 100644 (file)
 #include "slsi_wifi_api.h"
 
 #ifdef __cplusplus
-extern "C" {
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
 #endif
+
 /* Supported security modes as string */
 #define SLSI_WIFI_SECURITY_OPEN          "open"
 #define SLSI_WIFI_SECURITY_WEP_OPEN      "wep"
@@ -62,8 +67,10 @@ slsi_security_config_t *getSecurityConfig(char *sec_type, char *psk, WiFi_InterF
 
 void printScanResult(slsi_scan_info_t *list);
 
+#undef EXTERN
 #ifdef __cplusplus
 }
 #endif
+
 #endif                                                 /* __SLSI_WIFI_UTILS_H */
 
index ea8f24b..c0dafba 100644 (file)
 #include <stdlib.h>
 #include <sys/types.h>
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 enum wslay_error {
        WSLAY_ERR_WANT_READ = -100,
        WSLAY_ERR_WANT_WRITE = -101,
@@ -732,4 +739,9 @@ size_t wslay_event_get_queued_msg_count(wslay_event_context_ptr ctx);
  */
 size_t wslay_event_get_queued_msg_length(wslay_event_context_ptr ctx);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif                                                 /* WSLAY_H */
index a3b76a5..23f0fc0 100644 (file)
@@ -121,6 +121,13 @@ struct xmlrpc_entry_s {
        char *name;
 };
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
@@ -133,4 +140,9 @@ int xmlrpc_getdouble(struct xmlrpc_s *xmlcall, double *arg);
 int xmlrpc_getstring(struct xmlrpc_s *xmlcall, char *arg);
 int xmlrpc_buildresponse(struct xmlrpc_s *, char *, ...);
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif                                                 /* __APPS_INCLUDE_NETUTILS_XMLRPC_H */