00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CF_CLIENTLIB_H
00020 #define CF_CLIENTLIB_H
00021
00027 typedef void *(*t_mod_api)(void *);
00028
00030 typedef struct s_mod_api_ent {
00031 u_char *mod_name;
00032 u_char *unique_identifier;
00033 t_mod_api function;
00034 } t_mod_api_ent;
00035
00036
00038 typedef struct s_message {
00039 u_int64_t mid;
00040 u_char *author;
00041 unsigned long author_len;
00043 u_char *subject;
00044 unsigned long subject_len;
00046 u_char *category;
00047 unsigned long category_len;
00049 u_char *content;
00050 unsigned long content_len;
00052 u_char *email;
00053 unsigned long email_len;
00055 u_char *hp;
00056 unsigned long hp_len;
00058 u_char *img;
00059 unsigned long img_len;
00061 time_t date;
00062 unsigned short level;
00063 short may_show;
00064 short invisible;
00066 t_cf_template tpl;
00068 struct s_message *next;
00069 struct s_message *prev;
00070 } t_message;
00071
00073 typedef struct s_cl_thread {
00074 u_int64_t tid;
00075 u_int32_t msg_len;
00077 t_message *messages;
00078 t_message *last;
00079 t_message *threadmsg;
00080 } t_cl_thread;
00081
00090 typedef int (*t_filter_begin)(t_cf_hash *,t_configuration *,t_configuration *);
00091
00100 typedef int (*t_filter_connect)(t_cf_hash *,t_configuration *,t_configuration *,int);
00101
00111 typedef int (*t_filter_list)(t_cf_hash *,t_configuration *,t_configuration *,t_cl_thread *,int);
00112
00124 typedef int (*t_filter_list_posting)(t_cf_hash *,t_configuration *,t_configuration *,t_message *,unsigned long long,int);
00125
00136 typedef int (*t_filter_posting)(t_cf_hash *,t_configuration *,t_configuration *,t_cl_thread *,t_cf_template *);
00137
00148 typedef int (*t_filter_init_view)(t_cf_hash *,t_configuration *,t_configuration *,t_cf_template *,t_cf_template *);
00149
00161 typedef int (*t_new_post_filter)(t_cf_hash *,t_configuration *,t_configuration *,t_message *,int,int);
00162
00167 extern t_cf_hash *GlobalValues;
00168
00172 extern t_cf_hash *APIEntries;
00173
00177 extern u_char ErrorString[];
00178
00184 u_char *get_uconf_name(const u_char *uname);
00185
00190 int set_us_up_the_socket(void);
00191
00198 void str_error_message(const u_char *msg,FILE *out,int rd, ...);
00199
00208 u_char *get_error_message(const u_char *msg,int rd,size_t *len, ...);
00209
00218 u_char *get_time(t_configuration *cfg,const u_char *symbol,int *len,time_t *date);
00219
00226 u_char *get_link(u_int64_t tid,u_int64_t mid);
00227
00233 int has_answers(t_message *msg);
00234
00243 int handle_thread(t_cl_thread *thr,t_cf_hash *head,int mode);
00244
00253 int handle_thread_list_posting(t_message *p,t_cf_hash *head,u_int64_t tid,int mode);
00254
00260 t_message *delete_subtree(t_message *msg);
00261
00268 void generate_tpl_name(u_char buff[],int len,t_name_value *v);
00269
00270 #ifdef CF_SHARED_MEM
00271
00275 void *get_shm_ptr(void);
00276
00281 void *reget_shm_ptr();
00282 #endif
00283
00294 void cf_set_variable(t_cf_template *tpl,t_name_value *cs,u_char *vname,const u_char *val,size_t len,int html);
00295
00300 void cleanup_struct(t_cl_thread *thr);
00301
00308 int handle_posting_filters(t_cf_hash *head,t_cl_thread *thr,t_cf_template *tpl);
00309
00321 int cf_get_message_through_sock(int sock,rline_t *tsd,t_cl_thread *thr,const u_char *tplname,u_int64_t tid,u_int64_t mid,int del);
00322
00330 int cf_get_next_thread_through_sock(int sock,rline_t *tsd,t_cl_thread *thr,const u_char *tplname);
00331
00332 #ifdef CF_SHARED_MEM
00333
00343 int cf_get_message_through_shm(void *shm_ptr,t_cl_thread *thr,const u_char *tplname,u_int64_t tid,u_int64_t mid,int del);
00344
00352 void *cf_get_next_thread_through_shm(void *shm_ptr,t_cl_thread *thr,const u_char *tplname);
00353 #endif
00354
00362 int cf_register_mod_api_ent(const u_char *mod_name,const u_char *unique_identifier,t_mod_api func);
00363
00369 int cf_unregister_mod_api_ent(const u_char *unid);
00370
00376 t_mod_api cf_get_mod_api_ent(const u_char *unid);
00377
00378
00379 #endif
00380
00381