-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuf_8h_source.html
More file actions
138 lines (136 loc) · 11.6 KB
/
buf_8h_source.html
File metadata and controls
138 lines (136 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ah_base/include/ah/buf.h Source File - Eclipse Arrowhead™ Core C Libraries</title>
<script src="jquery.js"></script>
<script 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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script>
window.addEventListener("load", () => {
let contents = document.querySelector("body > div.contents");
if (!contents) {
return;
}
document.querySelectorAll("#top ul > li.current > a > span").forEach((selectedMenuItem) => {
contents.classList.add(selectedMenuItem.innerText.trim().toLowerCase().replace(/\s+/, "-"));
});
for (let i = contents.childNodes.length - 1; i >= 0; i -= 1) {
let childNode = contents.childNodes.item(i);
if ((childNode.nodeType === 3 && childNode.textContent.trim().length === 0)
|| (childNode.nodeType === 1 && childNode.classList.contains("textblock") && childNode.textContent.trim().length === 0)) {
childNode.remove();
}
}
});
</script>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="DoxygenStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<header>
<img alt="Logo" src="arrowhead-logo-white.svg"/>
<h1>Eclipse Arrowhead™ Core C Libraries <span class="version"></span></h1>
</header>
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Overview</span></a></li>
<li><a href="files.html"><span>Headers</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e181be20417508ccbaf60a7ad88b28e5.html">ah_base</a></li><li class="navelem"><a class="el" href="dir_4e09807cd623eda32c4b1ef4b2b976fd.html">include</a></li><li class="navelem"><a class="el" href="dir_d9de5a19e148cb2028fab693738defa4.html">ah</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">buf.h</div></div>
</div><!--header-->
<div class="contents">
<a href="buf_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// SPDX-License-Identifier: EPL-2.0</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#ifndef AH_BUF_H_</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#define AH_BUF_H_</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include "internal/_buf.h"</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <stdbool.h></span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <stddef.h></span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <stdint.h></span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="buf_8h.html#ad59e8ddf44db3c0801e595baf03875d3"> 22</a></span><span class="preprocessor">#define AH_BUF_SIZE_MAX AH_I_BUF_SIZE_MAX</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="structah__buf.html"> 30</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structah__buf.html" title="Sized reference to a contiguous chunk of memory.">ah_buf</a> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#if defined(AH_DOXYGEN)</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="structah__buf.html#acdd0d66fbbf8a60fb81f4da75b9d77a9"> 32</a></span> uint8_t* <a class="code hl_variable" href="structah__buf.html#acdd0d66fbbf8a60fb81f4da75b9d77a9" title="Pointer to beginning of buffer memory region.">base</a>; </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="structah__buf.html#a3bf51052cb99b225285e663cc374edaf"> 33</a></span> uintX_t <a class="code hl_variable" href="structah__buf.html#a3bf51052cb99b225285e663cc374edaf" title="Size, in bytes, of memory region referred to by base.">size</a>; </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#elif AH_IS_WIN32</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> ULONG <a class="code hl_variable" href="structah__buf.html#a3bf51052cb99b225285e663cc374edaf" title="Size, in bytes, of memory region referred to by base.">size</a>; <span class="comment">// Guaranteed to be of a size smaller than or equal to size_t.</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> uint8_t* <a class="code hl_variable" href="structah__buf.html#acdd0d66fbbf8a60fb81f4da75b9d77a9" title="Pointer to beginning of buffer memory region.">base</a>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> uint8_t* <a class="code hl_variable" href="structah__buf.html#acdd0d66fbbf8a60fb81f4da75b9d77a9" title="Pointer to beginning of buffer memory region.">base</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="structah__buf.html#a3bf51052cb99b225285e663cc374edaf" title="Size, in bytes, of memory region referred to by base.">size</a>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>};</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="buf_8h.html#ab8358b3a015748dc06573002a8dff4e0"> 56</a></span><a class="code hl_define" href="defs_8h.html#a4a00eaa653b79c27bff40d48d658f86f" title="Specified before a function declaration or definition to make it available when linking.">ah_extern</a> <a class="code hl_typedef" href="defs_8h.html#a746483e29fbbad8cb71e1b3875763ae2" title="Signed integer type used to hold an error code.">ah_err_t</a> <a class="code hl_function" href="buf_8h.html#ab8358b3a015748dc06573002a8dff4e0" title="Safely initializes buf with base pointer and size.">ah_buf_init</a>(<a class="code hl_struct" href="structah__buf.html" title="Sized reference to a contiguous chunk of memory.">ah_buf_t</a>* buf, uint8_t* base, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="buf_8h.html#adb3218f1d3b002e2a656f833d90c6ffa"> 69</a></span><a class="code hl_define" href="defs_8h.html#a4a00eaa653b79c27bff40d48d658f86f" title="Specified before a function declaration or definition to make it available when linking.">ah_extern</a> <a class="code hl_struct" href="structah__buf.html" title="Sized reference to a contiguous chunk of memory.">ah_buf_t</a> <a class="code hl_function" href="buf_8h.html#adb3218f1d3b002e2a656f833d90c6ffa" title="Creates new ah_buf from given base pointer and 32-bit size.">ah_buf_from</a>(uint8_t* base, uint32_t size);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="buf_8h.html#a7f0437c57aba3929cd44b5d307833088"> 78</a></span><a class="code hl_define" href="defs_8h.html#a4a00eaa653b79c27bff40d48d658f86f" title="Specified before a function declaration or definition to make it available when linking.">ah_extern</a> <span class="keywordtype">bool</span> <a class="code hl_function" href="buf_8h.html#a7f0437c57aba3929cd44b5d307833088" title="Checks if buf has a NULL base or a size being 0.">ah_buf_is_empty</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structah__buf.html" title="Sized reference to a contiguous chunk of memory.">ah_buf_t</a>* buf);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<footer>Generated by <a href="https://doxygen.org">Doxygen</a> 1.9.5</footer>
</body>
</html>