Fix problem in conditional compilation

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1647 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-03-28 12:45:28 +00:00
parent 518a4e8c1f
commit e6ff50cbcd
1 changed files with 37 additions and 10 deletions

View File

@ -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