From 4b39426948e6537ae0aa91b5ead77a780750ba7f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 22 Dec 2023 11:39:42 -0500 Subject: [PATCH] webcit.h: regenerated function prototypes using cproto --- webcit-ng/server/calendar_functions.c | 3 +- webcit-ng/server/webcit.h | 154 ++++++++++++++++++++------ 2 files changed, 119 insertions(+), 38 deletions(-) diff --git a/webcit-ng/server/calendar_functions.c b/webcit-ng/server/calendar_functions.c index 1c9e19645..820de037a 100644 --- a/webcit-ng/server/calendar_functions.c +++ b/webcit-ng/server/calendar_functions.c @@ -9,7 +9,6 @@ // Client is requesting a message list -void json_msglist(struct http_transaction *h, struct ctdlsession *c, char *range) { - +void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *range) { do_404(h); } diff --git a/webcit-ng/server/webcit.h b/webcit-ng/server/webcit.h index 11681a596..2bcbccb15 100644 --- a/webcit-ng/server/webcit.h +++ b/webcit-ng/server/webcit.h @@ -133,51 +133,133 @@ enum { #define DAV_MOVE 0 // MOVE=0 COPY=1 don't change these! #define DAV_COPY 1 // they are the values used in the Citadel Server MOVE command -void worker_entry(int *); -void perform_one_http_transaction(struct client_handle *ch); +// The prototypes below this line are generated with `cproto server/*.c >>server/webcit.h` + +/* server/admin_functions.c */ +void try_login(struct http_transaction *h, struct ctdlsession *c); +void logout(struct http_transaction *h, struct ctdlsession *c); +void whoami(struct http_transaction *h, struct ctdlsession *c); +void biff(struct http_transaction *h, struct ctdlsession *c); +void ctdl_a(struct http_transaction *h, struct ctdlsession *c); +/* server/caldav_reports.c */ +void caldav_xml_start(void *data, const char *el, const char **attr); +void caldav_xml_end(void *data, const char *el); +void caldav_xml_chardata(void *data, const XML_Char *s, int len); +StrBuf *fetch_ical(struct ctdlsession *c, long msgnum); +void caldav_response(struct http_transaction *h, struct ctdlsession *c, StrBuf *ReportOut, StrBuf *ThisHref); +void caldav_report(struct http_transaction *h, struct ctdlsession *c); +/* server/calendar_functions.c */ +void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *range); +/* server/ctdlclient.c */ +int ctdl_read_binary(struct ctdlsession *ctdl, char *buf, int bytes_requested); +int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes); +StrBuf *ctdl_readtextmsg(struct ctdlsession *ctdl); +ssize_t ctdl_write(struct ctdlsession *ctdl, const void *buf, size_t count); +void ctdl_printf(struct ctdlsession *ctdl, const char *format, ...); +int uds_connectsock(char *sockpath); +void extract_auth(struct http_transaction *h, char *authbuf, int authbuflen); +int login_to_citadel(struct ctdlsession *c, char *auth, char *resultbuf); +struct ctdlsession *connect_to_citadel(struct http_transaction *h); +void disconnect_from_citadel(struct ctdlsession *ctdl); +/* server/ctdl_commands.c */ +void serv_info(struct http_transaction *h, struct ctdlsession *c); +void ctdl_c(struct http_transaction *h, struct ctdlsession *c); +/* server/ctdlfunctions.c */ +void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs); +/* server/floor_functions.c */ +void floor_list(struct http_transaction *h, struct ctdlsession *c); +void ctdl_f(struct http_transaction *h, struct ctdlsession *c); +/* server/forum_view.c */ +void setup_for_forum_view(struct ctdlsession *c); +JsonValue *json_tokenize_recipients(const char *Key, long keylen, char *recp); +void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum); +/* server/html2html.c */ +void stripquotes(char *s); +void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_content); +StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source); +void UrlizeText(StrBuf *Target, StrBuf *Source, StrBuf *WrkBuf); +void url(char *buf, size_t bufsize); +/* server/http.c */ +int client_write(struct client_handle *ch, char *buf, int nbytes); +int client_read(struct client_handle *ch, char *buf, int nbytes); +int client_readline(struct client_handle *ch, char *buf, int maxbytes); +void client_printf(struct client_handle *ch, const char *format, ...); void add_response_header(struct http_transaction *h, char *key, char *val); -void perform_request(struct http_transaction *); -void do_204(struct http_transaction *); -void do_404(struct http_transaction *); -void do_405(struct http_transaction *); -void do_412(struct http_transaction *); -void do_502(struct http_transaction *); -void output_static(struct http_transaction *); -int uds_connectsock(char *); -void ctdl_a(struct http_transaction *, struct ctdlsession *); -void ctdl_f(struct http_transaction *, struct ctdlsession *); -void ctdl_r(struct http_transaction *, struct ctdlsession *); -void ctdl_u(struct http_transaction *, struct ctdlsession *); -void ctdl_p(struct http_transaction *, struct ctdlsession *); -struct ctdlsession *connect_to_citadel(struct http_transaction *); -void disconnect_from_citadel(struct ctdlsession *); +void perform_one_http_transaction(struct client_handle *ch); char *header_val(struct http_transaction *h, char *requested_header); char *get_url_param(struct http_transaction *h, char *requested_param); -int unescape_input(char *); -void http_redirect(struct http_transaction *h, char *to_where); -char *http_datestring(time_t xtime); -void caldav_report(struct http_transaction *h, struct ctdlsession *c); +/* server/main.c */ +int main(int argc, char **argv); +/* server/messages.c */ long locate_message_by_uid(struct ctdlsession *c, char *uid); -void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs); void dav_delete_message(struct http_transaction *h, struct ctdlsession *c, long msgnum); +void dav_move_or_copy_message(struct http_transaction *h, struct ctdlsession *c, long msgnum, int move_or_copy); void dav_get_message(struct http_transaction *h, struct ctdlsession *c, long msgnum); void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *euid, long old_msgnum); -void dav_move_or_copy_message(struct http_transaction *h, struct ctdlsession *c, long msgnum, int move_or_copy); -ssize_t ctdl_write(struct ctdlsession *ctdl, const void *buf, size_t count); -int login_to_citadel(struct ctdlsession *c, char *auth, char *resultbuf); -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); +/* server/request.c */ +void do_404(struct http_transaction *h); +void do_405(struct http_transaction *h); +void do_412(struct http_transaction *h); +void do_204(struct http_transaction *h); +void do_502(struct http_transaction *h); +void request_http_authenticate(struct http_transaction *h); +void http_redirect(struct http_transaction *h, char *to_where); +void perform_request(struct http_transaction *h); +/* server/room_functions.c */ +int match_etags(char *taglist, long msgnum); +void json_stat(struct http_transaction *h, struct ctdlsession *c); +void json_mailbox(struct http_transaction *h, struct ctdlsession *c); +void json_msglist(struct http_transaction *h, struct ctdlsession *c, char *which); +void read_room_info_banner(struct http_transaction *h, struct ctdlsession *c); +void set_last_read_pointer(struct http_transaction *h, struct ctdlsession *c); +void object_in_room(struct http_transaction *h, struct ctdlsession *c); +void report_the_room_itself(struct http_transaction *h, struct ctdlsession *c); +void options_the_room_itself(struct http_transaction *h, struct ctdlsession *c); +void propfind_the_room_itself(struct http_transaction *h, struct ctdlsession *c); +void get_the_room_itself(struct http_transaction *h, struct ctdlsession *c); +void the_room_itself(struct http_transaction *h, struct ctdlsession *c); +void room_list(struct http_transaction *h, struct ctdlsession *c); +void ctdl_r(struct http_transaction *h, struct ctdlsession *c); +/* server/static.c */ +void output_static(struct http_transaction *h); +/* server/tcp_sockets.c */ +int lingering_close(int fd); +int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len); +int webcit_uds_server(char *sockpath, int queue_len); +/* server/text2html.c */ StrBuf *text2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source); StrBuf *variformat2html(StrBuf *Source); -int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes); -int ctdl_read_binary(struct ctdlsession *ctdl, char *buf, int bytes_requested); -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 UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf); -void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum); +/* server/tls.c */ +void bind_to_key_and_certificate(void); +void init_ssl(void); +void update_key_and_cert_if_needed(void); +void starttls(struct client_handle *ch); +void endtls(struct client_handle *ch); +int client_write_ssl(struct client_handle *ch, char *buf, int nbytes); +int client_read_ssl(struct client_handle *ch, char *buf, int nbytes); +/* server/upload.c */ +void upload_handler(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *userdata); void upload_files(struct http_transaction *h, struct ctdlsession *c); +void ctdl_p_base(struct http_transaction *h, struct ctdlsession *c); +void delete_upload(struct uploaded_file this_one); +void dav_delete_upload(struct http_transaction *h, struct ctdlsession *c, struct uploaded_file this_one); struct uploaded_file pop_upload(char *id); -void json_msglist(struct http_transaction *h, struct ctdlsession *c, char *range); +void attachment_filter(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *userdata); +void load_attachments_from_message(struct http_transaction *h, struct ctdlsession *c, char *name); +void specific_upload(struct http_transaction *h, struct ctdlsession *c, char *name); +void ctdl_p(struct http_transaction *h, struct ctdlsession *c); +/* server/user_functions.c */ +void fetch_user_photo(struct http_transaction *h, struct ctdlsession *c, char *username); +void fetch_user_bio(struct http_transaction *h, struct ctdlsession *c, char *username); +void object_in_user(struct http_transaction *h, struct ctdlsession *c, char *requested_username); +void the_user_itself(struct http_transaction *h, struct ctdlsession *c, char *username); +void user_list(struct http_transaction *h, struct ctdlsession *c); +void ctdl_u(struct http_transaction *h, struct ctdlsession *c); +/* server/util.c */ +int unescape_input(char *buf); +char *http_datestring(time_t xtime); +/* server/webserver.c */ +void spawn_another_worker_thread(int *pointer_to_master_socket); +void worker_entry(int *pointer_to_master_socket); +int webserver(char *webserver_interface, int webserver_port, int webserver_protocol); -- 2.30.2