CERN org.glite.Gfal
2.0.1
|
00001 #pragma once 00002 /* 00003 * Copyright (c) Members of the EGEE Collaboration. 2004. 00004 * See http://www.eu-egee.org/partners/ for details on the copyright holders. 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00019 00020 00021 #include <glib.h> 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 00028 typedef struct _GSkiplist GSkiplist; 00029 typedef struct _GSkipNode GSkipNode; 00030 typedef struct _GSkipLink GSkipLink; 00031 00032 00033 const extern int max_size; 00034 00038 struct _GSkiplist{ 00039 GSkipNode* head_node; 00040 GCompareFunc cmp_func; 00041 size_t length; 00042 GStaticRWLock lock; 00043 }; 00044 00045 00046 struct _GSkipLink{ 00047 GSkipNode* next; 00048 }; 00049 00050 struct _GSkipNode{ 00051 void* key; 00052 void* data; 00053 guint height; 00054 GSkipLink link[]; 00055 }; 00056 00057 00058 GSkiplist* gskiplist_new(GCompareFunc func); 00059 00060 void gskiplist_delete(GSkiplist* sk); 00061 00062 gboolean gskiplist_insert(GSkiplist* sk, gpointer key, gpointer value); 00063 00064 00065 size_t gskiplist_length(GSkiplist* sk); 00066 00067 gpointer gskiplist_remove(GSkiplist* sk, gpointer key); 00068 00069 gpointer gskiplist_search(GSkiplist* sk, gpointer key); 00070 00071 gpointer gskiplist_get_first_value(GSkiplist* sk); 00072 00073 void gskiplist_clean(GSkiplist* sk); 00074 00075 00076 00077 #ifdef __cplusplus 00078 } 00079 #endif 00080 00081