lfs_config.h 757 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Configuration and type definitions
  3. *
  4. * Copyright (c) 2017 Christopher Haster
  5. * Distributed under the MIT license
  6. */
  7. #ifndef LFS_CONFIG_H
  8. #define LFS_CONFIG_H
  9. #include <stdint.h>
  10. // Type definitions
  11. typedef uint64_t lfs_lword_t;
  12. typedef uint32_t lfs_word_t;
  13. typedef uint16_t lfs_hword_t;
  14. typedef lfs_word_t lfs_size_t;
  15. typedef lfs_word_t lfs_off_t;
  16. typedef int lfs_error_t;
  17. typedef lfs_lword_t lfs_lsize_t;
  18. typedef lfs_word_t lfs_ino_t;
  19. typedef lfs_hword_t lfs_ioff_t;
  20. // Maximum length of file name
  21. #define LFS_NAME_MAX 255
  22. // Builtin functions
  23. static inline lfs_word_t lfs_max(lfs_word_t a, lfs_word_t b) {
  24. return (a > b) ? a : b;
  25. }
  26. static inline lfs_word_t lfs_min(lfs_word_t a, lfs_word_t b) {
  27. return (a < b) ? a : b;
  28. }
  29. #endif