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 "urecord.h"
00044 #include "hslot.h"
00045 #include "usrloc.h"
00046
00047 struct hslot;
00048 struct urecord;
00054 struct udomain {
00055 str* name;
00056 int size;
00057 struct hslot* table;
00058
00059 stat_var *users;
00060 stat_var *contacts;
00061 stat_var *expires;
00062 };
00063
00064
00073 int new_udomain(str* _n, int _s, udomain_t** _d);
00074
00075
00080 void free_udomain(udomain_t* _d);
00081
00082
00086 void print_udomain(FILE* _f, udomain_t* _d);
00087
00088
00098 int preload_udomain(db1_con_t* _c, udomain_t* _d);
00099
00100
00106 int testdb_udomain(db1_con_t* con, udomain_t* d);
00107
00108
00114 int db_timer_udomain(udomain_t* _d);
00115
00116
00123 void mem_timer_udomain(udomain_t* _d, int istart, int istep);
00124
00125
00133 int mem_insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00134
00135
00141 void mem_delete_urecord(udomain_t* _d, struct urecord* _r);
00142
00143
00147 void lock_udomain(udomain_t* _d, str *_aor);
00148
00149
00155 void unlock_udomain(udomain_t* _d, str *_aor);
00156
00157
00163 void lock_ulslot(udomain_t* _d, int i);
00164
00170 void unlock_ulslot(udomain_t* _d, int i);
00171
00172
00173
00174
00182 int insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00183
00184
00192 int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r);
00193
00203 int get_urecord_by_ruid(udomain_t* _d, unsigned int _aorhash,
00204 str *_ruid, struct urecord** _r, struct ucontact** _c);
00205
00213 int delete_urecord(udomain_t* _d, str* _aor, struct urecord* _r);
00214
00215
00216 #endif