ddnet/docs/output/files2/e_system-h.html

183 lines
116 KiB
HTML
Raw Normal View History

2008-08-05 21:37:33 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>OS Abstraction</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.4 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Content><div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="OS_Abstraction"></a>OS Abstraction</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#OS_Abstraction" >OS Abstraction</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Debug" >Debug</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#dbg_assert" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">dbg_assert</a></td><td class=SDescription>Breaks into the debugger based on a test.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#dbg_break" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">dbg_break</a></td><td class=SDescription>Breaks into the debugger.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#dbg_msg" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">dbg_msg</a></td><td class=SDescription>Prints a debug message.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Memory" >Memory</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mem_alloc" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">mem_alloc</a></td><td class=SDescription>Allocates memory.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mem_free" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">mem_free</a></td><td class=SDescription>Frees a block allocated through <a href="#mem_alloc" class=LFunction id=link6 onMouseOver="ShowTip(event, 'tt4', 'link6')" onMouseOut="HideTip('tt4')">mem_alloc</a>.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mem_copy" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">mem_copy</a></td><td class=SDescription>Copies a a memory block.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mem_move" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">mem_move</a></td><td class=SDescription>Copies a a memory block</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mem_zero" id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">mem_zero</a></td><td class=SDescription>Sets a complete memory block to 0</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mem_comp" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">mem_comp</a></td><td class=SDescription>Compares two blocks of memory</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#File_IO" >File IO</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#io_open" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">io_open</a></td><td class=SDescription>Opens a file.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#io_read" id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">io_read</a></td><td class=SDescription>Reads data into a buffer from a file.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#io_skip" id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">io_skip</a></td><td class=SDescription>Skips data in a file.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#io_write" id=link14 onMouseOver="ShowTip(event, 'tt13', 'link14')" onMouseOut="HideTip('tt13')">io_write</a></td><td class=SDescription>Writes data from a buffer to file.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#io_seek" id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">io_seek</a></td><td c
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Debug"></a>Debug</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="dbg_assert"></a>dbg_assert</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void dbg_assert(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>test,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Breaks into the debugger based on a test.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>test</td><td class=CDLDescription>Result of the test.</td></tr><tr><td class=CDLEntry>msg</td><td class=CDLDescription>Message that should be printed if the test fails.</td></tr></table><h4 class=CHeading>Remarks</h4><p>Does nothing in release version of the library.</p><h4 class=CHeading>See Also</h4><p><a href="#dbg_break" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt2', 'link59')" onMouseOut="HideTip('tt2')">dbg_break</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="dbg_break"></a>dbg_break</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>void dbg_break()</td></tr></table></blockquote><p>Breaks into the debugger.</p><h4 class=CHeading>Remarks</h4><p>Does nothing in release version of the library.</p><h4 class=CHeading>See Also</h4><p><a href="#dbg_assert" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt1', 'link60')" onMouseOut="HideTip('tt1')">dbg_assert</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="dbg_msg"></a>dbg_msg</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void dbg_msg(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>sys,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>fmt,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>...</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Prints a debug message.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sys</td><td class=CDLDescription>A string that describes what system the message belongs to</td></tr><tr><td class=CDLEntry>fmt</td><td class=CDLDescription>A printf styled format string.</td></tr></table><h4 class=CHeading>Remarks</h4><p>Does nothing in relase version of the library.</p><h4 class=CHeading>See Also</h4><p><a href="#dbg_assert" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt1', 'link61')" onMouseOut="HideTip('tt1')">dbg_assert</a></p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Memory"></a>Memory</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_alloc"></a>mem_alloc</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void *mem_alloc_debug(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>filename,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>line,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>alignment</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Allocates memory.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the needed block.</td></tr><tr><td class=CDLEntry>alignment</td><td class=CDLDescription>Alignment for the block.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a pointer to the newly allocated block.&nbsp; Returns a null pointer if the memory couldn&rsquo;t be allocated.</p><h4 class=CHeading>Remarks</h4><ul><li>Passing 0 to size will allocated the smallest amount possible and return a unique pointer.</li></ul><h4 class=CHeading>See Also</h4><p><a href="#mem_free" class=LFunction id=link62 onMouseOver="ShowTip(event, 'tt5', 'link62')" onMouseOut="HideTip('tt5')">mem_free</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_free"></a>mem_free</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_free(</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>block</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Frees a block allocated through <a href="#mem_alloc" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt4', 'link63')" onMouseOut="HideTip('tt4')">mem_alloc</a>.</p><h4 class=CHeading>Remarks</h4><ul><li>In the debug version of the library the function will assert if a non-valid block is passed, like a null pointer or a block that isn&rsquo;t allocated.</li></ul><h4 class=CHeading>See Also</h4><p><a href="#mem_alloc" class=LFunction id=link64 onMouseOver="ShowTip(event, 'tt4', 'link64')" onMouseOut="HideTip('tt4')">mem_alloc</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_copy"></a>mem_copy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_copy(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dest,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>source,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copies a a memory block.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dest</td><td class=CDLDescription>Destination.</td></tr><tr><td class=CDLEntry>source</td><td class=CDLDescription>Source to copy.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the block to copy.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>This functions DOES NOT handles cases where source and destination is overlapping.</li></ul><h4 class=CHeading>See Also</h4><p><a href="#mem_move" class=LFunction id=link65 onMouseOver="ShowTip(event, 'tt7', 'link65')" onMouseOut="HideTip('tt7')">mem_move</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_move"></a>mem_move</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_move(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dest,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>source,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copies a a memory block</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dest</td><td class=CDLDescription>Destination</td></tr><tr><td class=CDLEntry>source</td><td class=CDLDescription>Source to copy</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the block to copy</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>This functions handles cases where source and destination is overlapping</li></ul><h4 class=CHeading>See Also</h4><p><a href="#mem_copy" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt6', 'link66')" onMouseOut="HideTip('tt6')">mem_copy</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_zero"></a>mem_zero</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_zero(</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>block,</td></tr><tr><td></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets a complete memory block to 0</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>block</td><td class=CDLDescription>Pointer to the block to zero out</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the block</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mem_comp"></a>mem_comp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int mem_comp(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Compares two blocks of memory</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>First block of data</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>Second block of data</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the data to compare</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>&lt;0</td><td class=CDLDescription>Block a is lesser then block b</td></tr><tr><td class=CDLEntry>0</td><td class=CDLDescription>Block a is equal to block b</td></tr></table><blockquote><pre>0 - Block a is greater then block b</pre></blockquote></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="File_IO"></a>File IO</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_open"></a>io_open</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>IOHANDLE io_open(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>filename,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>flags</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Opens a file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>filename</td><td class=CDLDescription>File to open.</td></tr><tr><td class=CDLEntry>flags</td><td class=CDLDescription>A set of flags.&nbsp; IOFLAG_READ, IOFLAG_WRITE, IOFLAG_RANDOM.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a handle to the file on success and 0 on failure.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_read"></a>io_read</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unsigned io_read(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>io,</td></tr><tr><td></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>buffer,</td></tr><tr><td></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads data into a buffer from a file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file to read data from.</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>Pointer to the buffer that will recive the data.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Number of bytes to read from the file.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of bytes read.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_skip"></a>io_skip</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unsigned io_skip(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io,</td></tr><tr><td></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Skips data in a file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Number of bytes to skip.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of bytes skipped.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_write"></a>io_write</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unsigned io_write(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>io,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>buffer,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes data from a buffer to file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>Pointer to the data that should be written.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Number of bytes to write.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of bytes written.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_seek"></a>io_seek</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int io_seek(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>offset,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>origin</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Seeks to a specified offset in the file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr><tr><td class=CDLEntry>offset</td><td class=CDLDescription>Offset from pos to stop.</td></tr><tr><td class=CDLEntry>origin</td><td class=CDLDescription>Position to start searching from.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_tell"></a>io_tell</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>long int io_tell(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the current position in the file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns the current position.&nbsp; -1L if an error occured.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_length"></a>io_length</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>long int io_length(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the total length of the file.&nbsp; Resetting cursor to the beginning</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns the total size.&nbsp; -1L if an error occured.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_close"></a>io_close</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int io_close(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Closes a file.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_flush"></a>io_flush</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int io_flush(</td><td class=PType nowrap>IOHANDLE&nbsp;</td><td class=PParameter nowrap>io</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Empties all buffers and writes all pending data.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>io</td><td class=CDLDescription>Handle to the file.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_stdin"></a>io_stdin</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>IOHANDLE io_stdin()</td></tr></table></blockquote><p>Returns an &lt;IOHANDLE&gt; to the standard input.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_stdout"></a>io_stdout</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>IOHANDLE io_stdout()</td></tr></table></blockquote><p>Returns an &lt;IOHANDLE&gt; to the standard output.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="io_stderr"></a>io_stderr</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>IOHANDLE io_stderr()</td></tr></table></blockquote><p>Returns an &lt;IOHANDLE&gt; to the standard error.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Threads"></a>Threads</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="thread_sleep"></a>thread_sleep</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void thread_sleep(</td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>milliseconds</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Suspends the current thread for a given period.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>milliseconds</td><td class=CDLDescription>Number of milliseconds to sleep.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="thread_create"></a>thread_create</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void *thread_create(</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>(*threadfunc)(void *),</td></tr><tr><td></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>user</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new thread.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>threadfunc</td><td class=CDLDescription>Entry point for the new thread.</td></tr><tr><td class=CDLEntry>user</td><td class=CDLDescription>Pointer to pass to the thread.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="thread_wait"></a>thread_wait</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void thread_wait(</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>thread</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Waits for a thread to be done or destroyed.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>thread</td><td class=CDLDescription>Thread to wait for.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="thread_destoy"></a>thread_destoy</h3><div class=CBody><p>Destroys a thread.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>thread</td><td class=CDLDescription>Thread to destroy.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="thread_yeild"></a>thread_yeild</h3><div class=CBody><p>Yeild the current threads execution slice.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Locks"></a>Locks</h3></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Timer"></a>Timer</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="time_get"></a>time_get</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>int64 time_get()</td></tr></table></blockquote><p>Fetches a sample from a high resolution timer.</p><h4 class=CHeading>Returns</h4><p>Current value of the timer.</p><h4 class=CHeading>Remarks</h4><p>To know how fast the timer is ticking, see <a href="#time_freq" class=LFunction id=link67 onMouseOver="ShowTip(event, 'tt26', 'link67')" onMouseOut="HideTip('tt26')">time_freq</a>.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="time_freq"></a>time_freq</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>int64 time_freq()</td></tr></table></blockquote><p>Returns the frequency of the high resolution timer.</p><h4 class=CHeading>Returns</h4><p>Returns the frequency of the high resolution timer.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="time_timestamp"></a>time_timestamp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned time_timestamp()</td></tr></table></blockquote><p>Retrives the current time as a UNIX timestamp</p><h4 class=CHeading>Returns</h4><p>The time as a UNIX timestamp</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Network_General"></a>Network General</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_init"></a>net_init</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>int net_init()</td></tr></table></blockquote><p>Initiates network functionallity.</p><h4 class=CHeading>Returns</h4><p>Returns 0 on success,</p><h4 class=CHeading>Remarks</h4><p>You must call this function before using any other network functions.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_host_lookup"></a>net_host_lookup</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_host_lookup(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>hostname,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>types</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Does a hostname lookup by name and fills out the passed NETADDR struct with the recieved details.</p><h4 class=CHeading>Returns</h4><p>0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_addr_comp"></a>net_addr_comp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_addr_comp(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Compares two network addresses.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>Address to compare</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>Address to compare to.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>&lt;0</td><td class=CDLDescription>Address a is lesser then address b</td></tr><tr><td class=CDLEntry>0</td><td class=CDLDescription>Address a is equal to address b</td></tr></table><blockquote><pre>0 - Address a is greater then address b</pre></blockquote></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_addr_str"></a>net_addr_str</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_addr_str(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>string,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>max_length</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Turns a network address into a representive string.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>addr</td><td class=CDLDescription>Address to turn into a string.</td></tr><tr><td class=CDLEntry>string</td><td class=CDLDescription>Buffer to fill with the string.</td></tr><tr><td class=CDLEntry>max_length</td><td class=CDLDescription>Maximum size of the string.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The string will always be zero terminated</li></ul></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Network_UDP"></a>Network UDP</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_udp_create"></a>net_udp_create</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>NETSOCKET net_udp_create(</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameter nowrap>bindaddr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a UDP socket and binds it to a port.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>bindaddr</td><td class=CDLDescription>Address to bind the socket to.</td></tr></table><h4 class=CHeading>Returns</h4><p>On success it returns an handle to the socket.&nbsp; On failure it returns NETSOCKET_INVALID.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_udp_send"></a>net_udp_send</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_udp_send(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>data,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sends a packet over an UDP socket.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to use.</td></tr><tr><td class=CDLEntry>addr</td><td class=CDLDescription>Where to send the packet.</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Pointer to the packet data to send.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the packet.</td></tr></table><h4 class=CHeading>Returns</h4><p>On success it returns the number of bytes sent.&nbsp; Returns -1 on error.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_udp_recv"></a>net_udp_recv</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_udp_recv(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr,</td></tr><tr><td></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>data,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>maxsize</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Recives a packet over an UDP socket.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to use.</td></tr><tr><td class=CDLEntry>addr</td><td class=CDLDescription>Pointer to an NETADDR that will recive the address.</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Pointer to a buffer that will recive the data.</td></tr><tr><td class=CDLEntry>maxsize</td><td class=CDLDescription>Maximum size to recive.</td></tr></table><h4 class=CHeading>Returns</h4><p>On success it returns the number of bytes recived.&nbsp; Returns -1 on error.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_udp_close"></a>net_udp_close</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_udp_close(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameter nowrap>sock</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Closes an UDP socket.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to close.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.&nbsp; -1 on error.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Network_TCP"></a>Network TCP</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_create"></a>net_tcp_create</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>NETSOCKET net_tcp_create(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a TCP socket.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>bindaddr</td><td class=CDLDescription>Address to bind the socket to.</td></tr></table><h4 class=CHeading>Returns</h4><p>On success it returns an handle to the socket.&nbsp; On failure it returns NETSOCKET_INVALID.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_listen"></a>net_tcp_listen</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_listen(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>backlog</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Makes the socket start listening for new connections.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to start listen to.</td></tr><tr><td class=CDLEntry>backlog</td><td class=CDLDescription>Size of the queue of incomming connections to keep.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_accept"></a>net_tcp_accept</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_accept(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>new_sock,</td></tr><tr><td></td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Polls a listning socket for a new connection.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Listning socket to poll.</td></tr><tr><td class=CDLEntry>new_sock</td><td class=CDLDescription>Pointer to a socket to fill in with the new socket.</td></tr><tr><td class=CDLEntry>addr</td><td class=CDLDescription>Pointer to an address that will be filled in the remote address (optional, can be NULL).</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a non-negative integer on success.&nbsp; Negative integer on failure.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_connect"></a>net_tcp_connect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_connect(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>addr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Connects one socket to another.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to connect.</td></tr><tr><td class=CDLEntry>addr</td><td class=CDLDescription>Address to connect to.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_send"></a>net_tcp_send</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_send(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>data,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sends data to a TCP stream.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to send data to.</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Pointer to the data to send.</td></tr><tr><td class=CDLEntry>size</td><td class=CDLDescription>Size of the data to send.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of bytes sent.&nbsp; Negative value on failure.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_recv"></a>net_tcp_recv</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_recv(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>data,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>maxsize</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Recvives data from a TCP stream.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to recvive data from.</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Pointer to a buffer to write the data to</td></tr><tr><td class=CDLEntry>max_size</td><td class=CDLDescription>Maximum of data to write to the buffer.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of bytes recvived.&nbsp; Negative value on failure.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_close"></a>net_tcp_close</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_close(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameter nowrap>sock</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Closes a TCP socket.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>sock</td><td class=CDLDescription>Socket to close.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.&nbsp; Negative value on failure.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strings"></a>Strings</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_append"></a>str_append</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_append(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dst,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>src,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>dst_size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Appends a string to another.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dst</td><td class=CDLDescription>Pointer to a buffer that contains a string.</td></tr><tr><td class=CDLEntry>src</td><td class=CDLDescription>String to append.</td></tr><tr><td class=CDLEntry>dst_size</td><td class=CDLDescription>Size of the buffer of the dst string.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The strings are treated as zero-termineted strings.</li><li>Garantees that dst string will contain zero-termination.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_copy"></a>str_copy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_copy(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dst,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>src,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>dst_size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copies a string to another.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dst</td><td class=CDLDescription>Pointer to a buffer that shall recive the string.</td></tr><tr><td class=CDLEntry>src</td><td class=CDLDescription>String to be copied.</td></tr><tr><td class=CDLEntry>dst_size</td><td class=CDLDescription>Size of the buffer dst.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The strings are treated as zero-termineted strings.</li><li>Garantees that dst string will contain zero-termination.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_format"></a>str_format</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_format(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>buffer,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>buffer_size,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>format,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>...</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Performs printf formating into a buffer.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>Pointer to the buffer to recive the formated string.</td></tr><tr><td class=CDLEntry>buffer_size</td><td class=CDLDescription>Size of the buffer.</td></tr><tr><td class=CDLEntry>format</td><td class=CDLDescription>printf formating string.</td></tr><tr><td class=CDLEntry>...</td><td class=CDLDescription>Parameters for the formating.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>See the C manual for syntax for the printf formating string.</li><li>The strings are treated as zero-termineted strings.</li><li>Garantees that dst string will contain zero-termination.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_sanitize_strong"></a>str_sanitize_strong</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_sanitize_strong(</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>str</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Replaces all characters below 32 and above 127 with whitespace.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>str</td><td class=CDLDescription>String to sanitize.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The strings are treated as zero-termineted strings.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_sanitize"></a>str_sanitize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_sanitize(</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>str</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Replaces all characters below 32 and above 127 with whitespace with exception to \r, \n and \r.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>str</td><td class=CDLDescription>String to sanitize.</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The strings are treated as zero-termineted strings.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_comp_nocase"></a>str_comp_nocase</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int str_comp_nocase(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Compares to strings case insensitive.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>String to compare.</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>String to compare.</td></tr></table><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>&lt;0</td><td class=CDLDescription>String a is lesser then string b</td></tr><tr><td class=CDLEntry>0</td><td class=CDLDescription>String a is equal to string b</td></tr></table><blockquote><pre>0 - String a is greater then string b</pre></blockquote><h4 class=CHeading>Remarks</h4><ul><li>Only garanted to work with a-z/A-Z.</li><li>The strings are treated as zero-termineted strings.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_find_nocase"></a>str_find_nocase</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>const char *str_find_nocase(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>haystack,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>needle</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Finds a string inside another string case insensitive.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>haystack</td><td class=CDLDescription>String to search in</td></tr><tr><td class=CDLEntry>needle</td><td class=CDLDescription>String to search for</td></tr></table><h4 class=CHeading>Returns</h4><p>A pointer into haystack where the needle was found.&nbsp; Returns NULL of needle could not be found.</p><h4 class=CHeading>Remarks</h4><ul><li>Only garanted to work with a-z/A-Z.</li><li>The strings are treated as zero-termineted strings.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="str_hex"></a>str_hex</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void str_hex(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dst,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>dst_size,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>data,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>data_size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Takes a datablock and generates a hexstring of it.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dst</td><td class=CDLDescription>Buffer to fill with hex data</td></tr><tr><td class=CDLEntry>dst_size</td><td class=CDLDescription>size of the buffer</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Data to turn into hex</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>Size of the data</td></tr></table><h4 class=CHeading>Remarks</h4><ul><li>The desination buffer will be zero-terminated</li></ul></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Filesystem"></a>Filesystem</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="fs_listdir"></a>fs_listdir</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>typedef void (</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>fs_listdir_callback</td><td class=PAfterParameters nowrap>)(const char *name, int is_dir, void *user)</td></tr></table></td></tr></table></blockquote><p>Lists the files in a directory</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dir</td><td class=CDLDescription>Directory to list</td></tr><tr><td class=CDLEntry>cb</td><td class=CDLDescription>Callback function to call for each entry</td></tr><tr><td class=CDLEntry>user</td><td class=CDLDescription>Pointer to give to the callback</td></tr></table><h4 class=CHeading>Returns</h4><p>Always returns 0.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="fs_makedir"></a>fs_makedir</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int fs_makedir(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>path</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a directory</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>path</td><td class=CDLDescription>Directory to create</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns 0 on success.&nbsp; Negative value on failure.</p><h4 class=CHeading>Remarks</h4><p>Does not create several directories if needed.&nbsp; &ldquo;a/b/c&rdquo; will result in a failure if b or a does not exist.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="fs_storage_path"></a>fs_storage_path</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int fs_storage_path(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>appname,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>path,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>max</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Fetches per user configuration directory.</p><h4 class=CHeading>Returns</h4><p>Returns 0 on success.&nbsp; Negative value on failure.</p><h4 class=CHeading>Remarks</h4><ul><li>Returns ~/.appname on UNIX based systems</li><li>Returns ~/Library/Applications Support/appname on Mac OS X</li><li>Returns %APPDATA%/Appname on Windows based systems</li></ul></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Undocumented"></a>Undocumented</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_connect_non_blocking"></a>net_tcp_connect_non_blocking</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_connect_non_blocking(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>sock,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>NETADDR&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>DOCTODO: serp</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_set_non_blocking"></a>net_tcp_set_non_blocking</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int net_tcp_set_non_blocking(</td><td class=PType nowrap>NETSOCKET&nbsp;</td><td class=PParameter nowrap>sock</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>DOCTODO: serp</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_tcp_set_non_blocking"></a>net_tcp_set_non_blocking</h3><div class=CBody><p>DOCTODO: serp</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_errno"></a>net_errno</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>int net_errno()</td></tr></table></blockquote><p>DOCTODO: serp</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="net_would_block"></a>net_would_block</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>int net_would_block()</td></tr></table></blockquote><p>DOCTODO: serp</p></div></div></div>
</div><!--Content-->
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<div id=Menu><div class=MEntry><div class=MFile id=MSelected>OS Abstraction</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Engine</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MFile><a href="e_if_msg-h.html">Messaging</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Client</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Overview</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="docs/client_time-txt.html">Time on the client</a></div></div><div class=MEntry><div class=MFile><a href="docs/prediction-txt.html">Prediction</a></div></div><div class=MEntry><div class=MFile><a href="docs/snapshots-txt.html">Snapshots</a></div></div><div class=MEntry><div class=MFile><a href="docs/server_op-txt.html">Server Operation</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Reference</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="e_if_modc-h.html">Client Hooks</a></div></div><div class=MEntry><div class=MFile><a href="e_if_client-h.html">Client Interface</a></div></div><div class=MEntry><div class=MFile><a href="e_if_other-h.html">Engine Interface</a></div></div><div class=MEntry><div class=MFile><a href="e_if_gfx-h.html">Graphics</a></div></div><div class=MEntry><div class=MFile><a href="e_if_inp-h.html">Input</a></div></div><div class=MEntry><div class=MFile><a href="e_if_snd-h.html">Sound</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Server</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Reference</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="e_if_mods-h.html">Server Hooks</a></div></div><div class=MEntry><div class=MFile><a href="e_if_server-h.html">Server Interface</a></div></div></div></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent7')">Game</a><div class=MGroupContent id=MGroupContent7><div class=MEntry><div class=MFile><a href="../files/server/gs_common-hpp.html">Entity</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent8')">Index</a><div class=MGroupContent id=MGroupContent8><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([6, 7, 8], 9);// --></script></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void dbg_assert(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>test,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Breaks into the debugger based on a test.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>void dbg_break()</td></tr></table></blockquote>Breaks into the debugger.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void dbg_msg(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>sys,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>fmt,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>...</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Prints a debug message.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void *mem_alloc_debug(</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>char&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>filename,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>line,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>alignment</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Allocates memory.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_free(</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>block</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Frees a block allocated through mem_alloc.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void mem_copy(</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>dest,</td></tr><tr><td></td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>source,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>unsigned&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>size</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Cop
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>