a guest Mar 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fs/spiffs_cache.c
  2. // returns cached page for give page index, or null if no such cached page
  3. static spiffs_cache_page *spiffs_cache_page_get(spiffs *fs, spiffs_page_ix pix)
  4. // frees cached page
  5. static s32_t spiffs_cache_page_free(spiffs *fs, int ix, u8_t write_back)
  6. // removes the oldest accessed cached page
  7. static s32_t spiffs_cache_page_remove_oldest(spiffs *fs, u8_t flag_mask, u8_t flags)
  8. // allocates a new cached page and returns it, or null if all cache pages are busy
  9. static spiffs_cache_page *spiffs_cache_page_allocate(spiffs *fs)
  11. fs/spiffs_check.c
  12. // copies page contents to a new page
  13. static s32_t spiffs_rewrite_page(spiffs *fs, spiffs_page_ix cur_pix, spiffs_page_header *p_hdr, spiffs_page_ix *new_pix)
  14. // rewrites the object index for given object id and replaces the
  15. // data page index to a new page index
  16. static s32_t spiffs_rewrite_index(spiffs *fs, spiffs_obj_id obj_id, spiffs_span_ix data_spix, spiffs_page_ix new_data_pix, spiffs_page_ix objix_pix)
  17. // deletes an object just by marking object index header as deleted
  18. static s32_t spiffs_delete_obj_lazy(spiffs *fs, spiffs_obj_id obj_id)
  19. // Scans all pages (except lu pages), reserves 4 bits in working memory for each page
  20. // bit 0: 0 == FREE|DELETED, 1 == USED
  21. // bit 1: 0 == UNREFERENCED, 1 == REFERENCED
  22. // bit 2: 0 == NOT_INDEX,    1 == INDEX
  23. // bit 3: unused
  24. // A consistent file system will have only pages being
  25. //  * x000 free, unreferenced, not index
  26. //  * x011 used, referenced only once, not index
  27. //  * x101 used, unreferenced, index
  28. // The working memory might not fit all pages so several scans might be needed
  29. static s32_t spiffs_page_consistency_check_i(spiffs *fs)
  30. // searches for given object id in temporary object id index,
  31. // returns the index or -1
  32. static int spiffs_object_index_search(spiffs *fs, spiffs_obj_id obj_id)
  34. fs/spiffs_nucleus.c
  35. // djb2 hash
  36. static u32_t spiffs_hash(spiffs *fs, const u8_t *name)
  38. dns/captdns.c
  39. //Function to put unaligned 16-bit network values
  40. static void ICACHE_FLASH_ATTR setn16(void *pp, int16_t n)
  41. //Function to put unaligned 32-bit network values
  42. static void ICACHE_FLASH_ATTR setn32(void *pp, int32_t n)
  43. //Parses a label into a C-string containing a dotted
  44. //Returns pointer to start of next fields in packet
  45. static char* ICACHE_FLASH_ATTR labelToStr(char *packet, char *labelPtr, int packetSz, char *res, int resMaxLen)
  46. //Converts a dotted hostname to the weird label form dns uses.
  47. static char ICACHE_FLASH_ATTR *strToLabel(char *str, char *label, int maxLen)
  48. //Receive a DNS packet and maybe send a response back
  49. static void ICACHE_FLASH_ATTR captdnsRecv(struct sockaddr_in *premote_addr, char *pusrdata, unsigned short length)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand