Rename config structs to cfg structs

Since this is already going to be a breaking API change, this renames
structs/variables named _config -> _cfg. This is in order to be
consistent with functions such as lfs_file_opencfg.
This commit is contained in:
Christopher Haster
2020-11-23 01:59:59 -06:00
parent 3f6f88778a
commit a549413077
11 changed files with 101 additions and 101 deletions

14
lfs.c
View File

@@ -32,7 +32,7 @@
#define LFS_CFG_FILE_MAX(lfs) ((void)lfs, LFS_FILE_MAX)
#define LFS_CFG_ATTR_MAX(lfs) ((void)lfs, LFS_ATTR_MAX)
#else
// direct config towards dynamic lfs_config struct
// direct config towards dynamic lfs_cfg struct
#define LFS_CFG_READ(lfs, block, off, buffer, size) \
lfs->cfg->read(lfs->cfg, block, off, buffer, size)
#define LFS_CFG_PROG(lfs, block, off, buffer, size) \
@@ -62,7 +62,7 @@
#define LFS_FILE_CFG_ATTRS(file) LFS_FILE_ATTRS
#define LFS_FILE_CFG_ATTR_COUNT(file) LFS_FILE_ATTR_COUNT
#else
// direct config towards dynamic lfs_config struct
// direct config towards dynamic lfs_cfg struct
#define LFS_FILE_CFG_BUFFER(file) file->cfg->buffer
#define LFS_FILE_CFG_ATTRS(file) file->cfg->attrs
#define LFS_FILE_CFG_ATTR_COUNT(file) file->cfg->attr_count
@@ -2596,7 +2596,7 @@ int lfs_file_open(lfs_t *lfs, lfs_file_t *file,
LFS_TRACE("lfs_file_open(%p, %p, \"%s\", %x)",
(void*)lfs, (void*)file, path, flags);
#ifndef LFS_FILE_STATICCFG
static const struct lfs_file_config defaults = {0};
static const struct lfs_file_cfg defaults = {0};
file->cfg = &defaults;
#endif
int err = lfs_file_opencommon(lfs, file, path, flags);
@@ -2607,7 +2607,7 @@ int lfs_file_open(lfs_t *lfs, lfs_file_t *file,
#if !defined(LFS_FILE_STATICCFG)
int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file,
const char *path, int flags,
const struct lfs_file_config *cfg) {
const struct lfs_file_cfg *cfg) {
LFS_TRACE("lfs_file_opencfg(%p, %p, \"%s\", %x, %p {"
".buffer=%p, .attrs=%p, .attr_count=%"PRIu32"})",
(void*)lfs, (void*)file, path, flags,
@@ -3731,7 +3731,7 @@ int lfs_format(lfs_t *lfs) {
#endif
#if !defined(LFS_STATICCFG)
int lfs_formatcfg(lfs_t *lfs, const struct lfs_config *cfg) {
int lfs_formatcfg(lfs_t *lfs, const struct lfs_cfg *cfg) {
LFS_TRACE("lfs_formatcfg(%p, %p {.context=%p, "
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
".read_size=%"PRIu32", .prog_size=%"PRIu32", "
@@ -3892,7 +3892,7 @@ int lfs_mount(lfs_t *lfs) {
#endif
#if !defined(LFS_STATICCFG)
int lfs_mountcfg(lfs_t *lfs, const struct lfs_config *cfg) {
int lfs_mountcfg(lfs_t *lfs, const struct lfs_cfg *cfg) {
LFS_TRACE("lfs_mountcfg(%p, %p {.context=%p, "
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
".read_size=%"PRIu32", .prog_size=%"PRIu32", "
@@ -5008,7 +5008,7 @@ int lfs_migrate(lfs_t *lfs) {
#endif
#if !defined(LFS_STATICCFG)
int lfs_migratecfg(lfs_t *lfs, const struct lfs_config *cfg) {
int lfs_migratecfg(lfs_t *lfs, const struct lfs_cfg *cfg) {
LFS_TRACE("lfs_migratecfg(%p, %p {.context=%p, "
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
".read_size=%"PRIu32", .prog_size=%"PRIu32", "