00001 /* 00002 * Copyright 1999-2006 University of Chicago 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00038 #ifndef GLOBUS_HANDLE_TABLE_H 00039 #define GLOBUS_HANDLE_TABLE_H 00040 00041 #include "globus_types.h" 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00051 typedef struct globus_l_handle_table_s * globus_handle_table_t; 00052 00057 typedef int globus_handle_t; 00058 00065 typedef 00066 void 00067 (*globus_handle_destructor_t)( 00068 void * datum); 00069 00075 #define GLOBUS_NULL_HANDLE 0 00076 #define GLOBUS_HANDLE_TABLE_NO_HANDLE 0 00077 00078 int 00079 globus_handle_table_init( 00080 globus_handle_table_t * handle_table, 00081 globus_handle_destructor_t destructor); 00082 00083 int 00084 globus_handle_table_destroy( 00085 globus_handle_table_t * handle_table); 00086 00087 globus_handle_t 00088 globus_handle_table_insert( 00089 globus_handle_table_t * handle_table, 00090 void * datum, 00091 int initial_refs); 00092 00093 globus_bool_t 00094 globus_handle_table_increment_reference( 00095 globus_handle_table_t * handle_table, 00096 globus_handle_t handle); 00097 00098 globus_bool_t 00099 globus_handle_table_increment_reference_by( 00100 globus_handle_table_t * handle_table, 00101 globus_handle_t handle, 00102 unsigned int inc); 00103 00104 globus_bool_t 00105 globus_handle_table_decrement_reference( 00106 globus_handle_table_t * handle_table, 00107 globus_handle_t handle); 00108 00109 void * 00110 globus_handle_table_lookup( 00111 globus_handle_table_t * handle_table, 00112 globus_handle_t handle); 00113 00114 #ifdef __cplusplus 00115 } 00116 #endif 00117 00118 #endif /* GLOBUS_HANDLE_TABLE_H */