From 83875cf99a93ec708989894477f3880cf4579630 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 28 Jun 2000 03:42:58 +0000 Subject: [PATCH] * Changed the comments at the beginning of each file to a consistent format * Improved the parameterization of commands in the IMAP module --- citadel/ChangeLog | 5 ++- citadel/Makefile.in | 17 +++++---- citadel/aidepost.c | 6 +-- citadel/auth.c | 5 ++- citadel/base64.c | 21 ++++------- citadel/chkpwd.c | 5 ++- citadel/citadel.c | 5 +-- citadel/citadel.h | 5 ++- citadel/citmail.c | 10 ++--- citadel/citserver.c | 8 +++- citadel/client_chat.c | 8 ++-- citadel/client_passwords.c | 8 ++++ citadel/client_passwords.h | 5 +++ citadel/commands.h | 5 ++- citadel/config.c | 3 +- citadel/config.h | 6 ++- citadel/control.c | 4 +- citadel/database.c | 3 +- citadel/domain.c | 7 ++++ citadel/domain.h | 4 ++ citadel/dynloader.c | 11 ++---- citadel/dynloader.h | 1 + citadel/file_ops.c | 8 +++- citadel/genstamp.c | 4 +- citadel/genstamp.h | 5 +++ citadel/getutline.c | 3 +- citadel/housekeeping.c | 3 +- citadel/html.c | 3 +- citadel/html.h | 5 +++ citadel/imap_tools.c | 56 +++++++++++++++++++++++++++ citadel/imap_tools.h | 6 +++ citadel/internet_addressing.h | 5 +++ citadel/internetmail.c | 3 +- citadel/ipc_c_tcp.c | 6 +-- citadel/locate_host.c | 4 +- citadel/logging.c | 4 +- citadel/messages.c | 3 +- citadel/mime_parser.c | 4 +- citadel/mime_parser.h | 5 +++ citadel/msgbase.c | 7 +++- citadel/msgform.c | 4 +- citadel/netmailer.c | 4 +- citadel/netpoll.c | 8 +++- citadel/netproc.c | 4 +- citadel/netsetup.c | 1 + citadel/parsedate.h | 5 +++ citadel/policy.c | 7 +++- citadel/proxy.c | 8 ++-- citadel/qpdecode.c | 2 + citadel/rcit.c | 5 +-- citadel/readlog.c | 3 +- citadel/room_ops.c | 7 +++- citadel/rooms.c | 9 ++++- citadel/routines.c | 8 +++- citadel/routines2.c | 8 ++-- citadel/sendcommand.c | 3 ++ citadel/serv_chat.c | 3 +- citadel/serv_expire.c | 3 +- citadel/serv_imap.c | 71 +++++++++++++++++------------------ citadel/serv_inetcfg.c | 4 +- citadel/serv_info.c | 4 +- citadel/serv_moderate.c | 1 + citadel/serv_pop3.c | 3 +- citadel/serv_pop3.h | 4 ++ citadel/serv_smtp.c | 8 +++- citadel/serv_test.c | 8 +++- citadel/serv_upgrade.c | 8 +++- citadel/serv_upgrade.h | 5 +++ citadel/serv_vcard.c | 4 +- citadel/setup.c | 4 +- citadel/snprintf.c | 10 ++--- citadel/stats.c | 6 ++- citadel/support.c | 8 +++- citadel/sysconfig.h | 5 +++ citadel/sysdep.c | 7 ++-- citadel/tools.c | 4 +- citadel/user_ops.c | 7 +++- citadel/userlist.c | 8 +++- citadel/whobbs.c | 8 +++- 79 files changed, 395 insertions(+), 170 deletions(-) create mode 100644 citadel/imap_tools.c create mode 100644 citadel/imap_tools.h diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 565a19052..fe87be2be 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 572.9 2000/06/28 03:42:56 ajc + * Changed the comments at the beginning of each file to a consistent format + * Improved the parameterization of commands in the IMAP module + Revision 572.8 2000/06/27 01:27:13 ajc * Coupla very small changes to get on the road to IMAP support @@ -1918,4 +1922,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 194637c43..e5aba8228 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -85,7 +85,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \ auth.c chkpwd.c html.c vcard.c serv_upgrade.c \ serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \ domain.c clientsocket.c serv_inetcfg.c serv_rwho.c serv_bio.c \ - serv_moderate.c client_passwords.c serv_imap.c + serv_moderate.c client_passwords.c serv_imap.c imap_tools.c DEP_FILES=$(SOURCES:.c=.d) @@ -161,12 +161,6 @@ modules/serv_pop3.so: serv_pop3.mo modules/serv_pop3.mo: serv_pop3.mo ln -f serv_pop3.mo modules -modules/serv_imap.so: serv_imap.mo - $(LINK_SHARED) -o modules/serv_imap.so serv_imap.mo - -modules/serv_imap.mo: serv_imap.mo - ln -f serv_imap.mo modules - modules/serv_inetcfg.so: serv_inetcfg.mo $(LINK_SHARED) -o modules/serv_inetcfg.so serv_inetcfg.mo @@ -221,6 +215,15 @@ modules/serv_smtp.mo: serv_smtp.mo modules/domain.mo: domain.mo ln -f domain.mo modules +modules/serv_imap.so: serv_imap.mo imap_tools.mo + $(LINK_SHARED) -o modules/serv_imap.so imap_tools.mo serv_imap.mo + +modules/serv_imap.mo: serv_imap.mo + ln -f serv_imap.mo modules + +modules/imap_tools.mo: imap_tools.mo + ln -f imap_tools.mo modules + aidepost: aidepost.o config.o $(LIBOBJS) $(CC) aidepost.o config.o $(LIBOBJS) $(LDFLAGS) -o aidepost diff --git a/citadel/aidepost.c b/citadel/aidepost.c index 1e25cd3a3..935df22b7 100644 --- a/citadel/aidepost.c +++ b/citadel/aidepost.c @@ -1,7 +1,7 @@ -/* aidepost.c - * This is just a little hack to copy standard input to a message in Aide> - * v2.0 +/* * $Id$ + * + * This is just a little hack to copy standard input to a message in Aide> */ #include diff --git a/citadel/auth.c b/citadel/auth.c index 37b989aff..66dc67c7a 100644 --- a/citadel/auth.c +++ b/citadel/auth.c @@ -1,8 +1,9 @@ /* - * auth.c -- system-level password checking for autologin + * $Id$ + * + * system-level password checking for autologin * by Nathan Bryant, March 1999 * - * $Id$ */ #if defined(__linux) || defined(__sun) /* needed for crypt(): */ diff --git a/citadel/base64.c b/citadel/base64.c index ff69e3218..53965bd43 100644 --- a/citadel/base64.c +++ b/citadel/base64.c @@ -1,18 +1,11 @@ /* - - Encode or decode file as MIME base64 (RFC 1341) - - by John Walker - http://www.fourmilab.ch/ - - This program is in the public domain. - -Revision date: 11th August 1997 - -Modified slightly for the Citadel/UX system, June 1999 -http://uncnsrd.mt-kisco.ny.us/citadel - -*/ + * $Id$ + * + * Encode or decode file as MIME base64 (RFC 1341) + * Public domain by John Walker, August 11 1997 + * Modified slightly for the Citadel/UX system, June 1999 + * + */ #include diff --git a/citadel/chkpwd.c b/citadel/chkpwd.c index 76f6c9bb1..b96ac7392 100644 --- a/citadel/chkpwd.c +++ b/citadel/chkpwd.c @@ -1,8 +1,9 @@ /* - * chkpwd.c: a setuid helper program for machines which use shadow passwords + * $Id$ + * + * a setuid helper program for machines which use shadow passwords * by Nathan Bryant, March 1999 * - * $Id$ */ #include diff --git a/citadel/citadel.c b/citadel/citadel.c index ba5ebb0bd..706558fee 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1,8 +1,7 @@ /* - * Citadel/UX - * - * citadel.c - Main source file. * $Id$ + * + * Main source module for the client program. */ #include "sysdep.h" diff --git a/citadel/citadel.h b/citadel/citadel.h index d31dc7975..048bfcafe 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -1,7 +1,8 @@ -/* citadel.h +/* + * $Id$ + * * main Citadel/UX header file * see copyright.txt for copyright information - * $Id$ */ /* system customizations are in sysconfig.h */ diff --git a/citadel/citmail.c b/citadel/citmail.c index a484e6bd2..4842532cf 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -1,12 +1,10 @@ /* - * - * Completely reworked version of "citmail" - * This program attempts to act like a local MDA if you're using sendmail or - * some other non-Citadel MTA. It basically just forwards the message to - * the Citadel SMTP listener on some non-standard port. - * * $Id$ * + * This program attempts to act like a local MDA if you're using sendmail or + * some other non-Citadel MTA. It basically just contacts the Citadel SMTP + * listener on a unix domain socket and transmits the message. + * */ #include "sysdep.h" diff --git a/citadel/citserver.c b/citadel/citserver.c index c5417bede..89f65d295 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Main source module for the Citadel server + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/client_chat.c b/citadel/client_chat.c index 3aad45f43..658e9c13b 100644 --- a/citadel/client_chat.c +++ b/citadel/client_chat.c @@ -1,11 +1,9 @@ /* - * Citadel/UX - * - * client_chat.c -- front end for chat mode - * (the "single process" version - no more fork() anymore) - * * $Id$ * + * front end for chat mode + * (the "single process" version - no more fork() anymore) + * */ #include "sysdep.h" diff --git a/citadel/client_passwords.c b/citadel/client_passwords.c index 3d78f9b3a..0f13555d5 100644 --- a/citadel/client_passwords.c +++ b/citadel/client_passwords.c @@ -1,3 +1,11 @@ +/* + * $Id$ + * + * Functions which allow the client to remember usernames and passwords for + * various sites. + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/client_passwords.h b/citadel/client_passwords.h index 1945ff07c..96a5fb4f8 100644 --- a/citadel/client_passwords.h +++ b/citadel/client_passwords.h @@ -1,3 +1,8 @@ +/* + * $Id$ + * + */ + void determine_pwfilename(char *); void get_stored_password( char *host, diff --git a/citadel/commands.h b/citadel/commands.h index b6464bc96..1d47e0d51 100644 --- a/citadel/commands.h +++ b/citadel/commands.h @@ -1,4 +1,7 @@ -/* $Id$ */ +/* + * $Id$ + * + */ /* * Colors for color() command diff --git a/citadel/config.c b/citadel/config.c index 0bc223a35..4f7de769e 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -1,8 +1,9 @@ /* + * $Id$ + * * This function reads the citadel.config file. It should be called at * the beginning of EVERY Citadel program. * - * $Id$ */ #include "sysdep.h" diff --git a/citadel/config.h b/citadel/config.h index ce092c28b..5804b9ae9 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -1,4 +1,8 @@ -/* $Id$ */ +/* + * $Id$ + * + */ + void get_config(void); void put_config(void); extern struct config config; diff --git a/citadel/control.c b/citadel/control.c index 3616a15c6..e9452d4e4 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -1,10 +1,8 @@ /* - * control.c + * $Id$ * * This module handles states which are global to the entire server. * - * $Id$ - * */ #include "sysdep.h" diff --git a/citadel/database.c b/citadel/database.c index 061647395..77360c6e0 100644 --- a/citadel/database.c +++ b/citadel/database.c @@ -1,8 +1,9 @@ /* + * $Id$ + * * This file contains a set of abstractions that allow Citadel to plug into any * record manager or database system for its data store. * - * $Id$ */ /* diff --git a/citadel/domain.c b/citadel/domain.c index 129b2efa3..265fce1df 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -1,3 +1,10 @@ +/* + * $Id$ + * + * DNS lookup for SMTP sender + * + */ + #include #include #include diff --git a/citadel/domain.h b/citadel/domain.h index d81060421..0d9ac9f66 100644 --- a/citadel/domain.h +++ b/citadel/domain.h @@ -1,3 +1,7 @@ +/* + * $Id$ + * + */ struct mx { int pref; diff --git a/citadel/dynloader.c b/citadel/dynloader.c index 657bc76f9..b8be4eb34 100644 --- a/citadel/dynloader.c +++ b/citadel/dynloader.c @@ -1,13 +1,10 @@ -/******************************************************* +/* + * $Id$ * * Citadel Dynamic Loading Module - * Written by Brian Costello - * btx@calyx.net - * - * $Id$ + * Written by Brian Costello * - ******************************************************/ - + */ #include "sysdep.h" #include diff --git a/citadel/dynloader.h b/citadel/dynloader.h index 1a43066be..4fec72fe4 100644 --- a/citadel/dynloader.h +++ b/citadel/dynloader.h @@ -1,4 +1,5 @@ /* $Id$ */ + void DLoader_Init(char *pathname); int DLoader_Exec_Cmd(char *cmdbuf); char *Dynamic_Module_Init(void); diff --git a/citadel/file_ops.c b/citadel/file_ops.c index 5bbe1a77a..e2db9eb56 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Server functions which handle file transfers and room directories. + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/genstamp.c b/citadel/genstamp.c index b3e910bae..4c7cf0d00 100644 --- a/citadel/genstamp.c +++ b/citadel/genstamp.c @@ -1,8 +1,8 @@ /* - * Function to generate RFC822-compliant textual time/date stamp - * * $Id$ * + * Function to generate RFC822-compliant textual time/date stamp + * */ #include diff --git a/citadel/genstamp.h b/citadel/genstamp.h index 747fb355c..8a654b2ef 100644 --- a/citadel/genstamp.h +++ b/citadel/genstamp.h @@ -1 +1,6 @@ +/* + * $Id$ + * + */ + void generate_rfc822_datestamp(char *buf, time_t xtime); diff --git a/citadel/getutline.c b/citadel/getutline.c index c6bc289e0..5eae2a760 100644 --- a/citadel/getutline.c +++ b/citadel/getutline.c @@ -1,8 +1,9 @@ /* + * $Id$ + * * getutline.c: not-quite-compatible replacement for getutline(3) * by nathan bryant, feb 1999 * - * $Id$ */ #include "sysdep.h" diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index fc878b499..c9ffcfb9e 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -1,8 +1,9 @@ /* + * $Id$ + * * This file contains housekeeping tasks which periodically * need to be executed. It keeps a nice little queue... * - * $Id$ */ #include "sysdep.h" diff --git a/citadel/html.c b/citadel/html.c index f638032f2..5c95524e4 100644 --- a/citadel/html.c +++ b/citadel/html.c @@ -1,6 +1,7 @@ /* - * html.c -- Functions which handle translation between HTML and plain text * $Id$ + * + * Functions which handle translation between HTML and plain text */ #include "sysdep.h" diff --git a/citadel/html.h b/citadel/html.h index c96bec221..ac53d1f75 100644 --- a/citadel/html.h +++ b/citadel/html.h @@ -1 +1,6 @@ +/* + * $Id$ + * + */ + char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat); diff --git a/citadel/imap_tools.c b/citadel/imap_tools.c new file mode 100644 index 000000000..05bfe3230 --- /dev/null +++ b/citadel/imap_tools.c @@ -0,0 +1,56 @@ +/* + * $Id$ + * + * Utility functions for the IMAP module. + * + */ + +#include +#include +#include +#include +#include "imap_tools.h" + +/* + * Break a command down into tokens, taking into consideration the + * possibility of escaping spaces using quoted tokens + */ +int imap_parameterize(char **args, char *buf) { + int num = 0; + int start = 0; + int i; + int in_quote = 0; + int original_len; + + strcat(buf, " "); + + original_len = strlen(buf); + + for (i=0; i diff --git a/citadel/ipc_c_tcp.c b/citadel/ipc_c_tcp.c index bb4290baa..2151c1590 100644 --- a/citadel/ipc_c_tcp.c +++ b/citadel/ipc_c_tcp.c @@ -1,9 +1,7 @@ /* - * ipc_c_tcp.c + * $Id$ * - * Citadel/UX client/server IPC - client module using TCP/IP - * - * version 1.3 $Id$ + * Client-side IPC functions * */ diff --git a/citadel/locate_host.c b/citadel/locate_host.c index e2ce8ee6b..5bd0b93a5 100644 --- a/citadel/locate_host.c +++ b/citadel/locate_host.c @@ -1,6 +1,8 @@ /* - * locate the originating host * $Id$ + * + * locate the originating host + * */ #include "sysdep.h" diff --git a/citadel/logging.c b/citadel/logging.c index 39a66c147..af9b57031 100644 --- a/citadel/logging.c +++ b/citadel/logging.c @@ -1,6 +1,8 @@ /* - * Everything which needs some logging... * $Id$ + * + * Everything which needs some logging... + * */ #include "sysdep.h" diff --git a/citadel/messages.c b/citadel/messages.c index 611b2b458..27ff4968b 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -1,7 +1,8 @@ /* + * $Id$ + * * Citadel/UX message support routines * see copyright.txt for copyright information - * $Id$ */ #include "sysdep.h" diff --git a/citadel/mime_parser.c b/citadel/mime_parser.c index ecd54358e..34decdd02 100644 --- a/citadel/mime_parser.c +++ b/citadel/mime_parser.c @@ -1,5 +1,5 @@ /* - * mime_parser.c + * $Id$ * * This is a really bad attempt at writing a parser to handle MIME-encoded * messages. @@ -7,8 +7,6 @@ * Copyright (c) 1998-1999 by Art Cancro * This code is distributed under the terms of the GNU General Public License. * - * $Id$ - * */ #include "sysdep.h" diff --git a/citadel/mime_parser.h b/citadel/mime_parser.h index b7f1c1b7e..88f8cc7fc 100644 --- a/citadel/mime_parser.h +++ b/citadel/mime_parser.h @@ -1,3 +1,8 @@ +/* + * $Id$ + * + */ + void extract_key(char *target, char *source, char *key); void mime_parser(char *content_start, char *content_end, diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 5be0bcf3b..086ca77e6 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1,4 +1,9 @@ -/* $Id$ */ +/* + * $Id$ + * + * Implements the message store. + * + */ #include "sysdep.h" #include diff --git a/citadel/msgform.c b/citadel/msgform.c index 94ddb0971..e4f80b666 100644 --- a/citadel/msgform.c +++ b/citadel/msgform.c @@ -1,6 +1,5 @@ /* - * msgform.c v2.1 $Id$ - * see copyright.doc for copyright information + * $Id$ * * This is simply a filter that converts Citadel binary message format * to readable, formatted output. @@ -9,6 +8,7 @@ * then it stops at the end of the first message it prints. * This is used by the QWK reader for Citadel/UX during message format * translation. + * */ #include "sysdep.h" diff --git a/citadel/netmailer.c b/citadel/netmailer.c index 7de5c419f..ccb9b020b 100644 --- a/citadel/netmailer.c +++ b/citadel/netmailer.c @@ -1,9 +1,7 @@ /* - * netmailer for Citadel/UX - * see copyright.doc for copyright information + * $Id$ * * netproc calls this to export Citadel mail to RFC822-compliant mailers. - * $Id$ */ #include diff --git a/citadel/netpoll.c b/citadel/netpoll.c index 4493515ae..03d105191 100644 --- a/citadel/netpoll.c +++ b/citadel/netpoll.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Perform data transfer between our Citadel server and another. + * + */ + #include #include #include diff --git a/citadel/netproc.c b/citadel/netproc.c index f7a108db7..93b20f627 100644 --- a/citadel/netproc.c +++ b/citadel/netproc.c @@ -1,7 +1,9 @@ /* + * $Id$ + * * Citadel/UX Intelligent Network Processor for IGnet/Open networks * See copyright.txt for copyright information - * $Id$ + * */ /* How long it takes for an old node to drop off the network map */ diff --git a/citadel/netsetup.c b/citadel/netsetup.c index 2542c3134..20785aecc 100644 --- a/citadel/netsetup.c +++ b/citadel/netsetup.c @@ -1,6 +1,7 @@ /* * $Id$ * + * Command-line utility to manipulate network configuration files * Copyright (c) 1998 Art Cancro * */ diff --git a/citadel/parsedate.h b/citadel/parsedate.h index eb7851d82..b28dae0eb 100644 --- a/citadel/parsedate.h +++ b/citadel/parsedate.h @@ -1 +1,6 @@ +/* + * $Id$ + * + */ + time_t parsedate(char *); diff --git a/citadel/policy.c b/citadel/policy.c index 3beea2bb2..b3223f143 100644 --- a/citadel/policy.c +++ b/citadel/policy.c @@ -1,4 +1,9 @@ -/* $Id$ */ +/* + * $Id$ + * + * Functions which manage policy for rooms (such as message expiry) + */ + #include "sysdep.h" #include #include diff --git a/citadel/proxy.c b/citadel/proxy.c index c2782519d..c50144286 100644 --- a/citadel/proxy.c +++ b/citadel/proxy.c @@ -1,10 +1,8 @@ /* - * Session layer proxy for Citadel - * (c) 1998 by Art Cancro, All Rights Reserved, released under GNU GPL v2 * $Id$ - */ - -/* + * + * A partially functional session layer proxy for Citadel + * (c) 1998 by Art Cancro, All Rights Reserved, released under GNU GPL v2 * NOTE: this isn't finished, so don't use it!! * */ diff --git a/citadel/qpdecode.c b/citadel/qpdecode.c index ba01e1269..94686532d 100644 --- a/citadel/qpdecode.c +++ b/citadel/qpdecode.c @@ -1,4 +1,6 @@ /* + * $Id$ + * * Convert "quoted printable" encoding to binary (stdin to stdout) * Copyright (C) 1999 by Art Cancro * Distributed under the terms of the GNU General Public License. diff --git a/citadel/rcit.c b/citadel/rcit.c index a5f6f9acf..8cd0e4f88 100644 --- a/citadel/rcit.c +++ b/citadel/rcit.c @@ -1,6 +1,4 @@ -#define UNCOMPRESS "/usr/bin/gunzip" - -/* Citadel/UX rcit $Id$ +/* $Id$ * * This program simply feeds its standard input to the networker. It is * used primarily to hook up to UUCP feeds of Citadel data. @@ -13,6 +11,7 @@ * -s Don't run netproc now, just accept the input into spoolin */ +#define UNCOMPRESS "/usr/bin/gunzip" #include #include #include diff --git a/citadel/readlog.c b/citadel/readlog.c index 6fc67aa3f..1964f9dc3 100644 --- a/citadel/readlog.c +++ b/citadel/readlog.c @@ -1,6 +1,7 @@ /* - * readlog.c (a simple program to parse citadel.log) * $Id$ + * + * A simple program to parse citadel.log */ #include diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 25f7fa861..c9c6b5136 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -1,4 +1,9 @@ -/* $Id$ */ +/* + * $Id$ + * + * Server functions which perform operations on room objects. + * + */ #include "sysdep.h" #include #include diff --git a/citadel/rooms.c b/citadel/rooms.c index 68135fe49..0cd7a32a8 100644 --- a/citadel/rooms.c +++ b/citadel/rooms.c @@ -1,5 +1,10 @@ -/* Citadel/UX room-oriented routines */ -/* $Id$ */ +/* + * $Id$ + * + * + * Client-side functions which perform room operations + * + */ #include "sysdep.h" #include diff --git a/citadel/routines.c b/citadel/routines.c index 1f967e278..099794217 100644 --- a/citadel/routines.c +++ b/citadel/routines.c @@ -1,5 +1,9 @@ -/* Citadel/UX support routines */ -/* $Id$ */ +/* + * $Id$ + * + * Client-side support functions. + * + */ #include "sysdep.h" #include diff --git a/citadel/routines2.c b/citadel/routines2.c index 87a398aa7..224a31631 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -1,6 +1,8 @@ -/* More Citadel/UX routines... - * unlike routines.c, some of these DO use global variables. - * $Id$ +/* $Id$ + * + * More client-side support functions. + * Unlike routines.c, some of these DO use global variables. + * */ #include "sysdep.h" diff --git a/citadel/sendcommand.c b/citadel/sendcommand.c index a5e1fa2e4..be6977854 100644 --- a/citadel/sendcommand.c +++ b/citadel/sendcommand.c @@ -1,5 +1,8 @@ /* * $Id$ + * + * Command-line utility to transmit a server command. + * */ diff --git a/citadel/serv_chat.c b/citadel/serv_chat.c index d1b4db02a..326d12355 100644 --- a/citadel/serv_chat.c +++ b/citadel/serv_chat.c @@ -1,10 +1,9 @@ /* - * serv_chat.c + * $Id$ * * This module handles all "real time" communication between users. The * modes of communication currently supported are Chat and Paging. * - * $Id$ */ #include "sysdep.h" #include diff --git a/citadel/serv_expire.c b/citadel/serv_expire.c index f8f2366e1..1918ce958 100644 --- a/citadel/serv_expire.c +++ b/citadel/serv_expire.c @@ -1,9 +1,8 @@ /* - * serv_expire.c + * $Id$ * * This module handles the expiry of old messages and the purging of old users. * - * $Id$ */ diff --git a/citadel/serv_imap.c b/citadel/serv_imap.c index 4c712fa74..adb4f623e 100644 --- a/citadel/serv_imap.c +++ b/citadel/serv_imap.c @@ -1,4 +1,5 @@ -/* $Id$ +/* + * $Id$ * * IMAP server for the Citadel/UX system * Copyright (C) 2000 by Art Cancro and others. @@ -39,6 +40,7 @@ #include "tools.h" #include "internet_addressing.h" #include "serv_imap.h" +#include "imap_tools.h" long SYM_IMAP; @@ -78,30 +80,24 @@ void imap_greeting(void) { /* * implements the LOGIN command (ordinary username/password login) */ -void imap_login(char *tag, char *cmd, char *parms) { - char username[256]; - char password[256]; - - extract_token(username, parms, 0, ' '); - extract_token(password, parms, 1, ' '); - - if (CtdlLoginExistingUser(username) == login_ok) { - if (CtdlTryPassword(password) == pass_ok) { - cprintf("%s OK login successful\r\n", tag); +void imap_login(int num_parms, char *parms[]) { + if (CtdlLoginExistingUser(parms[2]) == login_ok) { + if (CtdlTryPassword(parms[3]) == pass_ok) { + cprintf("%s OK login successful\r\n", parms[0]); return; } } - cprintf("%s BAD Login incorrect\r\n", tag); + cprintf("%s BAD Login incorrect\r\n", parms[0]); } /* * implements the CAPABILITY command */ -void imap_capability(char *tag, char *cmd, char *parms) { +void imap_capability(int num_parms, char *parms[]) { cprintf("* CAPABILITY IMAP4 IMAP4REV1 AUTH=LOGIN\r\n"); - cprintf("%s OK CAPABILITY completed\r\n", tag); + cprintf("%s OK CAPABILITY completed\r\n", parms[0]); } @@ -111,7 +107,7 @@ void imap_capability(char *tag, char *cmd, char *parms) { /* * implements the SELECT command */ -void imap_select(char *tag, char *cmd, char *parms) { +void imap_select(int num_parms, char *parms[]) { char towhere[256]; char augmented_roomname[256]; int c = 0; @@ -120,7 +116,7 @@ void imap_select(char *tag, char *cmd, char *parms) { struct quickroom QRscratch; int msgs, new; - extract_token(towhere, parms, 0, ' '); + strcpy(towhere, parms[2]); /* IMAP uses the reserved name "INBOX" for the user's default incoming * mail folder. Convert this to Citadel's reserved name "_MAIL_". @@ -151,7 +147,8 @@ void imap_select(char *tag, char *cmd, char *parms) { /* Fail here if no such room */ if (!ok) { - cprintf("%s NO ... no such room, or access denied\r\n", tag); + cprintf("%s NO ... no such room, or access denied\r\n", + parms[0]); IMAP->selected = 0; return; } @@ -165,7 +162,7 @@ void imap_select(char *tag, char *cmd, char *parms) { cprintf("* %d EXISTS\r\n", msgs); cprintf("* %d RECENT\r\n", new); cprintf("* OK [UIDVALIDITY 0] UIDs valid\r\n"); - cprintf("%s OK [FIXME] SELECT completed\r\n", tag); + cprintf("%s OK [FIXME] SELECT completed\r\n", parms[0]); } @@ -174,8 +171,9 @@ void imap_select(char *tag, char *cmd, char *parms) { */ void imap_command_loop(void) { char cmdbuf[256]; - char tag[256]; - char cmd[256]; + char *parms[16]; + int num_parms; + int i; time(&CC->lastcmd); memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */ @@ -195,48 +193,47 @@ void imap_command_loop(void) { striplt(cmdbuf); /* grab the tag */ - extract_token(tag, cmdbuf, 0, ' '); - extract_token(cmd, cmdbuf, 1, ' '); - remove_token(cmdbuf, 0, ' '); - remove_token(cmdbuf, 0, ' '); - lprintf(9, "tag=<%s> cmd=<%s> parms=<%s>\n", tag, cmd, cmdbuf); + num_parms = imap_parameterize(parms, cmdbuf); + for (i=0; ikill_me = 1; return; } - else if (!strcasecmp(cmd, "LOGIN")) { - imap_login(tag, cmd, cmdbuf); + else if (!strcasecmp(parms[1], "LOGIN")) { + imap_login(num_parms, parms); } - else if (!strcasecmp(cmd, "CAPABILITY")) { - imap_capability(tag, cmd, cmdbuf); + else if (!strcasecmp(parms[1], "CAPABILITY")) { + imap_capability(num_parms, parms); } else if (!CC->logged_in) { - cprintf("%s BAD Not logged in.\r\n", tag); + cprintf("%s BAD Not logged in.\r\n", parms[0]); } /* commands requiring the client to be logged in */ - else if (!strcasecmp(cmd, "SELECT")) { - imap_select(tag, cmd, cmdbuf); + else if (!strcasecmp(parms[1], "SELECT")) { + imap_select(num_parms, parms); } /* end of commands */ else { - cprintf("%s BAD command unrecognized\r\n", tag); + cprintf("%s BAD command unrecognized\r\n", parms[0]); } } diff --git a/citadel/serv_inetcfg.c b/citadel/serv_inetcfg.c index 0f737910c..101bad90e 100644 --- a/citadel/serv_inetcfg.c +++ b/citadel/serv_inetcfg.c @@ -1,9 +1,11 @@ -/* $Id$ +/* + * $Id$ * * This module handles the loading/saving and maintenance of the * system's Internet configuration. It's not an optional component; I * wrote it as a module merely to keep things as clean and loosely coupled * as possible. + * */ #include "sysdep.h" diff --git a/citadel/serv_info.c b/citadel/serv_info.c index e64f27282..338985523 100644 --- a/citadel/serv_info.c +++ b/citadel/serv_info.c @@ -1,7 +1,9 @@ /* * $Id$ * - * The CtdlGetServerInfo() function is useful for + * The CtdlGetServerInfo() function is useful for removing unsightly + * uranium deposits from rhinocerous aqueducts. + * */ #include diff --git a/citadel/serv_moderate.c b/citadel/serv_moderate.c index efa9b97ac..77c210798 100644 --- a/citadel/serv_moderate.c +++ b/citadel/serv_moderate.c @@ -1,6 +1,7 @@ /* * $Id$ * + * Server-side functions which handle message moderation. * */ diff --git a/citadel/serv_pop3.c b/citadel/serv_pop3.c index 1544ed48f..2d88dbba3 100644 --- a/citadel/serv_pop3.c +++ b/citadel/serv_pop3.c @@ -1,4 +1,5 @@ -/* $Id$ +/* + * $Id$ * * POP3 server for the Citadel/UX system * Copyright (C) 1998-2000 by Art Cancro and others. diff --git a/citadel/serv_pop3.h b/citadel/serv_pop3.h index be228e7b0..fbb8ef24f 100644 --- a/citadel/serv_pop3.h +++ b/citadel/serv_pop3.h @@ -1,3 +1,7 @@ +/* + * $Id$ + * + */ struct pop3msg { long msgnum; diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index b7e78ea8c..75e9a4ef1 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * An implementation of RFC821 (Simple Mail Transfer Protocol) for the + * Citadel system. + * + */ #include "sysdep.h" #include diff --git a/citadel/serv_test.c b/citadel/serv_test.c index 0d3ce30bc..3ab8af95b 100644 --- a/citadel/serv_test.c +++ b/citadel/serv_test.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * A skeleton module to test the dynamic loader. + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 942da0551..176194cd9 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Transparently handle the upgrading of server data formats. + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/serv_upgrade.h b/citadel/serv_upgrade.h index 06eb854ac..2895dbf73 100644 --- a/citadel/serv_upgrade.h +++ b/citadel/serv_upgrade.h @@ -1,3 +1,8 @@ +/* + * $Id$ + * + */ + /* * Format of a usersupp record prior to version 5.55 */ diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 90966312e..b43cbfb30 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -1,11 +1,9 @@ /* - * serv_vcard.c + * $Id$ * * A server-side module for Citadel which supports address book information * using the standard vCard format. * - * $Id$ - * */ #define ADDRESS_BOOK_ROOM "Global Address Book" diff --git a/citadel/setup.c b/citadel/setup.c index fe1867e85..6627048e2 100644 --- a/citadel/setup.c +++ b/citadel/setup.c @@ -1,8 +1,8 @@ /* - * Citadel/UX setup program * $Id$ * - * *** YOU MUST EDIT sysconfig.h >BEFORE< COMPILING SETUP *** + * Citadel/UX setup utility + * */ #include diff --git a/citadel/snprintf.c b/citadel/snprintf.c index 32f8174ec..dcc9cd81c 100644 --- a/citadel/snprintf.c +++ b/citadel/snprintf.c @@ -1,13 +1,11 @@ /* - * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997 - * --nathan bryant - * * $Id$ - */ - -/* + * * Replacements for snprintf() and vsnprintf() * + * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997 + * --nathan bryant + * * Use it only if you have the "spare" cycles needed to effectively * do every snprintf operation twice! Why is that? Because everything * is first vfprintf()'d to /dev/null to determine the number of bytes. diff --git a/citadel/stats.c b/citadel/stats.c index a5cff6340..214ac436b 100644 --- a/citadel/stats.c +++ b/citadel/stats.c @@ -1,6 +1,10 @@ -/* Citadel/UX call log stats program +/* * $Id$ + * + * Citadel/UX call log stats program + * */ + #include #include #include diff --git a/citadel/support.c b/citadel/support.c index cc4ac677b..3c068ceda 100644 --- a/citadel/support.c +++ b/citadel/support.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Server-side utility functions + * + */ + #include "sysdep.h" #include #include diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index dd445ce9d..d582ed1d5 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -1,3 +1,8 @@ +/* + * $Id$ + * + */ + /****************************************************************************/ /* YOUR SYSTEM CONFIGURATION */ /* Set all the values in this file appropriately BEFORE compiling any of the*/ diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 00bb311d5..b4d46c2e2 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -1,14 +1,15 @@ /* + * $Id$ + * * Citadel/UX "system dependent" stuff. * See copyright.txt for copyright information. * - * $Id$ - * - * Here's where we (hopefully) have all the parts of the Citadel server that + * Here's where we (hopefully) have most parts of the Citadel server that * would need to be altered to run the server in a non-POSIX environment. * * Eventually we'll try porting to a different platform and either have * multiple variants of this file or simply load it up with #ifdefs. + * */ diff --git a/citadel/tools.c b/citadel/tools.c index 5cb896c6f..e868f93af 100644 --- a/citadel/tools.c +++ b/citadel/tools.c @@ -1,6 +1,8 @@ /* - * tools.c -- Miscellaneous routines used by both the client and server. * $Id$ + * + * Utility functions that are used by both the client and server. + * */ #include "sysdep.h" diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 44e11dbe5..ec57f6bec 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -1,4 +1,9 @@ -/* $Id$ */ +/* + * $Id$ + * + * Server functions which perform operations on user objects. + * + */ #include "sysdep.h" #include diff --git a/citadel/userlist.c b/citadel/userlist.c index 91d99f1dc..db120a9f1 100644 --- a/citadel/userlist.c +++ b/citadel/userlist.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Command-line user list utility. + * + */ + #include #include #include diff --git a/citadel/whobbs.c b/citadel/whobbs.c index b59543bc2..95674a71e 100644 --- a/citadel/whobbs.c +++ b/citadel/whobbs.c @@ -1,4 +1,10 @@ -/* $Id$ */ +/* + * $Id$ + * + * Command-line "who is online?" utility + * + */ + #include #include #include -- 2.30.2