Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00034 #ifndef UDOMAIN_H
00035 #define UDOMAIN_H
00036
00037
00038 #include <stdio.h>
00039 #include "../../lib/kcore/statistics.h"
00040 #include "../../locking.h"
00041 #include "../../str.h"
00042 #include "../../lib/srdb1/db.h"
00043 #include "../usrloc/usrloc.h"
00044 #include "urecord.h"
00045 #include "hslot.h"
00046
00047
00048 struct hslot;
00049 struct urecord;
00055 struct udomain {
00056 str* name;
00057 int size;
00058 struct hslot* table;
00059
00060 stat_var *users;
00061 stat_var *contacts;
00062 stat_var *expires;
00063
00064 int dbt;
00065 db1_con_t * dbh;
00066 };
00067
00068
00077 int new_udomain(str* _n, int _s, udomain_t** _d);
00078
00079
00084 void free_udomain(udomain_t* _d);
00085
00086
00090 void print_udomain(FILE* _f, udomain_t* _d);
00091
00092
00098 int db_timer_udomain(udomain_t* _d);
00099
00100
00105 void mem_timer_udomain(udomain_t* _d);
00106
00107
00115 int mem_insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00116
00117
00123 void mem_delete_urecord(udomain_t* _d, struct urecord* _r);
00124
00125
00126
00132 void lock_ulslot(udomain_t* _d, int i);
00133
00139 void unlock_ulslot(udomain_t* _d, int i);
00140
00141
00142
00146 void lock_udomain(udomain_t* _d, str *_aor);
00147
00148
00154 void unlock_udomain(udomain_t* _d, str *_aor);
00155
00156
00157
00165 int insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00166
00167
00175 int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00176
00177
00185 int delete_urecord(udomain_t* _d, str* _aor, struct urecord* _r);
00186
00187
00188 #endif