From 45fb7d7220209d8778eb7fdfe904591c31d23208 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 26 Jul 2017 22:16:26 +0200 Subject: [PATCH] Give struct fs_file::pextension its own type & improve its documentation (see also task #14567) --- src/include/lwip/apps/fs.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/include/lwip/apps/fs.h b/src/include/lwip/apps/fs.h index c635127a..0a2d13a0 100644 --- a/src/include/lwip/apps/fs.h +++ b/src/include/lwip/apps/fs.h @@ -53,11 +53,20 @@ struct fsdata_chksum { #define FS_FILE_FLAGS_HEADER_INCLUDED 0x01 #define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02 +/** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private + * pointer type (defaults to 'void' so the default usage is 'void*') + */ +#ifndef FS_FILE_EXTENSION_T_DEFINED +typedef void fs_file_extension; +#endif + struct fs_file { const char *data; int len; int index; - void *pextension; + /* pextension is free for implementations to hold private (extensional) + arbitrary data, e.g. holding some file state or file system handle */ + fs_file_extension *pextension; #if HTTPD_PRECALCULATED_CHECKSUM const struct fsdata_chksum *chksum; u16_t chksum_count;