30 #define os_malloc malloc 32 #define os_memcpy memcpy 33 #define os_strncmp strncmp 34 #define os_strcmp strcmp 35 #define os_strcpy strcpy 36 #define os_printf printf 37 #define ICACHE_FLASH_ATTR 38 extern char* espFsData;
41 #include "../mkespfsimage/espfsformat.h" 84 for (x=0; x<len; x++) {
87 if (b==0) *dst=(w>>0);
88 if (b==1) *dst=(w>>8);
89 if (b==2) *dst=(w>>16);
90 if (b==3) *dst=(w>>24);
108 while(fileName[0]==
'/') fileName++;
114 if (h.magic!=0x73665345) {
115 INFO(
"Magic mismatch. EspFS image broken.\n");
118 if (h.flags&FLAG_LASTFILE) {
119 INFO(
"End of image.\n");
123 p+=
sizeof(EspFsHeader);
133 r->
header=(EspFsHeader *)hpos;
138 if (h.compression==COMPRESS_NONE) {
140 #ifdef EFS_HEATSHRINK 141 }
else if (h.compression==COMPRESS_HEATSHRINK) {
148 INFO(
"Heatshrink compressed file; decode parms = %x\n", parm);
153 INFO(
"Invalid compression: %d\n", h.compression);
159 p+=h.nameLen+h.fileLenComp;
160 if ((
int)p&3) p+=4-((int)p&3);
167 if (fh==
NULL)
return 0;
174 if (len>toRead) len=toRead;
181 #ifdef EFS_HEATSHRINK 184 unsigned int elen, rlen;
192 if (elen==0)
return decoded;
215 if (fh==
NULL)
return;
216 #ifdef EFS_HEATSHRINK HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size)
int ICACHE_FLASH_ATTR espFsRead(EspFsFile *fh, char *buff, int len)
#define ICACHE_FLASH_ATTR
void ICACHE_FLASH_ATTR espFsClose(EspFsFile *fh)
heatshrink_decoder * heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t window_sz2, uint8_t lookahead_sz2)
void ICACHE_FLASH_ATTR memcpyAligned(char *dst, char *src, int len)
void heatshrink_decoder_free(heatshrink_decoder *hsd)
HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd)
EspFsFile ICACHE_FLASH_ATTR * espFsOpen(char *fileName)
HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, uint8_t *in_buf, size_t size, size_t *input_size)