123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef __FS_H__
- #define __FS_H__
- #include "lwip/opt.h"
- #ifndef LWIP_HTTPD_CUSTOM_FILES
- #define LWIP_HTTPD_CUSTOM_FILES 0
- #endif
- #ifndef LWIP_HTTPD_FILE_STATE
- #define LWIP_HTTPD_FILE_STATE 0
- #endif
- #ifndef HTTPD_PRECALCULATED_CHECKSUM
- #define HTTPD_PRECALCULATED_CHECKSUM 0
- #endif
- #if HTTPD_PRECALCULATED_CHECKSUM
- struct fsdata_chksum {
- u32_t offset;
- u16_t chksum;
- u16_t len;
- };
- #endif
- struct fs_file {
- const char *data;
- int len;
- int index;
- void *pextension;
- #if HTTPD_PRECALCULATED_CHECKSUM
- const struct fsdata_chksum *chksum;
- u16_t chksum_count;
- #endif
- u8_t http_header_included;
- #if LWIP_HTTPD_CUSTOM_FILES
- u8_t is_custom_file;
- #endif
- #if LWIP_HTTPD_FILE_STATE
- void *state;
- #endif
- };
- struct fs_file *fs_open(const char *name);
- void fs_close(struct fs_file *file);
- int fs_read(struct fs_file *file, char *buffer, int count);
- int fs_bytes_left(struct fs_file *file);
- struct fs_file *fs_open(const char *name);
- #if LWIP_HTTPD_FILE_STATE
- void *fs_state_init(struct fs_file *file, const char *name);
- void fs_state_free(struct fs_file *file, void *state);
- #endif
- #endif
|