lfs_config.h 794 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 uint32_t lfs_size_t;
  12. typedef uint32_t lfs_off_t;
  13. typedef int32_t lfs_ssize_t;
  14. typedef int32_t lfs_soff_t;
  15. typedef uint32_t lfs_block_t;
  16. // Maximum length of file name
  17. #ifndef LFS_NAME_MAX
  18. #define LFS_NAME_MAX 255
  19. #endif
  20. // Lookahead distance
  21. #ifndef LFS_CFG_LOOKAHEAD
  22. #define LFS_CFG_LOOKAHEAD 128
  23. #endif
  24. // Logging operations
  25. #include <stdio.h>
  26. #define LFS_ERROR(fmt, ...) printf("lfs error: " fmt "\n", __VA_ARGS__)
  27. #define LFS_WARN(fmt, ...) printf("lfs warn: " fmt "\n", __VA_ARGS__)
  28. #define LFS_INFO(fmt, ...) printf("lfs info: " fmt "\n", __VA_ARGS__)
  29. #endif