33 #include "contiki-net.h"
36 #include "httpd-fsdata.h"
43 #include "httpd-fsdata.c"
45 #if WEBSERVER_CONF_FILESTATS==1
46 uint16_t httpd_filecount[HTTPD_FS_NUMFILES];
52 return (
void *)HTTPD_FS_ROOT;
62 httpd_fs_open(
const char *name,
struct httpd_fs_file *file)
64 #if WEBSERVER_CONF_FILESTATS
67 struct httpd_fsdata_file_noconst *f,fram;
69 for(f = (
struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
71 f = (
struct httpd_fsdata_file_noconst *)fram.next) {
74 httpd_memcpy(&fram,f,
sizeof(fram));
78 if(httpd_fs_strcmp((
char *)name, fram.name) == 0) {
80 file->data = fram.data;
83 #if WEBSERVER_CONF_FILESTATS==2 //increment count in linked list field if it is in RAM
89 #elif WEBSERVER_CONF_FILESTATS==1 //increment count in RAM array when linked list is in flash
92 return httpd_filecount[i];
95 #else //no file statistics
107 #if WEBSERVER_CONF_FILESTATS==1
109 for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
110 httpd_filecount[i] = 0;
115 #if WEBSERVER_CONF_FILESTATS && 0
117 httpd_fs_count(
char *name)
119 struct httpd_fsdata_file_noconst *f;
123 for(f = (
struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
125 f = (
struct httpd_fsdata_file_noconst *)f->next) {
127 if(httpd_fs_strcmp(name, f->name) == 0) {
128 return httpd_filecount[i];
#define NULL
The null pointer.