summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-28 12:45:28 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-28 12:45:28 +0000
commit080f6519a4fa299e19d51516a4af3e16f28abc26 (patch)
tree8d2069422f435a6e4e9f3ef5502512ffca07971b /nuttx
parent5ebce14f1e190de6a43068f86efd232aa4747a10 (diff)
downloadpx4-nuttx-080f6519a4fa299e19d51516a4af3e16f28abc26.tar.gz
px4-nuttx-080f6519a4fa299e19d51516a4af3e16f28abc26.tar.bz2
px4-nuttx-080f6519a4fa299e19d51516a4af3e16f28abc26.zip
Fix problem in conditional compilation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1647 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/netutils/webserver/httpd_cgi.c47
1 files changed, 37 insertions, 10 deletions
diff --git a/nuttx/netutils/webserver/httpd_cgi.c b/nuttx/netutils/webserver/httpd_cgi.c
index d8a7523f8..a51a4e273 100644
--- a/nuttx/netutils/webserver/httpd_cgi.c
+++ b/nuttx/netutils/webserver/httpd_cgi.c
@@ -52,10 +52,25 @@
****************************************************************************/
/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static void nullfunction(struct httpd_state *pstate, char *ptr);
+#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
+static void net_stats(struct httpd_state *pstate, char *ptr);
+#endif
+
+#ifdef CONFIG_NETUTILS_HTTPDFILESTATS
+static void file_stats(struct httpd_state *pstate, char *ptr);
+#endif
+
+/****************************************************************************
* Private Data
****************************************************************************/
+#ifdef CONFIG_NETUTILS_HTTPDFILESTATS
HTTPD_CGI_CALL(file, "file-stats", file_stats);
+#endif
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
HTTPD_CGI_CALL(net, "net-stats", net_stats);
#endif
@@ -94,10 +109,18 @@ static const char last_ack[] = /* "LAST-ACK"*/
* Private Functions
****************************************************************************/
+/****************************************************************************
+ * Name: nullfunction
+ ****************************************************************************/
+
static void nullfunction(struct httpd_state *pstate, char *ptr)
{
}
+/****************************************************************************
+ * Name: net_stats
+ ****************************************************************************/
+
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
static void net_stats(struct httpd_state *pstate, char *ptr)
{
@@ -113,6 +136,20 @@ static void net_stats(struct httpd_state *pstate, char *ptr)
#endif
/****************************************************************************
+ * Name: file_stats
+ ****************************************************************************/
+
+#ifdef CONFIG_NETUTILS_HTTPDFILESTATS
+static void file_stats(struct httpd_state *pstate, char *ptr)
+{
+ char buffer[16];
+ char *pcount = strchr(ptr, ' ') + 1;
+ snprintf(buffer, 16, "%5u", httpd_fs_count(pcount));
+ (void)send(pstate->ht_sockfd, buffer, strlen(buffer), 0);
+}
+#endif
+
+/****************************************************************************
* Public Functions
****************************************************************************/
@@ -131,13 +168,3 @@ httpd_cgifunction httpd_cgi(char *name)
}
return nullfunction;
}
-
-#ifdef CONFIG_NETUTILS_HTTPDFILESTATS
-static void file_stats(struct httpd_state *pstate, char *ptr)
-{
- char buffer[16];
- char *pcount = strchr(ptr, ' ') + 1;
- snprintf(buffer, 16, "%5u", httpd_fs_count(pcount));
- (void)send(pstate->ht_sockfd, buffer, strlen(buffer), 0);
-}
-#endif