iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / lib / cpluff / doc / reference / c-api / group__cFuncsInit.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>C-Pluff C API: Framework initialization</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
6 </head><body>
7 <!-- Generated by Doxygen 1.5.1 -->
8 <div class="tabs">
9   <ul>
10     <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11     <li><a href="modules.html"><span>Modules</span></a></li>
12     <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
13     <li><a href="files.html"><span>Files</span></a></li>
14     <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
15   </ul></div>
16 <h1>Framework initialization<br>
17 <small>
18 [<a class="el" href="group__cFuncs.html">Functions</a>]</small>
19 </h1><hr><a name="_details"></a><h2>Detailed Description</h2>
20 These functions are used for framework initialization. 
21 <p>
22 They are intended to be used by the main program. These functions are not thread safe. 
23 <p>
24 <table border="0" cellpadding="0" cellspacing="0">
25 <tr><td></td></tr>
26 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
27 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsInit.html#gc794f61edbd896327fabddad2b3d2fd5">cp_set_fatal_error_handler</a> (<a class="el" href="group__cTypedefsFuncs.html#g91b11fd391854d0854cfde0779f8d707">cp_fatal_error_func_t</a> error_handler)</td></tr>
28
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the fatal error handler called on non-recoverable errors.  <a href="#gc794f61edbd896327fabddad2b3d2fd5"></a><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsInit.html#gc72ffd50777c3e898dae661c67b04ba9">cp_init</a> (void)</td></tr>
31
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes the plug-in framework.  <a href="#gc72ffd50777c3e898dae661c67b04ba9"></a><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsInit.html#g8dfbe51a3b7f23368a4ddf0d9987180e">cp_destroy</a> (void)</td></tr>
34
35 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys the plug-in framework and releases the resources used by it.  <a href="#g8dfbe51a3b7f23368a4ddf0d9987180e"></a><br></td></tr>
36 </table>
37 <hr><h2>Function Documentation</h2>
38 <a class="anchor" name="gc794f61edbd896327fabddad2b3d2fd5"></a><!-- doxytag: member="cpluff.h::cp_set_fatal_error_handler" ref="gc794f61edbd896327fabddad2b3d2fd5" args="(cp_fatal_error_func_t error_handler)" -->
39 <div class="memitem">
40 <div class="memproto">
41       <table class="memname">
42         <tr>
43           <td class="memname">void cp_set_fatal_error_handler           </td>
44           <td>(</td>
45           <td class="paramtype"><a class="el" href="group__cTypedefsFuncs.html#g91b11fd391854d0854cfde0779f8d707">cp_fatal_error_func_t</a>&nbsp;</td>
46           <td class="paramname"> <em>error_handler</em>          </td>
47           <td>&nbsp;)&nbsp;</td>
48           <td width="100%"></td>
49         </tr>
50       </table>
51 </div>
52 <div class="memdoc">
53
54 <p>
55 Sets the fatal error handler called on non-recoverable errors. 
56 <p>
57 The default error handler prints the error message out to standard error and aborts the program. If the user specified error handler returns then the framework will abort the program. Setting NULL error handler will restore the default handler. This function is not thread-safe and it should be called before initializing the framework to catch all fatal errors.<p>
58 <dl compact><dt><b>Parameters:</b></dt><dd>
59   <table border="0" cellspacing="2" cellpadding="0">
60     <tr><td valign="top"></td><td valign="top"><em>error_handler</em>&nbsp;</td><td>the fatal error handler </td></tr>
61   </table>
62 </dl>
63
64 </div>
65 </div><p>
66 <a class="anchor" name="gc72ffd50777c3e898dae661c67b04ba9"></a><!-- doxytag: member="cpluff.h::cp_init" ref="gc72ffd50777c3e898dae661c67b04ba9" args="(void)" -->
67 <div class="memitem">
68 <div class="memproto">
69       <table class="memname">
70         <tr>
71           <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_init           </td>
72           <td>(</td>
73           <td class="paramtype">void&nbsp;</td>
74           <td class="paramname">          </td>
75           <td>&nbsp;)&nbsp;</td>
76           <td width="100%"></td>
77         </tr>
78       </table>
79 </div>
80 <div class="memdoc">
81
82 <p>
83 Initializes the plug-in framework. 
84 <p>
85 This function must be called by the main program before calling any other plug-in framework functions except <a class="el" href="group__cFuncsFrameworkInfo.html">framework information</a> functions and <a class="el" href="group__cFuncsInit.html#gc794f61edbd896327fabddad2b3d2fd5">cp_set_fatal_error_handler</a>. This function may be called several times but it is not thread-safe. Library resources should be released by calling <a class="el" href="group__cFuncsInit.html#g8dfbe51a3b7f23368a4ddf0d9987180e">cp_destroy</a> when the framework is not needed anymore.<p>
86 Additionally, to enable localization support, the main program should set the current locale using<div class="fragment"><pre class="fragment"> setlocale(LC_ALL, <span class="stringliteral">""</span>) 
87 </pre></div> before calling this function.<p>
88 <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__cEnums.html#ggd6a8106d281ffa4b1f43fe8e3effc7da5ffbe0fe80af75e699e4b04909912f7a">CP_OK</a> (zero) on success or error code on failure </dd></dl>
89
90 </div>
91 </div><p>
92 <a class="anchor" name="g8dfbe51a3b7f23368a4ddf0d9987180e"></a><!-- doxytag: member="cpluff.h::cp_destroy" ref="g8dfbe51a3b7f23368a4ddf0d9987180e" args="(void)" -->
93 <div class="memitem">
94 <div class="memproto">
95       <table class="memname">
96         <tr>
97           <td class="memname">void cp_destroy           </td>
98           <td>(</td>
99           <td class="paramtype">void&nbsp;</td>
100           <td class="paramname">          </td>
101           <td>&nbsp;)&nbsp;</td>
102           <td width="100%"></td>
103         </tr>
104       </table>
105 </div>
106 <div class="memdoc">
107
108 <p>
109 Destroys the plug-in framework and releases the resources used by it. 
110 <p>
111 The plug-in framework is only destroyed after this function has been called as many times as <a class="el" href="group__cFuncsInit.html#gc72ffd50777c3e898dae661c67b04ba9">cp_init</a>. This function is not thread-safe. Plug-in framework functions other than <a class="el" href="group__cFuncsInit.html#gc72ffd50777c3e898dae661c67b04ba9">cp_init</a>, cp_get_framework_info and <a class="el" href="group__cFuncsInit.html#gc794f61edbd896327fabddad2b3d2fd5">cp_set_fatal_error_handler</a> must not be called after the plug-in framework has been destroyed. All contexts are destroyed and all data references returned by the framework become invalid. 
112 </div>
113 </div><p>
114 <hr size="1">
115 <p class="footer">
116 <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
117 Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
118 </p>
119 <p class="generated-by">
120 Generated on Fri Apr 6 15:40:55 2007 for C-Pluff C API by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1
121 </p>
122 </body>
123 </html>