New file user_functions.c contains skeleton code for the /ctdl/u/... calls
[citadel.git] / webcit-ng / webcit.h
index 6302d458dff62718d06585b1e2471e3543c816a0..af08f6fddb2c3d307c1c76fe1705f748f564347a 100644 (file)
@@ -1,12 +1,14 @@
 /*
  * webcit.h - "header of headers"
  *
- * Copyright (c) 1996-2017 by the citadel.org team
+ * Copyright (c) 1996-2018 by the citadel.org team
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
  */
 
+#define SHOW_ME_VAPPEND_PRINTF
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -14,6 +16,7 @@
 #include <syslog.h>
 #include <string.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -21,6 +24,7 @@
 #include <netdb.h>
 #include <sys/un.h>
 #include <sys/poll.h>
+#include <sys/time.h>
 #include <string.h>
 #include <pwd.h>
 #include <errno.h>
@@ -81,6 +85,7 @@ struct ctdlsession {
        char room[128];                         // What room we are currently in
        int room_current_view;
        int room_default_view;
+       long last_seen;
        int new_messages;
        int total_messages;
        time_t last_access;                     // Timestamp of last request that used this session
@@ -130,6 +135,7 @@ int uds_connectsock(char *sockpath);
 int tcp_connectsock(char *host, char *service);
 void ctdl_a(struct http_transaction *, struct ctdlsession *);
 void ctdl_r(struct http_transaction *, struct ctdlsession *);
+void ctdl_u(struct http_transaction *, struct ctdlsession *);
 struct ctdlsession *connect_to_citadel(struct http_transaction *);
 void disconnect_from_citadel(struct ctdlsession *);
 char *header_val(struct http_transaction *h, char *requested_header);
@@ -145,14 +151,18 @@ void dav_get_message(struct http_transaction *h, struct ctdlsession *c, long msg
 void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *euid, long old_msgnum);
 ssize_t ctdl_write(struct ctdlsession *ctdl, const void *buf, size_t count);
 int login_to_citadel(struct ctdlsession *c, char *auth, char *resultbuf);
-void threaded_view(struct http_transaction *h, struct ctdlsession *c, char *which);
 StrBuf *ctdl_readtextmsg(struct ctdlsession *ctdl);
 StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source);
 void download_mime_component(struct http_transaction *h, struct ctdlsession *c, long msgnum, char *partnum);
 StrBuf *text2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source);
 StrBuf *variformat2html(StrBuf *Source);
-
-void *mallok(size_t size);
-void phree(void *ptr);
-void *reallok(void *ptr, size_t size);
-
+int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes);
+void ctdl_c(struct http_transaction *h, struct ctdlsession *c);
+int webserver(char *webserver_interface, int webserver_port, int webserver_protocol);
+void ctdl_printf(struct ctdlsession *ctdl, const char *format,...);
+int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len);
+void do_502(struct http_transaction *h);
+void do_404(struct http_transaction *h);
+void do_412(struct http_transaction *h);
+void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf);
+void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);