OpenClovis Logo

clHandleApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : utils
21  * File : clHandleApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This is the interface to a client side handle management service.
28  *
29  * Part of this code was inspired by the openais code, hence I retained
30  * the copyright below.
31  *
32  *
33  *****************************************************************************/
34 
35 /*
36  * Copyright (c) 2002-2003 MontaVista Software, Inc.
37  *
38  * All rights reserved.
39  *
40  * Author: Steven Dake (sdake@mvista.com)
41  *
42  * This software licensed under BSD license, the text of which follows:
43  *
44  * Redistribution and use in source and binary forms, with or without
45  * modification, are permitted provided that the following conditions are met:
46  *
47  * - Redistributions of source code must retain the above copyright notice,
48  * this list of conditions and the following disclaimer.
49  * - Redistributions in binary form must reproduce the above copyright notice,
50  * this list of conditions and the following disclaimer in the documentation
51  * and/or other materials provided with the distribution.
52  * - Neither the name of the MontaVista Software, Inc. nor the names of its
53  * contributors may be used to endorse or promote products derived from this
54  * software without specific prior written permission.
55  *
56  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
57  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
59  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
60  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
66  * THE POSSIBILITY OF SUCH DAMAGE.
67  */
68 
80 #ifndef _CL_HANDLE_API_H_
81 #define _CL_HANDLE_API_H_
82 
83 #ifdef __cplusplus
84 extern "C"
85 {
86 #endif
87 
88 #include <clCommon.h>
89 
94 #define CL_HANDLE_INVALID_VALUE 0x0
95 #define CL_HDL_IDX_MASK 0x00000000FFFFFFFFULL
96 #define CL_HDL_IDX(hdl) (ClUint32T)( (hdl) & CL_HDL_IDX_MASK)
97 
100 typedef ClPtrT ClHandleDatabaseHandleT;
101 
136  CL_IN void (*destructor)(void*),
137  CL_OUT ClHandleDatabaseHandleT *databaseHandle);
138 
166  CL_IN ClHandleDatabaseHandleT databaseHandle);
167 
202 extern ClRcT clHandleCreate(
203  CL_IN ClHandleDatabaseHandleT databaseHandle,
204  CL_IN ClInt32T instanceSize,
205  CL_OUT ClHandleT *handle);
206 
243 extern ClRcT clHandleDestroy(
244  CL_IN ClHandleDatabaseHandleT databaseHandle,
245  CL_IN ClHandleT handle);
246 
280 extern ClRcT clHandleCheckout(
281  CL_IN ClHandleDatabaseHandleT databaseHandle,
282  CL_IN ClHandleT handle,
283  CL_OUT void **instance);
284 
315 extern ClRcT clHandleCheckin(
316  CL_IN ClHandleDatabaseHandleT databaseHandle,
317  CL_IN ClHandleT handle);
318 
319 extern ClRcT clHandleMove(
320  CL_IN ClHandleDatabaseHandleT databaseHandle,
321  CL_IN ClHandleT oldHandle,
322  CL_IN ClHandleT newHandle);
323 
324 #ifdef __cplusplus
325 }
326 #endif
327 
328 #endif /* _CL_HANDLE_API_H_ */
329 
330 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen