zephyr/subsys/settings/include/settings/settings_file.h
Andrzej Puzdrowski 94ff339cbf subsys: Add a new settings subsystem
Adapt the MyNewt non-volatile configuration system to become a settings
system in Zephyr.
The original code was modifed in the following ways:

* Renamed from config to settings
* Use the zephyr FCB, FS API, and base64 subsystems
* lltoa like function was added to sources as it was required but not
  included in Zephyr itself.
* The original code was modified to use Zephyr's slist.h as single
  linked list implementation.
* Reworked code which was using strtok_r, added function
  for decoding a string to a s64_t value.
* Thank to the above the settings subsys doesn't require newlibc anymore.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-28 10:44:20 -04:00

37 lines
757 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
* Copyright (c) 2015 Runtime Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __SETTINGS_FILE_H_
#define __SETTINGS_FILE_H_
#include "settings/settings.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SETTINGS_FILE_NAME_MAX 32 /* max length for settings filename */
struct settings_file {
struct settings_store cf_store;
const char *cf_name; /* filename */
int cf_maxlines; /* max # of lines before compressing */
int cf_lines; /* private */
};
/* register file to be source of settings */
int settings_file_src(struct settings_file *cf);
/* settings saves go to a file */
int settings_file_dst(struct settings_file *cf);
#ifdef __cplusplus
}
#endif
#endif /* __SETTINGS_FILE_H_ */