webcit.h

00001 /* $Id: webcit.h 5180 2007-05-25 18:35:26Z thierry $ */
00002 
00003 #include "config.h"
00004 
00005 
00006 #include <ctype.h>
00007 #include <stdlib.h>
00008 #ifdef HAVE_UNISTD_H
00009 #include <unistd.h>
00010 #endif
00011 #include <stdio.h>
00012 #ifdef HAVE_FCNTL_H
00013 #include <fcntl.h>
00014 #endif
00015 #include <signal.h>
00016 #include <sys/types.h>
00017 #include <sys/wait.h>
00018 #include <sys/socket.h>
00019 #ifdef HAVE_SYS_TIME_H
00020 #include <sys/time.h>
00021 #endif
00022 #include <sys/stat.h>
00023 #ifdef HAVE_LIMITS_H
00024 #include <limits.h>
00025 #endif
00026 #include <netinet/in.h>
00027 #include <arpa/inet.h>
00028 #include <sys/un.h>
00029 #include <netdb.h>
00030 #include <sys/poll.h>
00031 #include <string.h>
00032 #include <pwd.h>
00033 #include <errno.h>
00034 #include <stdarg.h>
00035 #include <pthread.h>
00036 #include <signal.h>
00037 #include <sys/utsname.h>
00038 
00039 #ifndef INADDR_NONE
00040 #define INADDR_NONE 0xffffffff
00041 #endif
00042 
00043 #ifdef HAVE_ICONV
00044 #include <iconv.h>
00045 #endif
00046 
00047 #ifdef ENABLE_NLS
00048 #include <libintl.h>
00049 #include <locale.h>
00050 extern locale_t wc_locales[];
00051 #define _(string)       gettext(string)
00052 #else
00053 #define _(string)       (string)
00054 #endif
00055 
00056 /*
00057  * Uncomment to dump an HTTP trace to stderr
00058 #define HTTP_TRACING 1
00059  */
00060 
00061 #ifdef HTTP_TRACING
00062 #undef HAVE_ZLIB_H
00063 #undef HAVE_ZLIB
00064 #endif
00065 
00066 #ifdef HAVE_ZLIB_H
00067 #include <zlib.h>
00068 #endif
00069 
00070 #ifdef HAVE_ICAL_H
00071 #ifdef HAVE_LIBICAL
00072 #define WEBCIT_WITH_CALENDAR_SERVICE 1
00073 #endif
00074 #endif
00075 
00076 
00077 
00078 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
00079 /* Work around PACKAGE/VERSION defs that are (not supposed to be?) in ical.h */
00080 #ifdef PACKAGE
00081 # define CTDL_PACKAGE PACKAGE
00082 # undef PACKAGE
00083 #endif
00084 #ifdef VERSION
00085 # define CTDL_VERSION VERSION
00086 # undef VERSION
00087 #endif
00088 #include <ical.h>
00089 #ifdef CTDL_PACKAGE
00090 # ifdef PACKAGE
00091 #  undef PACKAGE
00092 # endif
00093 # define PACKAGE CTDL_PACKAGE
00094 # undef CTDL_PACKAGE
00095 #endif
00096 #ifdef CTDL_VERSION
00097 # ifdef VERSION
00098 #  undef VERSION
00099 # endif
00100 # define VERSION CTDL_VERSION
00101 # undef CTDL_VERSION
00102 #endif
00103 #endif
00104 
00105 
00106 
00107 #ifdef HAVE_OPENSSL
00108 /* Work around RedHat's b0rken OpenSSL includes */
00109 #define OPENSSL_NO_KRB5
00110 #include <openssl/ssl.h>
00111 #include <openssl/err.h>
00112 #include <openssl/rand.h>
00113 #endif
00114 
00115 #define CALENDAR_ROOM_NAME      "Calendar"
00116 #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
00117 
00118 #define SIZ                     4096            /* generic buffer size */
00119 
00120 #define TRACE fprintf(stderr, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
00121 
00122 #define SLEEPING                180             /* TCP connection timeout */
00123 #define WEBCIT_TIMEOUT          900             /* WebCit session timeout */
00124 #define PORT_NUM                2000            /* port number to listen on */
00125 #define SERVER                  "WebCit v7.10"  /* who's in da house */
00126 #define DEVELOPER_ID            0
00127 #define CLIENT_ID               4
00128 #define CLIENT_VERSION          710             /* This version of WebCit */
00129 #define MINIMUM_CIT_VERSION     710             /* min required Citadel ver. */
00130 #define DEFAULT_HOST            "localhost"     /* Default Citadel server */
00131 #define DEFAULT_PORT            "504"
00132 #define LB                      (1)             /* Internal escape chars */
00133 #define RB                      (2)
00134 #define QU                      (3)
00135 #define TARGET                  "webcit01"      /* Target for inline URL's */
00136 #define HOUSEKEEPING            15              /* Housekeeping frequency */
00137 #define MIN_WORKER_THREADS      5
00138 #define MAX_WORKER_THREADS      250
00139 #define LISTEN_QUEUE_LENGTH     100             /* listen() backlog queue */
00140 
00141 #define USERCONFIGROOM          "My Citadel Config"
00142 #define DEFAULT_MAXMSGS         20
00143 
00144 
00145 /*
00146  * Room flags (from Citadel)
00147  *
00148  * bucket one...
00149  */
00150 #define QR_PERMANENT    1               
00151 #define QR_INUSE        2               
00152 #define QR_PRIVATE      4               
00153 #define QR_PASSWORDED   8               
00154 #define QR_GUESSNAME    16              
00155 #define QR_DIRECTORY    32              
00156 #define QR_UPLOAD       64              
00157 #define QR_DOWNLOAD     128             
00158 #define QR_VISDIR       256             
00159 #define QR_ANONONLY     512             
00160 #define QR_ANONOPT      1024            
00161 #define QR_NETWORK      2048            
00162 #define QR_PREFONLY     4096            
00163 #define QR_READONLY     8192            
00164 #define QR_MAILBOX      16384           
00169 #define QR2_SYSTEM      1               
00170 #define QR2_SELFLIST    2               
00171 #define QR2_COLLABDEL   4               
00176 #define UA_KNOWN        2
00177 #define UA_GOTOALLOWED  4
00178 #define UA_HASNEWMSGS   8
00179 #define UA_ZAPPED       16
00180 
00181 
00185 #define US_NEEDVALID    1               
00186 #define US_PERM         4               
00187 #define US_LASTOLD      16              
00188 #define US_EXPERT       32              
00189 #define US_UNLISTED     64              
00190 #define US_NOPROMPT     128             
00191 #define US_PROMPTCTL    256             
00192 #define US_DISAPPEAR    512             
00193 #define US_REGIS        1024            
00194 #define US_PAGINATOR    2048            
00195 #define US_INTERNET     4096            
00196 #define US_FLOORS       8192            
00197 #define US_COLOR        16384           
00198 #define US_USER_SET     (US_LASTOLD | US_EXPERT | US_UNLISTED | \
00199                         US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \
00200                         US_FLOORS | US_COLOR | US_PROMPTCTL )
00201 
00202 
00203 
00205 struct httprequest {
00206         struct httprequest *next;  
00207         char line[SIZ];            
00208 };
00209 
00213 struct urlcontent {
00214         struct urlcontent *next;   
00215         char url_key[32];          
00216         char *url_data;            
00217 };
00218 
00222 struct serv_info {
00223         int serv_pid;                   
00224         char serv_nodename[32];         
00225         char serv_humannode[64];        
00226         char serv_fqdn[64];             
00227         char serv_software[64];         
00228         int serv_rev_level;             
00229         char serv_bbs_city[64];         
00230         char serv_sysadm[64];           
00231         char serv_moreprompt[256];      
00232         int serv_ok_floors;             
00233         int serv_supports_ldap;         
00234         int serv_newuser_disabled;      
00235         char serv_default_cal_zone[128];
00236 };
00237 
00238 
00239 
00243 struct march {
00244         struct march *next;       
00245         char march_name[128];     
00246         int march_floor;          
00247         int march_order;          
00248 };
00249 
00250 /* *
00251  * \brief       This struct holds a list of rooms for client display.
00252  *              It is a binary tree.
00253  */
00254 struct roomlisting {
00255         struct roomlisting *lnext;      
00256         struct roomlisting *rnext;      
00257         char rlname[128];               
00258         unsigned rlflags;               
00259         int rlfloor;                    
00260         int rlorder;                    
00261 };
00262 
00263 
00264 
00268 struct wcsubst {
00269         struct wcsubst *next;       
00270         int wcs_type;                       
00271         char wcs_key[32];                   
00272         void *wcs_value;                    
00273         void (*wcs_function)(void); 
00274 };
00275 
00279 enum {
00280         WCS_STRING,   
00281         WCS_FUNCTION, 
00282         WCS_SERVCMD   
00283 };
00284 
00288 struct wc_attachment {
00289         struct wc_attachment *next;
00290         size_t length;                     
00291         char content_type[SIZ];    
00292         char filename[SIZ];                
00293         char *data;                
00294 };
00295 
00299 struct message_summary {
00300         time_t date;        
00301         long msgnum;            
00302         char from[128];         
00303         char to[128];           
00304         char subj[128];         
00305         int hasattachments;     
00306         int is_new;         
00307 };
00308 
00312 struct folder {
00313         int floor;      
00314         char room[SIZ]; 
00315         char name[SIZ]; 
00316         int hasnewmsgs; 
00317         int is_mailbox; 
00318         int selectable; 
00319         int view;       
00320 };
00321 
00326 struct wcsession {
00327         struct wcsession *next;                 
00328         int wc_session;                         
00329         char wc_username[128];                  
00330         char wc_fullname[128];                  
00331         char wc_password[128];                  
00332         char wc_roomname[256];                  
00333         int connected;                          
00334         int logged_in;                          
00335         int axlevel;                            
00336         int is_aide;                            
00337         int is_room_aide;                       
00338         int http_sock;                          
00339         int serv_sock;                          
00340         int chat_sock;                          
00341         unsigned room_flags;                    
00342         unsigned room_flags2;                   
00343         int wc_view;                            
00344         int wc_default_view;                    
00345         int wc_is_trash;                        
00346         int wc_floor;                           
00347         char ugname[128];                       
00348         long uglsn;                             
00349         int upload_length;                      
00350         char *upload;                           
00351         char upload_filename[PATH_MAX];         
00352         char upload_content_type[256];          
00353         int new_mail;                           
00354         int remember_new_mail;                  
00355         int need_regi;                          
00356         int need_vali;                          
00357         char cs_inet_email[256];                
00358         pthread_mutex_t SessionMutex;           
00359         time_t lastreq;                         
00360         int killthis;                           
00361         struct march *march;                    
00362         char reply_to[512];                     
00363         long msgarr[10000];                     
00364         int num_summ;                           
00365         struct message_summary *summ;           
00366         int is_wap;                             
00367         struct urlcontent *urlstrings;          
00368         struct wcsubst *vars;                   
00369         char this_page[512];                    
00370         char http_host[512];                    
00371         char *preferences;                      
00372 #ifdef WEBCIT_WITH_CALENDAR_SERVICE             
00373 
00374         struct disp_cal {                                       
00375                 icalcomponent *cal;             
00376                 long cal_msgnum;                
00377         } *disp_cal;                                            
00378         int num_cal;                            
00379 #endif                                                                                  
00380         struct wc_attachment *first_attachment; 
00381         char last_chat_user[256];               
00382         char ImportantMessage[SIZ];             
00383         int ctdl_pid;                           
00384         char httpauth_user[256];                
00385         char httpauth_pass[256];                
00386         size_t burst_len;                       
00387         size_t burst_alloc;                     
00388         char *burst;                            
00389         int gzip_ok;                            
00390         int is_mailbox;                         
00391         struct folder *cache_fold;              
00392         int cache_max_folders;                  
00393         int cache_num_floors;                   
00394         time_t cache_timestamp;                 
00395         int current_iconbar;                    
00396         char floordiv_expanded[32];             
00397         int selected_language;                  
00398         time_t last_pager_check;                
00399 };
00400 
00402 enum {
00403         current_iconbar_menu,     
00404         current_iconbar_roomlist  
00405 };
00406 
00407 
00408 #define num_parms(source)               num_tokens(source, '|') 
00409 
00410 /* Per-session data */
00411 #define WC ((struct wcsession *)pthread_getspecific(MyConKey))
00412 extern pthread_key_t MyConKey;
00413 
00414 /* Per-thread SSL context */
00415 #ifdef HAVE_OPENSSL
00416 #define THREADSSL ((SSL *)pthread_getspecific(ThreadSSL))
00417 extern pthread_key_t ThreadSSL;
00418 #endif
00419 
00420 struct serv_info serv_info;
00421 extern char floorlist[128][SIZ];
00422 extern char *axdefs[];
00423 extern char *ctdlhost, *ctdlport;
00424 extern int http_port;
00425 extern char *server_cookie;
00426 extern int is_https;
00427 extern int setup_wizard;
00428 extern char wizard_filename[];
00429 extern time_t if_modified_since;
00430 extern int follow_xff;
00431 void do_setup_wizard(void);
00432 
00433 void stuff_to_cookie(char *cookie, int session,
00434                         char *user, char *pass, char *room);
00435 void cookie_to_stuff(char *cookie, int *session,
00436                 char *user, size_t user_len,
00437                 char *pass, size_t pass_len,
00438                 char *room, size_t room_len);
00439 void locate_host(char *, int);
00440 void become_logged_in(char *, char *, char *);
00441 void do_login(void);
00442 void display_login(char *mesg);
00443 void do_welcome(void);
00444 void do_logout(void);
00445 void display_main_menu(void);
00446 void display_aide_menu(void);
00447 void display_advanced_menu(void);
00448 void slrp_highest(void);
00449 void gotonext(void);
00450 void ungoto(void);
00451 void get_serv_info(char *, char *);
00452 int uds_connectsock(char *);
00453 int tcp_connectsock(char *, char *);
00454 void serv_getln(char *strbuf, int bufsize);
00455 void serv_puts(char *string);
00456 void who(void);
00457 void who_inner_div(void);
00458 void wholist_section(void);
00459 void tasks_section(void);
00460 void calendar_section(void);
00461 void new_messages_section(void);
00462 void fmout(char *align);
00463 void pullquote_fmout(void);
00464 void wDumpContent(int);
00465 void serv_printf(const char *format,...);
00466 char *bstr(char *key);
00467 void urlesc(char *, char *);
00468 void urlescputs(char *);
00469 void jsesc(char *, char *);
00470 void jsescputs(char *);
00471 void output_headers(    int do_httpheaders,
00472                         int do_htmlhead,
00473                         int do_room_banner,
00474                         int unset_cookies,
00475                         int suppress_check,
00476                         int cache);
00477 void wprintf(const char *format,...);
00478 void output_static(char *what);
00479 void stresc(char *target, char *strbuf, int nbsp, int nolinebreaks);
00480 void escputs(char *strbuf);
00481 void url(char *buf);
00482 void escputs1(char *strbuf, int nbsp, int nolinebreaks);
00483 void msgesc(char *target, char *strbuf);
00484 void msgescputs(char *strbuf);
00485 int extract_int(const char *source, int parmnum);
00486 long extract_long(const char *source, int parmnum);
00487 void stripout(char *str, char leftboundary, char rightboundary);
00488 void dump_vars(void);
00489 void embed_main_menu(void);
00490 void serv_read(char *buf, int bytes);
00491 int haschar(char *, char);
00492 void readloop(char *oper);
00493 void read_message(long msgnum, int printable_view, char *section);
00494 void embed_message(char *msgnum_as_string);
00495 void print_message(char *msgnum_as_string);
00496 void display_headers(char *msgnum_as_string);
00497 void text_to_server(char *ptr);
00498 void text_to_server_qp(char *ptr);
00499 void display_enter(void);
00500 void post_message(void);
00501 void confirm_delete_msg(void);
00502 void delete_msg(void);
00503 void confirm_move_msg(void);
00504 void move_msg(void);
00505 void userlist(void);
00506 void showuser(void);
00507 void display_page(void);
00508 void page_user(void);
00509 void do_chat(void);
00510 void display_private(char *rname, int req_pass);
00511 void goto_private(void);
00512 void zapped_list(void);
00513 void display_zap(void);
00514 void zap(void);
00515 void display_success(char *);
00516 void authorization_required(const char *message);
00517 void display_entroom(void);
00518 void entroom(void);
00519 void display_editroom(void);
00520 void netedit(void);
00521 void editroom(void);
00522 void display_whok(void);
00523 void do_invt_kick(void);
00524 void server_to_text(void);
00525 void save_edit(char *description, char *enter_cmd, int regoto);
00526 void display_edit(char *description, char *check_cmd,
00527                   char *read_cmd, char *save_cmd, int with_room_banner);
00528 int gotoroom(char *gname);
00529 void confirm_delete_room(void);
00530 void delete_room(void);
00531 void validate(void);
00532 void display_graphics_upload(char *, char *, char *);
00533 void do_graphics_upload(char *upl_cmd);
00534 void serv_read(char *buf, int bytes);
00535 void serv_gets(char *strbuf);
00536 void serv_write(char *buf, int nbytes);
00537 void serv_puts(char *string);
00538 void serv_printf(const char *format,...);
00539 void load_floorlist(void);
00540 void display_reg(int);
00541 void display_changepw(void);
00542 void changepw(void);
00543 void display_edit_node(void);
00544 void edit_node(void);
00545 void display_netconf(void);
00546 void display_confirm_delete_node(void);
00547 void delete_node(void);
00548 void display_add_node(void);
00549 void add_node(void);
00550 void terminate_session(void);
00551 void edit_me(void);
00552 void display_siteconfig(void);
00553 void siteconfig(void);
00554 void display_generic(void);
00555 void do_generic(void);
00556 void ajax_servcmd(void);
00557 void display_menubar(int);
00558 void smart_goto(char *);
00559 void worker_entry(void);
00560 void session_loop(struct httprequest *);
00561 size_t wc_strftime(char *s, size_t max, const char *format, const struct tm *tm);
00562 void fmt_date(char *buf, time_t thetime, int brief);
00563 void fmt_time(char *buf, time_t thetime);
00564 void httpdate(char *buf, time_t thetime);
00565 time_t httpdate_to_timestamp(char *buf);
00566 void end_webcit_session(void);
00567 void page_popup(void);
00568 void chat_recv(void);
00569 void chat_send(void);
00570 void http_redirect(char *);
00571 void clear_local_substs(void);
00572 void svprintf(char *keyname, int keytype, const char *format,...);
00573 void svcallback(char *keyname, void (*fcn_ptr)() );
00574 void do_template(void *templatename);
00575 int lingering_close(int fd);
00576 char *memreadline(char *start, char *buf, int maxlen);
00577 int num_tokens (char *source, char tok);
00578 void extract_token(char *dest, const char *source, int parmnum, char separator, int maxlen);
00579 void remove_token(char *source, int parmnum, char separator);
00580 char *load_mimepart(long msgnum, char *partnum);
00581 int pattern2(char *search, char *patn);
00582 void do_edit_vcard(long, char *, char *);
00583 void edit_vcard(void);
00584 void submit_vcard(void);
00585 void striplt(char *);
00586 void select_user_to_edit(char *message, char *preselect);
00587 void delete_user(char *);
00588 void display_edituser(char *who, int is_new);
00589 void create_user(void);
00590 void edituser(void);
00591 void do_change_view(int);
00592 void change_view(void);
00593 void folders(void);
00594 void load_preferences(void);
00595 void save_preferences(void);
00596 void get_preference(char *key, char *value, size_t value_len);
00597 void set_preference(char *key, char *value, int save_to_server);
00598 void knrooms(void);
00599 int is_msg_in_mset(char *mset, long msgnum);
00600 char *safestrncpy(char *dest, const char *src, size_t n);
00601 void display_addressbook(long msgnum, char alpha);
00602 void offer_start_page(void);
00603 void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext);
00604 void change_start_page(void);
00605 void output_html(char *, int);
00606 void display_floorconfig(char *);
00607 void delete_floor(void);
00608 void create_floor(void);
00609 void rename_floor(void);
00610 void do_listsub(void);
00611 void toggle_self_service(void);
00612 void summary(void);
00613 void summary_inner_div(void);
00614 ssize_t write(int fd, const void *buf, size_t count);
00615 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum);
00616 void display_calendar(long msgnum);
00617 void display_task(long msgnum);
00618 void display_note(long msgnum);
00619 void updatenote(void);
00620 void do_calendar_view(void);
00621 void do_tasks_view(void);
00622 void free_calendar_buffer(void);
00623 void calendar_summary_view(void);
00624 int load_msg_ptrs(char *servcmd, int with_headers);
00625 void CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen, int linebreaks);
00626 int CtdlDecodeBase64(char *dest, const char *source, size_t length);
00627 void free_attachments(struct wcsession *sess);
00628 void free_march_list(struct wcsession *wcf);
00629 void set_room_policy(void);
00630 void display_inetconf(void);
00631 void save_inetconf(void);
00632 void display_smtpqueue(void);
00633 void display_smtpqueue_inner_div(void);
00634 void display_sieve(void);
00635 void display_rules_editor_inner_div(void);
00636 void save_sieve(void);
00637 void display_add_remove_scripts(char *);
00638 void create_script(void);
00639 void delete_script(void);
00640 void generate_uuid(char *);
00641 void CtdlMakeTempFileName(char *, int);
00642 void display_preferences(void);
00643 void set_preferences(void);
00644 void recp_autocomplete(char *);
00645 void address_book_popup(void);
00646 void display_address_book_middle_div(void);
00647 void display_address_book_inner_div(void);
00648 void begin_ajax_response(void);
00649 void end_ajax_response(void);
00650 void initialize_viewdefs(void);
00651 void initialize_axdefs(void);
00652 void list_all_rooms_by_floor(char *viewpref);
00653 void display_room_directory(void);
00654 void download_file(char *);
00655 void upload_file(void);
00656 
00657 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
00658 void display_edit_task(void);
00659 void save_task(void);
00660 void display_edit_event(void);
00661 void save_event(void);
00662 void display_icaltimetype_as_webform(struct icaltimetype *, char *);
00663 void icaltime_from_webform(struct icaltimetype *result, char *prefix);
00664 void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
00665 void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum);
00666 void save_individual_event(icalcomponent *supplied_vtodo, long msgnum);
00667 void respond_to_request(void);
00668 void handle_rsvp(void);
00669 void ical_dezonify(icalcomponent *cal);
00670 void partstat_as_string(char *buf, icalproperty *attendee);
00671 icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp);
00672 void check_attendee_availability(icalcomponent *supplied_vevent);
00673 void do_freebusy(char *req);
00674 #endif
00675 
00676 #ifdef ENABLE_NLS
00677 void initialize_locales(void);
00678 #endif
00679 
00680 extern char *months[];
00681 extern char *days[];
00682 void read_server_binary(char *buffer, size_t total_len);
00683 char *read_server_text(void);
00684 int goto_config_room(void);
00685 long locate_user_vcard(char *username, long usernum);
00686 void sleeeeeeeeeep(int);
00687 void http_transmit_thing(char *thing, size_t length, char *content_type,
00688                          int is_static);
00689 void unescape_input(char *buf);
00690 void do_iconbar(void);
00691 void do_iconbar_roomlist(void);
00692 void do_selected_iconbar(void);
00693 void display_customize_iconbar(void);
00694 void commit_iconbar(void);
00695 int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen);
00696 void spawn_another_worker_thread(void);
00697 void display_rss(char *roomname, char *request_method);
00698 void set_floordiv_expanded(char *which_floordiv);
00699 void offer_languages(void);
00700 void set_selected_language(char *);
00701 void go_selected_language(void);
00702 void stop_selected_language(void);
00703 void httplang_to_locale(char *LocaleString);
00704 void tabbed_dialog(int num_tabs, char *tabnames[]);
00705 void begin_tab(int tabnum, int num_tabs);
00706 void end_tab(int tabnum, int num_tabs);
00707 void str_wiki_index(char *s);
00708 void display_wiki_page(void);
00709 char *bmstrcasestr(char *text, char *pattern);
00710 
00711 #ifdef HAVE_ICONV
00712 iconv_t ctdl_iconv_open(const char *tocode, const char *fromcode);
00713 #endif
00714 
00715 void embed_room_banner(char *, int);
00716 
00717 /* navbar types that can be passed to embed_room_banner */
00718 enum {
00719         navbar_none,
00720         navbar_default
00721 };
00722 
00723 
00724 #ifdef HAVE_OPENSSL
00725 void init_ssl(void);
00726 void endtls(void);
00727 void ssl_lock(int mode, int n, const char *file, int line);
00728 int starttls(int sock);
00729 extern SSL_CTX *ssl_ctx;  
00730 int client_read_ssl(char *buf, int bytes, int timeout);
00731 void client_write_ssl(char *buf, int nbytes);
00732 #endif
00733 
00734 #ifdef HAVE_ZLIB
00735 #include <zlib.h>
00736 int ZEXPORT compress_gzip(Bytef * dest, uLongf * destLen,
00737                           const Bytef * source, uLong sourceLen, int level);
00738 #endif
00739 
00740 #ifdef HAVE_ICONV
00741 void utf8ify_rfc822_string(char *buf);
00742 #endif
00743 
00744 void begin_burst(void);
00745 void end_burst(void);
00746 
00747 extern char *hourname[];        
00749 void http_datestring(char *buf, size_t n, time_t xtime);
00750 
00751 
00753 #define VIEW_BBS                0       
00754 #define VIEW_MAILBOX            1       
00755 #define VIEW_ADDRESSBOOK        2       
00756 #define VIEW_CALENDAR           3       
00757 #define VIEW_TASKS              4       
00758 #define VIEW_NOTES              5       
00759 #define VIEW_WIKI               6       
00760 #define VIEW_CALBRIEF           7       
00763 /* These should be empty, but we have them for testing */
00764 #define DEFAULT_HTTPAUTH_USER   ""
00765 #define DEFAULT_HTTPAUTH_PASS   ""
00766 
00767 
00768 /* Exit codes 101 through 109 are initialization failures so we don't want to
00769  * just keep respawning indefinitely.
00770  */
00771 #define WC_EXIT_BIND            101     /* Can't bind to the port */
00772 #define WC_EXIT_SSL             102     /* Can't initialize SSL */

Generated on Wed Jun 20 23:13:11 2007 for webcit by  doxygen 1.5.2