modules_k/usrloc/hslot.h

Go to the documentation of this file.
00001 /*
00002  * $Id$ 
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00030 #ifndef HSLOT_H
00031 #define HSLOT_H
00032 
00033 #include "../../locking.h"
00034 
00035 #include "udomain.h"
00036 #include "urecord.h"
00037 
00038 
00039 struct udomain;
00040 struct urecord;
00041 
00042 
00043 typedef struct hslot {
00044         int n;                  
00045         struct urecord* first;  
00046         struct urecord* last;   
00047         struct udomain* d;      
00048 #ifdef GEN_LOCK_T_PREFERED
00049         gen_lock_t *lock;       
00050 #else
00051         int lockidx;            
00052 #endif
00053 } hslot_t;
00054 
00058 void init_slot(struct udomain* _d, hslot_t* _s, int n);
00059 
00060 
00064 void deinit_slot(hslot_t* _s);
00065 
00066 
00070 void slot_add(hslot_t* _s, struct urecord* _r);
00071 
00072 
00076 void slot_rem(hslot_t* _s, struct urecord* _r);
00077 
00078 
00083 int ul_init_locks(void);
00084 
00085 
00089 void ul_unlock_locks(void);
00090 void ul_destroy_locks(void);
00091 
00092 #ifndef GEN_LOCK_T_PREFERED
00093 void ul_lock_idx(int idx);
00094 void ul_release_idx(int idx);
00095 #endif
00096 
00097 #endif /* HSLOT_H */