diff options
author | Christopher Haster <chaster@utexas.edu> | 2017-04-24 05:40:03 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2017-04-24 05:40:03 +0300 |
commit | 5790ec2ce4279f2ca805e33f6f514fbe9e06aeb0 (patch) | |
tree | 6fbef93dd176699e77aac2052fb2a90cc3e6c7c7 /lfs_util.h | |
parent | ba8afb9d924ff40054c73f8430aa16b6eb7b1bac (diff) |
Structured some of the bulk of the codebase
- Removed lfs_config.h, distributed between lfs.h and lfs_util.h
- Moved some functions that felt out of place
Diffstat (limited to 'lfs_util.h')
-rw-r--r-- | lfs_util.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -7,8 +7,9 @@ #ifndef LFS_UTIL_H #define LFS_UTIL_H -#include "lfs_config.h" #include <stdlib.h> +#include <stdint.h> +#include <stdio.h> // Builtin functions @@ -32,7 +33,13 @@ static inline int lfs_scmp(uint32_t a, uint32_t b) { return (int)(unsigned)(a - b); } -uint32_t lfs_crc(uint32_t crc, lfs_size_t size, const void *buffer); +uint32_t lfs_crc(uint32_t crc, size_t size, const void *buffer); + + +// Logging functions +#define LFS_DEBUG(fmt, ...) printf("lfs debug: " fmt "\n", __VA_ARGS__) +#define LFS_WARN(fmt, ...) printf("lfs warn: " fmt "\n", __VA_ARGS__) +#define LFS_ERROR(fmt, ...) printf("lfs error: " fmt "\n", __VA_ARGS__) #endif |