You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

97 lines
19 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libubootenv: /home/stefano/Projects/internal/libubootenv/src/libuboot.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libubootenv
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">libuboot.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * (C) Copyright 2019</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * Stefano Babic, DENX Software Engineering, sbabic@denx.de.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * SPDX-License-Identifier: LGPL-2.1-or-later</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="keyword">struct </span><a class="code" href="structuboot__ctx.html">uboot_ctx</a>;</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="preprocessor">#define DEVNAME_MAX_LENGTH 40</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="structuboot__env__device.html"> 18</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structuboot__env__device.html">uboot_env_device</a> {</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="structuboot__env__device.html#ac0cf4b2a64c38ffd9efa7e64eecce518"> 20</a></span>&#160; <span class="keywordtype">char</span> *<a class="code" href="structuboot__env__device.html#ac0cf4b2a64c38ffd9efa7e64eecce518">devname</a>; </div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="structuboot__env__device.html#a23afa3336da40e543e4d6cb5f97b2596"> 22</a></span>&#160; <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="structuboot__env__device.html#a23afa3336da40e543e4d6cb5f97b2596">offset</a>;</div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="structuboot__env__device.html#a338e8e9e7983ce40ecec9b19dedb6570"> 24</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structuboot__env__device.html#a338e8e9e7983ce40ecec9b19dedb6570">envsize</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structuboot__env__device.html#a476c8206cd75f158b0d3c57736479d5c"> 26</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structuboot__env__device.html#a476c8206cd75f158b0d3c57736479d5c">sectorsize</a>;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structuboot__env__device.html#adee8d6455f3f3e1718b1ff8bc86c93dd"> 28</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="structuboot__env__device.html#adee8d6455f3f3e1718b1ff8bc86c93dd">envsectors</a>;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;};</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a0673e76b84dc2ee87abfb964067ac588">libuboot_read_config</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx, <span class="keyword">const</span> <span class="keywordtype">char</span> *config);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a8120a9bab8bc997599e4bad06b7e64b0">libuboot_configure</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx,</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keyword">struct</span> <a class="code" href="structuboot__env__device.html">uboot_env_device</a> *envdevs);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a9df69f8f657a6a97a134f919bcf18815">libuboot_load_file</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#ac096461b401628d0ccab3e7cfd9ddc87">libuboot_env_store</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a5c73ea6be0ec4704a68a3b133d5cc0d8">libuboot_initialize</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> **out,</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keyword">struct</span> <a class="code" href="structuboot__env__device.html">uboot_env_device</a> *envdevs);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="keywordtype">void</span> <a class="code" href="uboot__env_8c.html#ab18683f3eef002d0d0f5488f42b2002d">libuboot_exit</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a93ffd6f80b12eefcb7ff0df97b7e336e">libuboot_open</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="keywordtype">void</span> <a class="code" href="uboot__env_8c.html#a3de30b82724dbb591365f4369085cbd4">libuboot_close</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="keywordtype">int</span> <a class="code" href="uboot__env_8c.html#a32e8070e4a526fc4fc6627e1995066a6">libuboot_set_env</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx, <span class="keyword">const</span> <span class="keywordtype">char</span> *varname, <span class="keyword">const</span> <span class="keywordtype">char</span> *value);</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="keywordtype">char</span> *<a class="code" href="uboot__env_8c.html#a64d8aa3820262131086d4390133fcbca">libuboot_get_env</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx, <span class="keyword">const</span> <span class="keywordtype">char</span> *varname);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="keywordtype">void</span> *<a class="code" href="uboot__env_8c.html#ad9d8af43e38824f6b2a3d002d734ea24">libuboot_iterator</a>(<span class="keyword">struct</span> <a class="code" href="structuboot__ctx.html">uboot_ctx</a> *ctx, <span class="keywordtype">void</span> *next);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="uboot__env_8c.html#a1021f2448770d1be688aa903e727b962">libuboot_getname</a>(<span class="keywordtype">void</span> *entry);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="uboot__env_8c.html#af2b31c25064224641e650a8b6969e390">libuboot_getvalue</a>(<span class="keywordtype">void</span> *entry);</div><div class="ttc" id="uboot__env_8c_html_a93ffd6f80b12eefcb7ff0df97b7e336e"><div class="ttname"><a href="uboot__env_8c.html#a93ffd6f80b12eefcb7ff0df97b7e336e">libuboot_open</a></div><div class="ttdeci">int libuboot_open(struct uboot_ctx *ctx)</div><div class="ttdoc">Load an environment. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:912</div></div>
<div class="ttc" id="uboot__env_8c_html_a32e8070e4a526fc4fc6627e1995066a6"><div class="ttname"><a href="uboot__env_8c.html#a32e8070e4a526fc4fc6627e1995066a6">libuboot_set_env</a></div><div class="ttdeci">int libuboot_set_env(struct uboot_ctx *ctx, const char *varname, const char *value)</div><div class="ttdoc">Set a variable. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:772</div></div>
<div class="ttc" id="structuboot__env__device_html_a23afa3336da40e543e4d6cb5f97b2596"><div class="ttname"><a href="structuboot__env__device.html#a23afa3336da40e543e4d6cb5f97b2596">uboot_env_device::offset</a></div><div class="ttdeci">long long int offset</div><div class="ttdef"><b>Definition:</b> libuboot.h:22</div></div>
<div class="ttc" id="uboot__env_8c_html_ad9d8af43e38824f6b2a3d002d734ea24"><div class="ttname"><a href="uboot__env_8c.html#ad9d8af43e38824f6b2a3d002d734ea24">libuboot_iterator</a></div><div class="ttdeci">void * libuboot_iterator(struct uboot_ctx *ctx, void *next)</div><div class="ttdoc">Iterator. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:852</div></div>
<div class="ttc" id="uboot__env_8c_html_a1021f2448770d1be688aa903e727b962"><div class="ttname"><a href="uboot__env_8c.html#a1021f2448770d1be688aa903e727b962">libuboot_getname</a></div><div class="ttdeci">const char * libuboot_getname(void *entry)</div><div class="ttdoc">Accessor to get variable name from DB entry. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:838</div></div>
<div class="ttc" id="structuboot__env__device_html_ac0cf4b2a64c38ffd9efa7e64eecce518"><div class="ttname"><a href="structuboot__env__device.html#ac0cf4b2a64c38ffd9efa7e64eecce518">uboot_env_device::devname</a></div><div class="ttdeci">char * devname</div><div class="ttdef"><b>Definition:</b> libuboot.h:20</div></div>
<div class="ttc" id="uboot__env_8c_html_a0673e76b84dc2ee87abfb964067ac588"><div class="ttname"><a href="uboot__env_8c.html#a0673e76b84dc2ee87abfb964067ac588">libuboot_read_config</a></div><div class="ttdeci">int libuboot_read_config(struct uboot_ctx *ctx, const char *config)</div><div class="ttdoc">Read U-Boot environment configuration from a file. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:654</div></div>
<div class="ttc" id="uboot__env_8c_html_a64d8aa3820262131086d4390133fcbca"><div class="ttname"><a href="uboot__env_8c.html#a64d8aa3820262131086d4390133fcbca">libuboot_get_env</a></div><div class="ttdeci">char * libuboot_get_env(struct uboot_ctx *ctx, const char *varname)</div><div class="ttdoc">Get a variable. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:826</div></div>
<div class="ttc" id="uboot__env_8c_html_ac096461b401628d0ccab3e7cfd9ddc87"><div class="ttname"><a href="uboot__env_8c.html#ac096461b401628d0ccab3e7cfd9ddc87">libuboot_env_store</a></div><div class="ttdeci">int libuboot_env_store(struct uboot_ctx *ctx)</div><div class="ttdoc">Flush environment to the storage. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:393</div></div>
<div class="ttc" id="uboot__env_8c_html_af2b31c25064224641e650a8b6969e390"><div class="ttname"><a href="uboot__env_8c.html#af2b31c25064224641e650a8b6969e390">libuboot_getvalue</a></div><div class="ttdeci">const char * libuboot_getvalue(void *entry)</div><div class="ttdoc">Accessor to get variable value from DB entry. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:845</div></div>
<div class="ttc" id="structuboot__ctx_html"><div class="ttname"><a href="structuboot__ctx.html">uboot_ctx</a></div><div class="ttdef"><b>Definition:</b> uboot_private.h:100</div></div>
<div class="ttc" id="structuboot__env__device_html_a476c8206cd75f158b0d3c57736479d5c"><div class="ttname"><a href="structuboot__env__device.html#a476c8206cd75f158b0d3c57736479d5c">uboot_env_device::sectorsize</a></div><div class="ttdeci">size_t sectorsize</div><div class="ttdef"><b>Definition:</b> libuboot.h:26</div></div>
<div class="ttc" id="uboot__env_8c_html_a5c73ea6be0ec4704a68a3b133d5cc0d8"><div class="ttname"><a href="uboot__env_8c.html#a5c73ea6be0ec4704a68a3b133d5cc0d8">libuboot_initialize</a></div><div class="ttdeci">int libuboot_initialize(struct uboot_ctx **out, struct uboot_env_device *envdevs)</div><div class="ttdoc">Initialize the library. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:890</div></div>
<div class="ttc" id="uboot__env_8c_html_a3de30b82724dbb591365f4369085cbd4"><div class="ttname"><a href="uboot__env_8c.html#a3de30b82724dbb591365f4369085cbd4">libuboot_close</a></div><div class="ttdeci">void libuboot_close(struct uboot_ctx *ctx)</div><div class="ttdoc">Release an environment. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:920</div></div>
<div class="ttc" id="structuboot__env__device_html_adee8d6455f3f3e1718b1ff8bc86c93dd"><div class="ttname"><a href="structuboot__env__device.html#adee8d6455f3f3e1718b1ff8bc86c93dd">uboot_env_device::envsectors</a></div><div class="ttdeci">unsigned long envsectors</div><div class="ttdef"><b>Definition:</b> libuboot.h:28</div></div>
<div class="ttc" id="uboot__env_8c_html_ab18683f3eef002d0d0f5488f42b2002d"><div class="ttname"><a href="uboot__env_8c.html#ab18683f3eef002d0d0f5488f42b2002d">libuboot_exit</a></div><div class="ttdeci">void libuboot_exit(struct uboot_ctx *ctx)</div><div class="ttdoc">Release all resources and exit the library. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:937</div></div>
<div class="ttc" id="uboot__env_8c_html_a9df69f8f657a6a97a134f919bcf18815"><div class="ttname"><a href="uboot__env_8c.html#a9df69f8f657a6a97a134f919bcf18815">libuboot_load_file</a></div><div class="ttdeci">int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)</div><div class="ttdoc">Import environment from file. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:610</div></div>
<div class="ttc" id="structuboot__env__device_html_a338e8e9e7983ce40ecec9b19dedb6570"><div class="ttname"><a href="structuboot__env__device.html#a338e8e9e7983ce40ecec9b19dedb6570">uboot_env_device::envsize</a></div><div class="ttdeci">size_t envsize</div><div class="ttdef"><b>Definition:</b> libuboot.h:24</div></div>
<div class="ttc" id="uboot__env_8c_html_a8120a9bab8bc997599e4bad06b7e64b0"><div class="ttname"><a href="uboot__env_8c.html#a8120a9bab8bc997599e4bad06b7e64b0">libuboot_configure</a></div><div class="ttdeci">int libuboot_configure(struct uboot_ctx *ctx, struct uboot_env_device *envdevs)</div><div class="ttdoc">Read U-Boot environment configuration from structure. </div><div class="ttdef"><b>Definition:</b> uboot_env.c:861</div></div>
<div class="ttc" id="structuboot__env__device_html"><div class="ttname"><a href="structuboot__env__device.html">uboot_env_device</a></div><div class="ttdef"><b>Definition:</b> libuboot.h:18</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>