⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memblock.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/tornado-api/wtxtcl/memBlock.html - generated by refgen from wtmemblk.c --> <title> memBlock [Tcl] </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>Tornado API Reference :  WTX Tcl Library</i></a></p></blockquote><h1>memBlock [Tcl]</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memBlock [Tcl]</strong> - WTX Tcl Memory Block Handling </p></blockquote><h4>TCL PROCEDURES</h4><blockquote><p><p><b><a href="./memBlock.html#memBlockCreate">memBlockCreate</a></b>  -  create a memory block<br><b><a href="./memBlock.html#memBlockSet">memBlockSet</a></b>  -  set the elements in a memory block<br><b><a href="./memBlock.html#memBlockGet">memBlockGet</a></b>  -  get the elements in a memory block<br><b><a href="./memBlock.html#memBlockGetString">memBlockGetString</a></b>  -  get the memory block contents in string form<br><b><a href="./memBlock.html#memBlockWriteFile">memBlockWriteFile</a></b>  -  write the memory block contents to a file<br><b><a href="./memBlock.html#memBlockDup">memBlockDup</a></b>  -  create a new block exactly like a given one<br><b><a href="./memBlock.html#memBlockSwap">memBlockSwap</a></b>  -  switch the endianness of a block<br><b><a href="./memBlock.html#memBlockList">memBlockList</a></b>  -  list the handles of all existing memory blocks<br><b><a href="./memBlock.html#memBlockInfo">memBlockInfo</a></b>  -  get information about a memory block<br><b><a href="./memBlock.html#memBlockDelete">memBlockDelete</a></b>  -  delete a memory block, freeing its resources<br><b><a href="./memBlock.html#memBlockDis">memBlockDis</a></b>  -  disassemble a memory block<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library of Tcl routines implements a memory block data type.The goal is to allow efficient management of blocks of targetmemory provided by WTX from Tcl programs.  In particular, thememory blocks are not converted to string form except when a Tclprogram requests it.<p>WTX routines that return (or accept) blocks of target memory shouldsupply block handles provided by this library.<p>Blocks have both a "logical" size, specified by their creator, andan allocation size.  The allocation size is the amount of heapmemory allotted for the block data.  The library obtains memory toenlarge blocks in chunks.<p>Blocks are coded for the endianness of the target that supplied them,and the memBlockSet/Get routines will automatically swap 16 and 32 bit quanities when they are stored to or retrieved from a block.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memBlock.html#top">memBlock</a></b><hr><a name="memBlockCreate"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library :  Tcl Procedures</i></a></p></blockquote><h1>memBlockCreate</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memBlockCreate</strong> - create a memory block</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>memBlockCreate [-L | -B] [-string <i>string</i>] [<i>size</i>] [<i>fillvalue</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function creates a memory block.  A memory block is an internal bufferused to hold buffers of raw binary data that can be manipulated with Tcl without the overhead of converting to a string representation.  Memory blocks are accessed with "block handles", short string names that are used as an argument to the commands which manipulate memory blocks.  Memory blocks are returned from memory read commands. They are used when writing target memory and other places where the WTX protocol exchanges unstructured data buffers between the host and target.<p>Memory blocks have an endianness which, by default, is set to big endian (<b>-B</b>).memBlockCreate does not interact with the target server, so if thedata in the block is destined for a little-endian target, it should be created with the <b>-L</b> flag. The endiannessof a block is only used to determine how the block data should be formatted when it is manipulated in 16- or 32-bit formats, and otherwise hasno effect on the internal representation.<p>A memory block is created with a particular size.  However, by "storing"new data past the end of a memory block, it can be extended.  "Holes"created by this technique are filled with the <i>fillvalue</i> (zero by default).<p>Memory blocks can be conveniently initialized with a string if <b>-string</b> is specified.  Then the block will automatically have the same length as the string (plus one byte for the terminating NULL character, whichis automatically added) although the size can be overridden here also.<p></blockquote><h4>RETURNS</h4><blockquote><p>A memory block handle.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>bad size<dd>A NULL or negative value has been asked for.<p><dt>too big<dd>The size value is out of the range.<p><dt>virtual memory exhausted<dd> No more heap memory is available.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p>wtxtcl, memBlockSet, memBlockGet, memBlockDelete, memBlockDup, memBlockList<hr><a name="memBlockSet"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library :  Tcl Procedures</i></a></p></blockquote><h1>memBlockSet</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memBlockSet</strong> - set the elements in a memory block</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>memBlockSet [-b | -w | -l] <i>blockId</i> <i>offset</i> <i>value</i>...</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function changes the contents of the named memory block.  The changesbegin at the byte offset supplied.  If the size of the values is greater than a byte (<b>-b</b>), the 16-bit (<b>-w</b>) or 32-bit (<b>-l</b>) values will be swapped before being stored in the block if the byte order of the block differs from that of the host.<p>Note that storing a value past the current end of the block causesit to grow.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>bad size: use -b, -w, or -l<dd>The wrong option was used.<p><dt>block not found<dd>The block ID does not exist.<p><dt>block maximum size exceeded<dd>The block has grown past the maximum size.<p><dt>virtual memory exhausted<dd> There is not enough heap memory to grow the block.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p>* wtxtcl, memBlockGet<hr><a name="memBlockGet"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library :  Tcl Procedures</i></a></p></blockquote><h1>memBlockGet</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memBlockGet</strong> - get the elements in a memory block</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>memBlockGet [-b | -w | -l] <i>blockId</i> [<i>offset</i>] [<i>count</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function fetches the contents of the named memory block.  The fetching begins at the byte <i>offset</i> supplied (or zero if this is not given).  If the size of the values is greater than a byte (<b>-b</b>), the 16-bit (<b>-w</b>) or 32-bit (<b>-l</b>) values are swapped before being placed in the result string if the byte order of the blockdiffers from that of the host.<i>count</i> values are fetched; if <i>count</i> is omitted, all the valuesare fetched.   To dump the entire block in the form of a byte vector, use the following command:<p><pre>memBlockGet $block</pre></blockquote><h4>RETURNS</h4><blockquote><p>A vector of values from the block.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>bad size: use -b, -w, or -l<dd>The wrong option was used.<p><dt>missing block handle<dd>The block handle option is missing.<p><dt>block not found<dd>The block ID does not exist.<p><dt>invalid count<dd>The count value is negative.<p><dt>request exceeds block size<dd><i>offset</i> + <i>count</i> is greater than the size of the block.<p><dt>virtual memory exhausted<dd> There is no more host memory available to store values into the block.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p>* wtxtcl, memBlockGetString, memBlockSet<hr><a name="memBlockGetString"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library :  Tcl Procedures</i></a></p></blockquote><h1>memBlockGetString</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memBlockGetString</strong> - get the memory block contents in string form</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>memBlockGetString <i>blockId</i> [<i>offset</i>] [<i>count</i>]</pre></blockquote><h4>DESCRIPTION </h4><blockquote><p>This function returns the string found in the named memory block.Starting at the given <i>offset</i>, characters are accumulated in theresult string until a null character is found, <i>count</i> charactershave been transferred, or the block is exhausted, whichever comesfirst.<p></blockquote><h4>RETURNS</h4><blockquote><p>The string representation of the memory block contents.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>block not found<dd>The block ID does not exist.<p><dt>invalid count<dd>The count value is negative.<p><dt>request exceeds block size<dd> The request does not fit in the block.<p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -