diff --git a/src/apps/httpd/fs.c b/src/apps/httpd/fs.c index 35b5e310..1bd370e3 100644 --- a/src/apps/httpd/fs.c +++ b/src/apps/httpd/fs.c @@ -33,15 +33,10 @@ #include "lwip/apps/httpd_opts.h" #include "lwip/def.h" #include "lwip/apps/fs.h" -#include "fsdata.h" #include -#if HTTPD_USE_CUSTOM_FSDATA -#include "fsdata_custom.c" -#else /* HTTPD_USE_CUSTOM_FSDATA */ -#include "fsdata.c" -#endif /* HTTPD_USE_CUSTOM_FSDATA */ +#include HTTPD_FSDATA_FILE /*-----------------------------------------------------------------------------------*/ diff --git a/src/apps/httpd/fsdata.c b/src/apps/httpd/fsdata.c index 6170ce63..45274cd1 100644 --- a/src/apps/httpd/fsdata.c +++ b/src/apps/httpd/fsdata.c @@ -1,6 +1,5 @@ #include "lwip/apps/fs.h" #include "lwip/def.h" -#include "fsdata.h" #define file_NULL (struct fsdata_file *) NULL diff --git a/src/apps/httpd/fsdata.h b/src/apps/httpd/fsdata.h index ac4548c7..55b0824b 100644 --- a/src/apps/httpd/fsdata.h +++ b/src/apps/httpd/fsdata.h @@ -35,16 +35,7 @@ #include "lwip/apps/httpd_opts.h" #include "lwip/apps/fs.h" -struct fsdata_file { - const struct fsdata_file *next; - const unsigned char *name; - const unsigned char *data; - int len; - u8_t flags; -#if HTTPD_PRECALCULATED_CHECKSUM - u16_t chksum_count; - const struct fsdata_chksum *chksum; -#endif /* HTTPD_PRECALCULATED_CHECKSUM */ -}; +/* THIS FILE IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE */ +/* content was moved to fs.h to simplify #include structure */ #endif /* LWIP_FSDATA_H */ diff --git a/src/apps/httpd/makefsdata/makefsdata.c b/src/apps/httpd/makefsdata/makefsdata.c index 934e7219..366b48a3 100644 --- a/src/apps/httpd/makefsdata/makefsdata.c +++ b/src/apps/httpd/makefsdata/makefsdata.c @@ -306,8 +306,7 @@ int main(int argc, char *argv[]) CHDIR(path); fprintf(data_file, "#include \"lwip/apps/fs.h\"" NEWLINE); - fprintf(data_file, "#include \"lwip/def.h\"" NEWLINE); - fprintf(data_file, "#include \"fsdata.h\"" NEWLINE NEWLINE NEWLINE); + fprintf(data_file, "#include \"lwip/def.h\"" NEWLINE NEWLINE NEWLINE); fprintf(data_file, "#define file_NULL (struct fsdata_file *) NULL" NEWLINE NEWLINE NEWLINE); /* define FS_FILE_FLAGS_HEADER_INCLUDED to 1 if not defined (compatibility with older httpd/fs) */ diff --git a/src/include/lwip/apps/fs.h b/src/include/lwip/apps/fs.h index bb176fa0..c635127a 100644 --- a/src/include/lwip/apps/fs.h +++ b/src/include/lwip/apps/fs.h @@ -96,6 +96,18 @@ void *fs_state_init(struct fs_file *file, const char *name); void fs_state_free(struct fs_file *file, void *state); #endif /* #if LWIP_HTTPD_FILE_STATE */ +struct fsdata_file { + const struct fsdata_file *next; + const unsigned char *name; + const unsigned char *data; + int len; + u8_t flags; +#if HTTPD_PRECALCULATED_CHECKSUM + u16_t chksum_count; + const struct fsdata_chksum *chksum; +#endif /* HTTPD_PRECALCULATED_CHECKSUM */ +}; + #ifdef __cplusplus } #endif diff --git a/src/include/lwip/apps/httpd_opts.h b/src/include/lwip/apps/httpd_opts.h index 340db15f..16c78db9 100644 --- a/src/include/lwip/apps/httpd_opts.h +++ b/src/include/lwip/apps/httpd_opts.h @@ -310,10 +310,14 @@ #define LWIP_HTTPD_FS_ASYNC_READ 0 #endif -/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the - * file system (to prevent changing the file included in CVS) */ -#if !defined HTTPD_USE_CUSTOM_FSDATA || defined __DOXYGEN__ -#define HTTPD_USE_CUSTOM_FSDATA 0 +/** Filename (including path) to use as FS data file */ +#if !defined HTTPD_FSDATA_FILE || defined __DOXYGEN__ +/* HTTPD_USE_CUSTOM_FSDATA: Compatibility with deprecated lwIP option */ +#if HTTPD_USE_CUSTOM_FSDATA +#define HTTPD_FSDATA_FILE "fsdata_custom.c" +#else +#define HTTPD_FSDATA_FILE "fsdata.c" +#endif #endif /**