libubootenv
Loading...
Searching...
No Matches
libuboot.h
1/*
2 * (C) Copyright 2019
3 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7
8#ifdef __cplusplus
9#include <cstddef>
10
11extern "C" {
12#endif
13
14#pragma once
15
16struct uboot_ctx;
17
18#define DEVNAME_MAX_LENGTH 256
19
20#define DEVNAME_SEPARATOR ':'
21
27 char *devname;
29 long long int offset;
31 size_t envsize;
33 size_t sectorsize;
35 unsigned long envsectors;
36};
37
43 const char *version;
45 unsigned int version_num;
46};
47
52const struct uboot_version_info *libuboot_version_info(void);
53
60int libuboot_read_config(struct uboot_ctx *ctx, const char *config);
61
68int libuboot_read_config_ext(struct uboot_ctx **ctx, const char *config);
69
76struct uboot_ctx *libuboot_get_namespace(struct uboot_ctx *ctxlist, const char *name);
77
84const char *libuboot_namespace_from_dt(void);
85
92int libuboot_configure(struct uboot_ctx *ctx,
94
107int libuboot_load_file(struct uboot_ctx *ctx, const char *filename);
108
117int libuboot_env_store(struct uboot_ctx *ctx);
118
128int libuboot_initialize(struct uboot_ctx **out,
129 struct uboot_env_device *envdevs);
130
135void libuboot_exit(struct uboot_ctx *ctx);
136
142int libuboot_open(struct uboot_ctx *ctx);
143
152void libuboot_close(struct uboot_ctx *ctx);
153
164int libuboot_set_env(struct uboot_ctx *ctx, const char *varname, const char *value);
165
177char *libuboot_get_env(struct uboot_ctx *ctx, const char *varname);
178
188void *libuboot_iterator(struct uboot_ctx *ctx, void *next);
189
195const char *libuboot_getname(void *entry);
196
202const char *libuboot_getvalue(void *entry);
203
204#ifdef __cplusplus
205}
206#endif
Definition uboot_private.h:114
char * name
Definition uboot_private.h:130
struct uboot_ctx * ctxlist
Definition uboot_private.h:136
struct uboot_flash_env envdevs[2]
Definition uboot_private.h:122
Definition libuboot.h:25
long long int offset
Definition libuboot.h:29
size_t envsize
Definition libuboot.h:31
size_t sectorsize
Definition libuboot.h:33
char * devname
Definition libuboot.h:27
unsigned long envsectors
Definition libuboot.h:35
Definition libuboot.h:41
unsigned int version_num
Definition libuboot.h:45
const char * version
Definition libuboot.h:43