Skip to content
Snippets Groups Projects
Commit e6ff50cb authored by patacongo's avatar patacongo
Browse files

Fix problem in conditional compilation

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1647 42af7a65-404d-4744-a932-0658087f49c3
parent 518a4e8c
No related branches found
No related tags found
No related merge requests found
......@@ -51,11 +51,26 @@
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* 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)
{
......@@ -112,6 +135,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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment