1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<meta http-equiv="Content-Style-Type" content="text/css">
7<link rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>NHTTPStartup</title>
9</head>
10
11<body>
12
13<h1>NHTTPStartup</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/nhttp/NHTTPStartup.h&gt;
18
19typedef void* (*NHTTPAlloc)( u32 size, int align );
20typedef void  (*NHTTPFree)( void* ptr );
21
22int NHTTPStartup( NHTTPAlloc alloc, NHTTPFree free, u32 threadprio );
23</code></pre></dd></dl>
24
25<h2>Arguments</h2>
26<p>
27<table border="1" >
28  <tr>
29<td valign="top" width="120" bgcolor="#ffffe8"><code><strong><em>alloc</em></strong></code></td>
30<td width="520">Pointer to the memory block allocation function used inside the NHTTP library.</td>
31  </tr>
32  <tr>
33<td valign="top" width="120" bgcolor="#ffffe8"><code><strong><em>free</em></strong></code></td>
34<td width="520">Pointer to the memory block release function used inside the NHTTP library.</td>
35  </tr>
36  <tr>
37<td valign="top" width="120" bgcolor="#ffffe8"><code><strong><em>threadprio</em></strong></code></td>
38<td width="520">HTTP request thread priority (ranges from 0 to 31, with 0 being the highest priority).</tr>
39</table>
40<h2>Return Values</h2>
41<pre>
42Returns zero if initialized successfully. Otherwise, returns -1.
43In the event of a failure, contents of the error can be obtained with <a href="NHTTPGetError.html"><CODE>NHTTPGetError</CODE></a>.
44</pre>
45
46<h2>Description</h2>
47<p>
48Initializes the NHTTP library and sets the library as available.<br>This function must be called once before all other NHTTP library functions. Furthermore, after using the NHTTP library, the library must be shut down by calling <CODE><a href="NHTTPCleanupAsync.html">NHTTPCleanupAsync</a></CODE>.<br> If the library is initialized successfully, a single thread for processing is started internally.<br><br> <br>Invoke the <CODE>SOStartup</CODE> function and use after the socket has entered a usable state.
49</p>
50
51<h2>Note</h2>
52<p style="color:red">
53This does not take into consideration exclusive control between threads of user-configured memory allocation functions.
54</p>
55
56<h2>See Also</h2>
57<p>
58<code><a href="NHTTPCleanupAsync.html">NHTTPCleanupAsync</a></code>
59</p>
60
61<h2>Revision History</h2>
62<p>
632008/12/25 Added indication that it is necessary to call the <CODE>SOStartup</CODE> function.<br>2008/02/01 Initial version.
64</p>
65
66<hr><p>CONFIDENTIAL</p></body>
67</html>
68