1 /*
2  * Copyright (c) 2018 Nordic Semiconductor ASA
3  * Copyright (c) 2015 Runtime Inc
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef __SETTINGS_FILE_H_
9 #define __SETTINGS_FILE_H_
10 
11 #include <zephyr/toolchain.h>
12 #include <zephyr/settings/settings.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #define SETTINGS_FILE_NAME_MAX 32 /* max length for settings filename */
19 
20 struct settings_file {
21 	struct settings_store cf_store;
22 	const char *cf_name;	/* filename */
23 	int cf_maxlines;	/* max # of lines before compressing */
24 	int cf_lines;		/* private */
25 };
26 
27 /* register file to be source of settings */
28 int settings_file_src(struct settings_file *cf);
29 
30 /* settings saves go to a file */
31 int settings_file_dst(struct settings_file *cf);
32 
33 void settings_mount_file_backend(struct settings_file *cf);
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif /* __SETTINGS_FILE_H_ */
40