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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>WBT_RegisterBlock</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">WBT_RegisterBlock&nbsp;<img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;nitro/wbt.h&gt;</CODE><BR> <BR> <CODE>BOOL WBT_RegisterBlock(<A href="../wbt_block_info_list_type.html">WBTBlockInfoList</A> *block_info_list, u32 block_id, const void *user_id, const void *data_ptr, int data_size, u16 permission_bmp);</CODE><br> <br>
20  </dd>
21</dl>
22<h2>Arguments</h2>
23<p>
24<TABLE border="1" width="100%">
25  <TBODY>
26    <TR>
27<TD width="13%"><CODE>block_info_list</CODE></TD>
28<TD width="87%">Pointer to the <A href="../wbt_block_info_list_type.html"><CODE>WBTBlockInfoList</CODE></A> structure used for registration. This structure is used by the WBT library until it is deallocated by the <A href="WBT_UnregisterBlock.html"><CODE>WBT_UnregisterBlock</CODE></A> function.</TD>
29    </TR>
30    <TR>
31<TD width="13%"><CODE>block_id</CODE></TD>
32<TD width="87%">Unique user-defined value allocated to the block to be registered. The value must be greater than <A href="../wbt_block_id_min_const.html"><CODE>WBT_BLOCK_ID_MIN</CODE></A>.</TD>
33    </TR>
34    <TR>
35<TD width="13%"><CODE>user_id</CODE></TD>
36<TD width="87%">User-defined data given to a block. The size is <A href="../wbt_user_id_len_const.html"><CODE>WBT_USER_ID_LEN</CODE></A> bytes.</TD>
37    </TR>
38    <TR>
39<TD width="13%"><CODE>data_ptr</CODE></TD>
40<TD width="87%">Buffer that holds block data. If this value is not <CODE>NULL</CODE>, the buffer is referenced by the WBT library until the buffer is deallocated with the <A href="WBT_UnregisterBlock.html"> <CODE>WBT_UnregisterBlock</CODE></A> function. Therefore, until then, the buffer must not be changed or destroyed.<br> If this value is <CODE>NULL</CODE>, the <A href="../wbt_command_type_const.html"><code>WBT_CMD_SYSTEM_CALLBACK</code></A> callback will be notified as necessary about the partial buffer preparation request by means of a <A href="../wbt_command_type_const.html"><code>WBT_CMD_PREPARE_SEND_DATA</code></a> event.
41	  </TD>
42    </TR>
43    <TR>
44<TD width="13%"><CODE>data_size</CODE></TD>
45<TD width="87%">Block data size.</TD>
46    </TR>
47    <TR>
48<TD width="13%"><CODE>permission_bmp</CODE></TD>
49<TD width="87%">Reserved for a future extension. Always specify 0.</TD>
50    </TR>
51  </TBODY>
52</TABLE>
53</p>
54
55<h2>Return Values</h2>
56<p>Registers the block and returns <CODE>TRUE</CODE> if the specified block <CODE>ID</CODE> is not currently registered and the total number of registered blocks is less than <A href="../wbt_num_max_block_info_id_const.html"><CODE>WBT_NUM_MAX_BLOCK_INFO_ID</CODE></A>.<br>Otherwise, it does nothing and returns <CODE>FALSE</CODE>.</p>
57
58<H2>Description</H2>
59<p>Registers a data block in the WBT internal block list, based on the information specified. You can receive registered blocks from other communication parties with the <A href="../command/WBT_GetBlock.html"><code>WBT_GetBlock</code></A> function. <br>
60</p>
61<H2>See Also</H2>
62<P>
63<A href="WBT_UnregisterBlock.html"><CODE>WBT_UnregisterBlock</CODE></A><BR> <A href="../command/WBT_GetBlockInfo.html"><CODE>WBT_GetBlockInfo</CODE></A><BR> <A href="../command/WBT_GetBlock.html"><CODE>WBT_GetBlock</CODE></A><br> <A href="../wbt_block_info_list_type.html"><CODE>WBTBlockInfoList</CODE></A>
64</P>
65<H2>Revision History</H2>
66<P>
672004/09/21 Initial version.
68</P>
69<hr><p>CONFIDENTIAL</p></body>
70</html>
71