mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-07-09 02:16:24 +00:00
401 lines
23 KiB
HTML
401 lines
23 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.16.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>libaaruformat: src/ngcw/ngcw_junk.h File Reference</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>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="cookie.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 id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">libaaruformat<span id="projectnumber"> 1.0</span>
|
|
</div>
|
|
<div id="projectbrief">Aaru Data Preservation Suite - Format Library</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.16.1 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(function() { codefold.init(); });
|
|
</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',true);
|
|
$(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function(){initNavTree('ngcw__junk_8h.html','',''); });
|
|
</script>
|
|
<div id="container">
|
|
<div id="doc-content">
|
|
<!-- 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 class="header">
|
|
<div class="headertitle"><div class="title">ngcw_junk.h File Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><code>#include <stdbool.h></code><br />
|
|
<code>#include <stdint.h></code><br />
|
|
<code>#include "<a class="el" href="lfg_8h_source.html">lfg.h</a>"</code><br />
|
|
</div>
|
|
<p><a href="ngcw__junk_8h_source.html">Go to the source code of this file.</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:NgcwJunkEntry" id="r_NgcwJunkEntry"><td class="memItemLeft">struct  </td><td class="memItemRight"><a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a></td></tr>
|
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">In-memory junk map entry. <a href="structNgcwJunkEntry.html#details">More...</a><br /></td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 id="header-define-members" class="groupheader"><a id="define-members" name="define-members"></a>
|
|
Macros</h2></td></tr>
|
|
<tr class="memitem:ad8587c84f30a3f328869e304138d3ad8" id="r_ad8587c84f30a3f328869e304138d3ad8"><td class="memItemLeft">#define </td><td class="memItemRight"><a class="el" href="#ad8587c84f30a3f328869e304138d3ad8">AARUFORMAT_CONTEXT_DECLARED</a></td></tr>
|
|
<tr class="memitem:aca5694a8ac4a72ca048d30aa3e534a6b" id="r_aca5694a8ac4a72ca048d30aa3e534a6b"><td class="memItemLeft">#define </td><td class="memItemRight"><a class="el" href="#aca5694a8ac4a72ca048d30aa3e534a6b">NGCW_JUNK_MAP_VERSION</a>   1</td></tr>
|
|
<tr class="memdesc:aca5694a8ac4a72ca048d30aa3e534a6b"><td class="mdescLeft"> </td><td class="mdescRight">Current junk map serialization version. <br /></td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 id="header-typedef-members" class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
|
Typedefs</h2></td></tr>
|
|
<tr class="memitem:a745430b26784e92a2242c1010bf73340" id="r_a745430b26784e92a2242c1010bf73340"><td class="memItemLeft">typedef struct NgcwJunkEntry </td><td class="memItemRight"><a class="el" href="#a745430b26784e92a2242c1010bf73340">NgcwJunkEntry</a></td></tr>
|
|
<tr class="memdesc:a745430b26784e92a2242c1010bf73340"><td class="mdescLeft"> </td><td class="mdescRight">In-memory junk map entry. <br /></td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:a0db54dfda52f4a427fd159df3bc6dda0" id="r_a0db54dfda52f4a427fd159df3bc6dda0"><td class="memItemLeft">int32_t </td><td class="memItemRight"><a class="el" href="#a0db54dfda52f4a427fd159df3bc6dda0">ngcw_serialize_junk_map</a> (const <a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> *entries, uint32_t count, uint8_t **out_data, uint32_t *out_len)</td></tr>
|
|
<tr class="memdesc:a0db54dfda52f4a427fd159df3bc6dda0"><td class="mdescLeft"> </td><td class="mdescRight">Serialize a junk map for storage as a media tag. <br /></td></tr>
|
|
<tr class="memitem:a464c045db67240ae9c3e54fbf7d6d959" id="r_a464c045db67240ae9c3e54fbf7d6d959"><td class="memItemLeft">int32_t </td><td class="memItemRight"><a class="el" href="#a464c045db67240ae9c3e54fbf7d6d959">ngcw_deserialize_junk_map</a> (const uint8_t *data, uint32_t data_len, <a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> **entries, uint32_t *count, uint16_t *seed_size)</td></tr>
|
|
<tr class="memdesc:a464c045db67240ae9c3e54fbf7d6d959"><td class="mdescLeft"> </td><td class="mdescRight">Deserialize a junk map from a media tag buffer. <br /></td></tr>
|
|
<tr class="memitem:af61bca5a962d01d631b0a7135be54f08" id="r_af61bca5a962d01d631b0a7135be54f08"><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="#af61bca5a962d01d631b0a7135be54f08">ngcw_regenerate_junk_sector</a> (const <a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> *entries, uint32_t entry_count, uint64_t disc_offset, uint8_t *output, uint32_t length)</td></tr>
|
|
<tr class="memdesc:af61bca5a962d01d631b0a7135be54f08"><td class="mdescLeft"> </td><td class="mdescRight">Regenerate a junk sector from the junk map. <br /></td></tr>
|
|
<tr class="memitem:a8aae28231f89db161998f42c61b2e246" id="r_a8aae28231f89db161998f42c61b2e246"><td class="memItemLeft">void </td><td class="memItemRight"><a class="el" href="#a8aae28231f89db161998f42c61b2e246">ngcw_junk_lazy_init</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
|
<tr class="memdesc:a8aae28231f89db161998f42c61b2e246"><td class="mdescLeft"> </td><td class="mdescRight">Lazy initialization: load junk map from media tags. <br /></td></tr>
|
|
</table>
|
|
<a name="doc-define-members" id="doc-define-members"></a><h2 id="header-doc-define-members" class="groupheader">Macro Definition Documentation</h2>
|
|
<a id="ad8587c84f30a3f328869e304138d3ad8" name="ad8587c84f30a3f328869e304138d3ad8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad8587c84f30a3f328869e304138d3ad8">◆ </a></span>AARUFORMAT_CONTEXT_DECLARED</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define AARUFORMAT_CONTEXT_DECLARED</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8h_source.html#l00031">31</a> of file <a class="el" href="ngcw__junk_8h_source.html">ngcw_junk.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aca5694a8ac4a72ca048d30aa3e534a6b" name="aca5694a8ac4a72ca048d30aa3e534a6b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aca5694a8ac4a72ca048d30aa3e534a6b">◆ </a></span>NGCW_JUNK_MAP_VERSION</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define NGCW_JUNK_MAP_VERSION   1</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Current junk map serialization version. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8h_source.html#l00040">40</a> of file <a class="el" href="ngcw__junk_8h_source.html">ngcw_junk.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="ngcw__junk_8c_source.html#l00104">ngcw_deserialize_junk_map()</a>, and <a class="el" href="ngcw__junk_8c_source.html#l00075">ngcw_serialize_junk_map()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a name="doc-typedef-members" id="doc-typedef-members"></a><h2 id="header-doc-typedef-members" class="groupheader">Typedef Documentation</h2>
|
|
<a id="a745430b26784e92a2242c1010bf73340" name="a745430b26784e92a2242c1010bf73340"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a745430b26784e92a2242c1010bf73340">◆ </a></span>NgcwJunkEntry</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef struct NgcwJunkEntry NgcwJunkEntry</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>In-memory junk map entry. </p>
|
|
<p>Each entry describes a contiguous region of LFG-generated junk on disc. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
|
|
<a id="a464c045db67240ae9c3e54fbf7d6d959" name="a464c045db67240ae9c3e54fbf7d6d959"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a464c045db67240ae9c3e54fbf7d6d959">◆ </a></span>ngcw_deserialize_junk_map()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int32_t ngcw_deserialize_junk_map </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const uint8_t *</td> <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>data_len</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> **</td> <td class="paramname"><span class="paramname"><em>entries</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t *</td> <td class="paramname"><span class="paramname"><em>count</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t *</td> <td class="paramname"><span class="paramname"><em>seed_size</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Deserialize a junk map from a media tag buffer. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">data</td><td>Serialized data buffer. </td></tr>
|
|
<tr><td class="paramname">data_len</td><td>Length of the data buffer. </td></tr>
|
|
<tr><td class="paramname">entries</td><td>Output: malloc'd array of <a class="el" href="structNgcwJunkEntry.html" title="In-memory junk map entry.">NgcwJunkEntry</a> (caller must free). </td></tr>
|
|
<tr><td class="paramname">count</td><td>Output: number of entries. </td></tr>
|
|
<tr><td class="paramname">seed_size</td><td>Output: seed size in uint32 words. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, negative error code on failure. </dd></dl>
|
|
<p>< Current junk map serialization version.</p>
|
|
<p>< Number of uint32 words needed to seed the LFG.</p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8c_source.html#l00104">104</a> of file <a class="el" href="ngcw__junk_8c_source.html">ngcw_junk.c</a>.</p>
|
|
|
|
<p class="reference">References <a class="el" href="ngcw__junk_8c_source.html#l00073">JUNK_MAP_HEADER_SIZE</a>, <a class="el" href="ngcw__junk_8h_source.html#l00050">NgcwJunkEntry::length</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, <a class="el" href="ngcw__junk_8h_source.html#l00040">NGCW_JUNK_MAP_VERSION</a>, <a class="el" href="ngcw__junk_8h_source.html#l00049">NgcwJunkEntry::offset</a>, <a class="el" href="ngcw__junk_8h_source.html#l00051">NgcwJunkEntry::partition_index</a>, <a class="el" href="ngcw__junk_8c_source.html#l00030">read_le16()</a>, <a class="el" href="ngcw__junk_8c_source.html#l00032">read_le32()</a>, and <a class="el" href="ngcw__junk_8c_source.html#l00035">read_le64()</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="ngcw__junk_8c_source.html#l00211">ngcw_junk_lazy_init()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8aae28231f89db161998f42c61b2e246" name="a8aae28231f89db161998f42c61b2e246"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8aae28231f89db161998f42c61b2e246">◆ </a></span>ngcw_junk_lazy_init()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void ngcw_junk_lazy_init </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Lazy initialization: load junk map from media tags. </p>
|
|
<p>Populates ctx->ngcw_junk_entries from the kMediaTagNgcwJunkMap media tag.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ctx</td><td>AaruFormat context. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8c_source.html#l00211">211</a> of file <a class="el" href="ngcw__junk_8c_source.html">ngcw_junk.c</a>.</p>
|
|
|
|
<p class="reference">References <a class="el" href="context_8h_source.html#l00123">mediaTagEntry::data</a>, <a class="el" href="ngcw__junk_8c_source.html#l00073">JUNK_MAP_HEADER_SIZE</a>, <a class="el" href="aaru_8h_source.html#l01087">kMediaTagNgcwJunkMap</a>, <a class="el" href="context_8h_source.html#l00125">mediaTagEntry::length</a>, <a class="el" href="context_8h_source.html#l00267">aaruformat_context::mediaTags</a>, <a class="el" href="ngcw__junk_8c_source.html#l00104">ngcw_deserialize_junk_map()</a>, <a class="el" href="context_8h_source.html#l00364">aaruformat_context::ngcw_junk_entries</a>, <a class="el" href="context_8h_source.html#l00365">aaruformat_context::ngcw_junk_entry_count</a>, and <a class="el" href="context_8h_source.html#l00366">aaruformat_context::ngcw_junk_seed_size</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="read_8c_source.html#l00352">aaruf_read_sector()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af61bca5a962d01d631b0a7135be54f08" name="af61bca5a962d01d631b0a7135be54f08"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af61bca5a962d01d631b0a7135be54f08">◆ </a></span>ngcw_regenerate_junk_sector()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int ngcw_regenerate_junk_sector </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entries</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>entry_count</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>disc_offset</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>output</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>length</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Regenerate a junk sector from the junk map. </p>
|
|
<p>Looks up the given disc byte offset in the junk map, initializes the LFG with the matching entry's seed, advances to the correct stream position, and generates the requested number of bytes.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">entries</td><td>Array of junk entries (sorted by offset). </td></tr>
|
|
<tr><td class="paramname">entry_count</td><td>Number of entries. </td></tr>
|
|
<tr><td class="paramname">disc_offset</td><td>Disc byte offset of the sector to regenerate. </td></tr>
|
|
<tr><td class="paramname">output</td><td>Output buffer to fill. </td></tr>
|
|
<tr><td class="paramname">length</td><td>Number of bytes to generate. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 if the offset is not in the junk map. </dd></dl>
|
|
<p>< Number of uint32 words needed to seed the LFG.</p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8c_source.html#l00154">154</a> of file <a class="el" href="ngcw__junk_8c_source.html">ngcw_junk.c</a>.</p>
|
|
|
|
<p class="reference">References <a class="el" href="ngcw__junk_8h_source.html#l00050">NgcwJunkEntry::length</a>, <a class="el" href="lfg_8c_source.html#l00082">ngc_lfg_get_bytes()</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, <a class="el" href="lfg_8c_source.html#l00073">ngc_lfg_set_seed()</a>, and <a class="el" href="ngcw__junk_8h_source.html#l00049">NgcwJunkEntry::offset</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="read_8c_source.html#l00352">aaruf_read_sector()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0db54dfda52f4a427fd159df3bc6dda0" name="a0db54dfda52f4a427fd159df3bc6dda0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0db54dfda52f4a427fd159df3bc6dda0">◆ </a></span>ngcw_serialize_junk_map()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int32_t ngcw_serialize_junk_map </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="structNgcwJunkEntry.html">NgcwJunkEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entries</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>count</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t **</td> <td class="paramname"><span class="paramname"><em>out_data</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t *</td> <td class="paramname"><span class="paramname"><em>out_len</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Serialize a junk map for storage as a media tag. </p>
|
|
<p>Format (all little-endian): [2 bytes] version (uint16) [4 bytes] entry_count (uint32) [2 bytes] seed_size (uint16) — NGC_LFG_SEED_SIZE For each entry (86 bytes when seed_size=17): [8 bytes] offset (uint64) [8 bytes] length (uint64) [2 bytes] partition_index (uint16) [seed_size * 4 bytes] seed (raw bytes, big-endian uint32 words)</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">entries</td><td>Array of junk entries. </td></tr>
|
|
<tr><td class="paramname">count</td><td>Number of entries. </td></tr>
|
|
<tr><td class="paramname">out_data</td><td>Output: malloc'd buffer (caller must free). </td></tr>
|
|
<tr><td class="paramname">out_len</td><td>Output: length of the buffer. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, negative error code on failure. </dd></dl>
|
|
<p>< Number of uint32 words needed to seed the LFG.</p>
|
|
<p>< Current junk map serialization version.</p>
|
|
<p>< Number of uint32 words needed to seed the LFG.</p>
|
|
<p>< Number of uint32 words needed to seed the LFG.</p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="ngcw__junk_8c_source.html#l00075">75</a> of file <a class="el" href="ngcw__junk_8c_source.html">ngcw_junk.c</a>.</p>
|
|
|
|
<p class="reference">References <a class="el" href="ngcw__junk_8c_source.html#l00073">JUNK_MAP_HEADER_SIZE</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, <a class="el" href="ngcw__junk_8h_source.html#l00040">NGCW_JUNK_MAP_VERSION</a>, <a class="el" href="ngcw__junk_8c_source.html#l00037">write_le16()</a>, <a class="el" href="ngcw__junk_8c_source.html#l00043">write_le32()</a>, and <a class="el" href="ngcw__junk_8c_source.html#l00051">write_le64()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<div id="page-nav" class="page-nav-panel">
|
|
<div id="page-nav-resize-handle"></div>
|
|
<div id="page-nav-tree">
|
|
<div id="page-nav-contents">
|
|
</div><!-- page-nav-contents -->
|
|
</div><!-- page-nav-tree -->
|
|
</div><!-- page-nav -->
|
|
</div><!-- container -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a href="dir_366d6a3889b2c1ca7d50351540a67e4b.html">ngcw</a></li><li class="navelem"><a href="ngcw__junk_8h.html">ngcw_junk.h</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.16.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|