]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.h
* Cleaned up a couple of FIXME's sitting around in the code
[citadel.git] / webcit / webcit.h
index a147a2536eb1f534101dd4ef7030ca768e27ecce..dec7db575ce953a8beac4723cc3a86db26123b78 100644 (file)
 #include <ical.h>
 #endif
 
+#ifdef HAVE_OPENSSL
+/* Work around RedHat's b0rken OpenSSL includes */
+#define OPENSSL_NO_KRB5
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/rand.h>
+#endif
+
 #define CALENDAR_ROOM_NAME     "Calendar"
 #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
 
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v5.04"  /* who's in da house */
+#define SERVER                 "WebCit v5.21"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         504             /* This version of WebCit */
+#define CLIENT_VERSION         521             /* This version of WebCit */
 #define MINIMUM_CIT_VERSION    611             /* min required Citadel vers */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
@@ -218,19 +226,28 @@ struct wcsession {
        char ImportantMessage[SIZ];
        int outside_frameset_allowed;   /* nonzero if current req is allowed
                                         * outside of the main frameset */
+       char last_chat_user[SIZ];
 };
 
 #define extract(dest,source,parmnum)   extract_token(dest,source,parmnum,'|')
 #define num_parms(source)              num_tokens(source, '|')
 
+/* Per-session data */
 #define WC ((struct wcsession *)pthread_getspecific(MyConKey))
 extern pthread_key_t MyConKey;
 
+/* Per-thread SSL context */
+#ifdef HAVE_OPENSSL
+#define THREADSSL ((SSL *)pthread_getspecific(ThreadSSL))
+extern pthread_key_t ThreadSSL;
+#endif
+
 struct serv_info serv_info;
 extern char floorlist[128][SIZ];
 extern char *axdefs[];
 extern char *ctdlhost, *ctdlport;
 extern char *server_cookie;
+extern int is_https;
 
 extern struct wcsubst *global_subst;
 
@@ -267,10 +284,12 @@ void jsescputs(char *);
 void output_headers(int);
 void wprintf(const char *format,...);
 void output_static(char *what);
-void stresc(char *target, char *strbuf, int nbsp);
+void stresc(char *target, char *strbuf, int nbsp, int nolinebreaks);
 void escputs(char *strbuf);
 void url(char *buf);
-void escputs1(char *strbuf, int nbsp);
+void escputs1(char *strbuf, int nbsp, int nolinebreaks);
+void msgesc(char *target, char *strbuf);
+void msgescputs(char *strbuf);
 long extract_long(char *source, long int parmnum);
 int extract_int(char *source, int parmnum);
 void stripout(char *str, char leftboundary, char rightboundary);
@@ -364,9 +383,10 @@ void edit_vcard(void);
 void submit_vcard(void);
 void striplt(char *);
 void select_user_to_edit(char *message, char *preselect);
-void display_edituser(char *who);
+void display_edituser(char *who, int is_new);
 void create_user(void);
 void edituser(void);
+void do_change_view(int);
 void change_view(void);
 void folders(void);
 void do_stuff_to_msgs(void);
@@ -435,3 +455,24 @@ void display_customize_iconbar(void);
 void commit_iconbar(void);
 int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen);
 void spawn_another_worker_thread(void);
+
+
+
+#ifdef HAVE_OPENSSL
+void init_ssl(void);
+void endtls(void);
+void ssl_lock(int mode, int n, const char *file, int line);
+int starttls(int sock);
+extern SSL_CTX *ssl_ctx;  
+int client_read_ssl(char *buf, int bytes, int timeout);
+void client_write_ssl(char *buf, int nbytes);
+#endif
+
+
+
+/* Views (from citadel.h) */
+#define        VIEW_BBS                0       /* Traditional Citadel BBS view */
+#define VIEW_MAILBOX           1       /* Mailbox summary */
+#define VIEW_ADDRESSBOOK       2       /* Address book view */
+#define VIEW_CALENDAR          3       /* Calendar view */
+#define VIEW_TASKS             4       /* Tasks view */