From 7dc39da07d6f8d25c4f43daedd46a6018af2bc75 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 4 Jul 2023 08:33:50 -0900 Subject: [PATCH] textclient: indent -kr -i8 -brf -bbb -fnc -l132 -nce --- textclient/citadel.c | 44 ++- textclient/citadel_ipc.c | 3 +- textclient/commands.c | 4 +- textclient/ipc_c_tcp.c | 2 +- textclient/rooms.c | 10 +- textclient/textclient.h | 588 ++++++++++++++++++++------------------- 6 files changed, 331 insertions(+), 320 deletions(-) diff --git a/textclient/citadel.c b/textclient/citadel.c index 453f21bea..c151f6120 100644 --- a/textclient/citadel.c +++ b/textclient/citadel.c @@ -78,12 +78,12 @@ void ctdl_logoff(char *file, int line, CtdlIPC * ipc, int code) { } // Shut down the server connection ... but not if the logoff code is 3, - // because that means we're exiting because we already lost the server. + // because that means we're exiting because we already lost the server. if (code != 3) { CtdlIPCQuit(ipc); } - // now clean up various things + // now clean up various things unlink(temp); unlink(temp2); nukedir(tempdir); @@ -399,29 +399,27 @@ void dotgoto(CtdlIPC * ipc, char *towhere, int display_name, int fromungoto) { readinfo(ipc); /* check for newly arrived mail if we can FIXME use BIFF command for this - if (newmailcount > 0) { - color(BRIGHT_RED); - if (newmailcount == 1) { - scr_printf("*** A new mail message has arrived.\n"); - } - else { - scr_printf("*** %d new mail messages have arrived.\n", newmailcount); - } - color(DIM_WHITE); - if (!IsEmptyStr(rc_gotmail_cmd)) { - rv = system(rc_gotmail_cmd); - if (rv) - scr_printf("*** failed to check for mail calling %s Reason %d.\n", rc_gotmail_cmd, rv); - } - } - */ + if (newmailcount > 0) { + color(BRIGHT_RED); + if (newmailcount == 1) { + scr_printf("*** A new mail message has arrived.\n"); + } + else { + scr_printf("*** %d new mail messages have arrived.\n", newmailcount); + } + color(DIM_WHITE); + if (!IsEmptyStr(rc_gotmail_cmd)) { + rv = system(rc_gotmail_cmd); + if (rv) + scr_printf("*** failed to check for mail calling %s Reason %d.\n", rc_gotmail_cmd, rv); + } + } + */ free(room); if (screenwidth > 5) - snprintf(&status_line[1], screenwidth - 1, "%s | %s | %s | %s | %d new mail |", - (secure ? "Encrypted" : "Unencrypted"), - ipc->ServInfo.humannode, ipc->ServInfo.site_location, room_name, 0); // FIXME use BIFF + snprintf(&status_line[1], screenwidth - 1, "%s | %s | %s | %s | %d new mail |", (secure ? "Encrypted" : "Unencrypted"), ipc->ServInfo.humannode, ipc->ServInfo.site_location, room_name, 0); // FIXME use BIFF } @@ -1039,7 +1037,7 @@ void get_serv_info(CtdlIPC * ipc, char *supplied_hostname) { // Indicate to the server that we prefer to decode Base64 and // quoted-printable on the client side. if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "dont_decode") / 100) != 2) { - scr_printf("Error %s:%d", __FILE__ , __LINE__); + scr_printf("Error %s:%d", __FILE__, __LINE__); logoff(ipc, 0); } @@ -1052,7 +1050,7 @@ void get_serv_info(CtdlIPC * ipc, char *supplied_hostname) { * the plain text when we have it available. */ if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "text/plain|text/html|text/x-markdown") / 100) != 2) { - scr_printf("Error %s:%d", __FILE__ , __LINE__); + scr_printf("Error %s:%d", __FILE__, __LINE__); logoff(ipc, 0); } } diff --git a/textclient/citadel_ipc.c b/textclient/citadel_ipc.c index 26d2fa2ad..d57edc4a8 100644 --- a/textclient/citadel_ipc.c +++ b/textclient/citadel_ipc.c @@ -1927,8 +1927,7 @@ int CtdlIPCAideSetUserParameters(CtdlIPC * ipc, const struct ctdluser *uret, cha return -1; sprintf(aaa, "ASUP %s|%s|%d|0|0|%d|%ld|%ld|%d", - uret->fullname, uret->password, uret->flags, - uret->axlevel, uret->usernum, uret->lastcall, uret->USuserpurge); + uret->fullname, uret->password, uret->flags, uret->axlevel, uret->usernum, uret->lastcall, uret->USuserpurge); ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret); free(aaa); return ret; diff --git a/textclient/commands.c b/textclient/commands.c index 197fe1a9d..fc0fe2d13 100644 --- a/textclient/commands.c +++ b/textclient/commands.c @@ -1437,7 +1437,7 @@ int fmout(int width, // screen width to use continue; } - if ( (in_quote) && (*e == '\n') && (enable_color) ) { + if ((in_quote) && (*e == '\n') && (enable_color)) { in_quote = 0; scr_printf("\033[22m\033[23m"); } @@ -1466,7 +1466,7 @@ int fmout(int width, // screen width to use continue; } - if ( (*e == '>') && (column <= 1) && (!fpout) && (enable_color) ) { + if ((*e == '>') && (column <= 1) && (!fpout) && (enable_color)) { in_quote = 1; scr_printf("\033[2m\033[3m"); } diff --git a/textclient/ipc_c_tcp.c b/textclient/ipc_c_tcp.c index b24a130b8..573f872d3 100644 --- a/textclient/ipc_c_tcp.c +++ b/textclient/ipc_c_tcp.c @@ -17,7 +17,7 @@ /* Note that some of these functions may not work with multiple instances. */ static void (*deathHook)(void) = NULL; -int (*error_printf)(char *s, ...) =(int(*)(char *, ...)) printf; +int (*error_printf)(char *s, ...) = (int (*)(char *, ...)) printf; void setIPCDeathHook(void (*hook)(void)) { deathHook = hook; diff --git a/textclient/rooms.c b/textclient/rooms.c index 4d78a1080..5e4d2c4f3 100644 --- a/textclient/rooms.c +++ b/textclient/rooms.c @@ -285,7 +285,7 @@ void knrooms(CtdlIPC * ipc, int kn_floor_mode) { void listzrooms(CtdlIPC * ipc) { // list public forgotten rooms struct march *listing = NULL; struct march *mptr; - int r; // IPC response code + int r; // IPC response code char buf[SIZ]; @@ -467,7 +467,8 @@ void editthisroom(CtdlIPC * ipc) { attr->QRfloor = select_floor(ipc, attr->QRfloor); attr->QRflags = set_room_attr(ipc, attr->QRflags, "Private room", QR_PRIVATE); if (attr->QRflags & QR_PRIVATE) { - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Hidden room (accessible to anyone who knows the room name)", QR_GUESSNAME); + attr->QRflags = + set_room_attr(ipc, attr->QRflags, "Hidden room (accessible to anyone who knows the room name)", QR_GUESSNAME); } // if it's public, clear the privacy classes @@ -498,7 +499,8 @@ void editthisroom(CtdlIPC * ipc) { attr->QRflags = set_room_attr(ipc, attr->QRflags, "Read-only room", QR_READONLY); attr->QRflags2 = set_room_attr(ipc, attr->QRflags2, "Allow message deletion by anyone who can post", QR2_COLLABDEL); attr->QRflags = set_room_attr(ipc, attr->QRflags, "Permanent room", QR_PERMANENT); - attr->QRflags2 = set_room_attr(ipc, attr->QRflags2, "Subject Required (Force users to specify a message subject)", QR2_SUBJECTREQ); + attr->QRflags2 = + set_room_attr(ipc, attr->QRflags2, "Subject Required (Force users to specify a message subject)", QR2_SUBJECTREQ); attr->QRflags = set_room_attr(ipc, attr->QRflags, "Directory room", QR_DIRECTORY); if (attr->QRflags & QR_DIRECTORY) { strprompt("Directory name", attr->QRdirname, 14); @@ -774,7 +776,7 @@ void download(CtdlIPC * ipc, int proto) { tpipe = fopen(tempname, "wb"); if (fwrite(file, filelen, 1, tpipe) < filelen) { // FIXME: restart syscall on EINTR - // broken = 1; + // broken = 1; } fclose(tpipe); if (file) diff --git a/textclient/textclient.h b/textclient/textclient.h index 6dd5889ca..4f6730c79 100644 --- a/textclient/textclient.h +++ b/textclient/textclient.h @@ -15,18 +15,18 @@ #define CLIENT_TYPE 0 // commands we can send to the stty_ctdl() routine -#define SB_NO_INTR 0 // set to Citadel client mode, i/q disabled -#define SB_YES_INTR 1 // set to Citadel client mode, i/q enabled -#define SB_SAVE 2 // save settings -#define SB_RESTORE 3 // restore settings -#define SB_LAST 4 // redo the last command sent +#define SB_NO_INTR 0 // set to Citadel client mode, i/q disabled +#define SB_YES_INTR 1 // set to Citadel client mode, i/q enabled +#define SB_SAVE 2 // save settings +#define SB_RESTORE 3 // restore settings +#define SB_LAST 4 // redo the last command sent -#define UGLISTLEN 100 // you get a ungoto list of this size */ -#define ROOMNAMELEN 128 // The size of a roomname string -#define USERNAME_SIZE 64 // The size of a username string -#define MAX_EDITORS 5 // number of external editors supported, must be at least 1 +#define UGLISTLEN 100 // you get a ungoto list of this size */ +#define ROOMNAMELEN 128 // The size of a roomname string +#define USERNAME_SIZE 64 // The size of a username string +#define MAX_EDITORS 5 // number of external editors supported, must be at least 1 -#define S_KEEPALIVE 30 // How often (in seconds) to send keepalives to the server +#define S_KEEPALIVE 30 // How often (in seconds) to send keepalives to the server #define READ_HEADER 2 #define READ_MSGBODY 3 @@ -37,26 +37,26 @@ #define STOP_KEY 3 // citadel.rc stuff -#define RC_NO 0 // always no -#define RC_YES 1 // always yes -#define RC_DEFAULT 2 // setting depends on user config +#define RC_NO 0 // always no +#define RC_YES 1 // always yes +#define RC_DEFAULT 2 // setting depends on user config // keepalives enum { - KA_NO, // no keepalives - KA_YES, // full keepalives - KA_HALF // half keepalives + KA_NO, // no keepalives + KA_YES, // full keepalives + KA_HALF // half keepalives }; // for <;G>oto and <;S>kip commands -#define GF_GOTO 0 // <;G>oto floor mode -#define GF_SKIP 1 // <;S>kip floor mode -#define GF_ZAP 2 // <;Z>ap floor mode +#define GF_GOTO 0 // <;G>oto floor mode +#define GF_SKIP 1 // <;S>kip floor mode +#define GF_ZAP 2 // <;Z>ap floor mode // Can messages be entered in this room? -#define ENTMSG_OK_NO 0 // You may not enter messages here -#define ENTMSG_OK_YES 1 // Go ahead! -#define ENTMSG_OK_BLOG 2 // Yes, but warn the user about how blog rooms work +#define ENTMSG_OK_NO 0 // You may not enter messages here +#define ENTMSG_OK_YES 1 // Go ahead! +#define ENTMSG_OK_BLOG 2 // Yes, but warn the user about how blog rooms work // Colors for color() command #define DIM_BLACK 0 @@ -75,9 +75,9 @@ enum { #define BRIGHT_MAGENTA 13 #define BRIGHT_CYAN 14 #define BRIGHT_WHITE 15 -#define COLOR_PUSH 16 // Save current color -#define COLOR_POP 17 // Restore saved color -#define ORIGINAL_PAIR -1 // Default terminal colors +#define COLOR_PUSH 16 // Save current color +#define COLOR_POP 17 // Restore saved color +#define ORIGINAL_PAIR -1 // Default terminal colors #include @@ -151,20 +151,20 @@ struct CtdlServInfo { typedef struct _CtdlIPC { struct CtdlServInfo ServInfo; /* The server info for this connection */ #if defined(HAVE_OPENSSL) - SSL *ssl; /* NULL if not encrypted, non-NULL otherwise */ + SSL *ssl; /* NULL if not encrypted, non-NULL otherwise */ #endif - int sock; /* Socket for connection to server, or -1 if not connected */ - int isLocal; /* 1 if server is local, 0 otherwise or if not connected */ - int downloading; /* 1 if a download is open on the server, 0 otherwise */ - int uploading; /* 1 if an upload is open on the server, 0 otherwise */ + int sock; /* Socket for connection to server, or -1 if not connected */ + int isLocal; /* 1 if server is local, 0 otherwise or if not connected */ + int downloading; /* 1 if a download is open on the server, 0 otherwise */ + int uploading; /* 1 if an upload is open on the server, 0 otherwise */ time_t last_command_sent; /* Time the last command was sent to the server */ - char *Buf; /* Our buffer for linebuffered read. */ + char *Buf; /* Our buffer for linebuffered read. */ size_t BufSize; size_t BufUsed; char *BufPtr; void (*network_status_cb)(int state); /* Callback for update on whether the IPC is locked */ - char ip_hostname[256]; /* host name of server to which we are connected (if network) */ - char ip_address[64]; /* IP address of server to which we are connected (if network) */ + char ip_hostname[256]; /* host name of server to which we are connected (if network) */ + char ip_address[64]; /* IP address of server to which we are connected (if network) */ } CtdlIPC; extern char *axdefs[]; @@ -186,8 +186,8 @@ extern char rc_password[32]; extern char rc_floor_mode; extern time_t rc_idle_threshold; #ifdef HAVE_OPENSSL -extern char rc_encrypt; /* from the citadel.rc file */ -extern char arg_encrypt; /* from the command line */ +extern char rc_encrypt; /* from the citadel.rc file */ +extern char arg_encrypt; /* from the command line */ #endif #if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES) extern char rc_screen; @@ -195,13 +195,13 @@ extern char arg_screen; #endif extern char rc_alt_semantics; extern char instant_msgs; -void ctdl_logoff(char *file, int line, CtdlIPC *ipc, int code); +void ctdl_logoff(char *file, int line, CtdlIPC * ipc, int code); #define logoff(ipc, code) ctdl_logoff(__FILE__, __LINE__, (ipc), (code)) -void formout(CtdlIPC *ipc, char *name); +void formout(CtdlIPC * ipc, char *name); void sighandler(int which_sig); extern int secure; void remove_march(char *roomname, int floornum); -void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, int dbg); +void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, int dbg); typedef struct ExpirePolicy ExpirePolicy; struct ExpirePolicy { @@ -227,115 +227,119 @@ struct march { * This is NOT the same 'struct ctdluser' from the server. */ typedef struct ctdluser ctdluser; -struct ctdluser { // User record - int version; // Cit vers. which created this rec - uid_t uid; // Associate with a unix account? - char password[32]; // password - unsigned flags; // See US_ flags below - uint8_t axlevel; // Access level - long usernum; // User number (never recycled) - time_t lastcall; // Date/time of most recent login - int USuserpurge; // Purge time (in days) for user - char fullname[64]; // Display name (primary identifier) - char emailaddrs[512]; // Internet email addresses +struct ctdluser { // User record + int version; // Cit vers. which created this rec + uid_t uid; // Associate with a unix account? + char password[32]; // password + unsigned flags; // See US_ flags below + uint8_t axlevel; // Access level + long usernum; // User number (never recycled) + time_t lastcall; // Date/time of most recent login + int USuserpurge; // Purge time (in days) for user + char fullname[64]; // Display name (primary identifier) + char emailaddrs[512]; // Internet email addresses }; typedef struct ctdlroom ctdlroom; struct ctdlroom { - char QRname[ROOMNAMELEN]; /* Name of room */ - char QRpasswd[10]; /* Only valid if it's a private rm */ - long QRroomaide; /* User number of room aide */ - long QRhighest; /* Highest message NUMBER in room */ - time_t QRgen; /* Generation number of room */ - unsigned QRflags; /* See flag values below */ - char QRdirname[15]; /* Directory name, if applicable */ - long QRinfo; /* Info file update relative to msgs*/ - char QRfloor; /* Which floor this room is on */ - time_t QRmtime; /* Date/time of last post */ - struct ExpirePolicy QRep; /* Message expiration policy */ - long QRnumber; /* Globally unique room number */ - char QRorder; /* Sort key for room listing order */ - unsigned QRflags2; /* Additional flags */ - int QRdefaultview; /* How to display the contents */ + char QRname[ROOMNAMELEN]; /* Name of room */ + char QRpasswd[10]; /* Only valid if it's a private rm */ + long QRroomaide; /* User number of room aide */ + long QRhighest; /* Highest message NUMBER in room */ + time_t QRgen; /* Generation number of room */ + unsigned QRflags; /* See flag values below */ + char QRdirname[15]; /* Directory name, if applicable */ + long QRinfo; /* Info file update relative to msgs */ + char QRfloor; /* Which floor this room is on */ + time_t QRmtime; /* Date/time of last post */ + struct ExpirePolicy QRep; /* Message expiration policy */ + long QRnumber; /* Globally unique room number */ + char QRorder; /* Sort key for room listing order */ + unsigned QRflags2; /* Additional flags */ + int QRdefaultview; /* How to display the contents */ }; /* C constructor */ -CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf); +CtdlIPC *CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf); + /* C destructor */ -void CtdlIPC_delete(CtdlIPC* ipc); +void CtdlIPC_delete(CtdlIPC * ipc); + /* Convenience destructor; also nulls out caller's pointer */ -void CtdlIPC_delete_ptr(CtdlIPC** pipc); +void CtdlIPC_delete_ptr(CtdlIPC ** pipc); + /* Read a line from server, discarding newline, for chat, will go away */ -void CtdlIPC_chat_recv(CtdlIPC* ipc, char *buf); +void CtdlIPC_chat_recv(CtdlIPC * ipc, char *buf); + /* Write a line to server, adding newline, for chat, will go away */ -void CtdlIPC_chat_send(CtdlIPC* ipc, const char *buf); +void CtdlIPC_chat_send(CtdlIPC * ipc, const char *buf); struct ctdlipcroom { char RRname[ROOMNAMELEN]; /* Name of room */ - long RRunread; /* Number of unread messages */ - long RRtotal; /* Total number of messages in room */ - char RRinfoupdated; /* Nonzero if info was updated */ - unsigned RRflags; /* Various flags (see LKRN) */ - unsigned RRflags2; /* Various flags (see LKRN) */ - long RRhighest; /* Highest message number in room */ - long RRlastread; /* Highest message user has read */ - char RRismailbox; /* Is this room a mailbox room? */ - char RRaide; /* User can do aide commands in room */ - char RRfloor; /* Which floor this room is on */ - char RRcurrentview; /* The user's current view for this room */ - char RRdefaultview; /* The default view for this room */ + long RRunread; /* Number of unread messages */ + long RRtotal; /* Total number of messages in room */ + char RRinfoupdated; /* Nonzero if info was updated */ + unsigned RRflags; /* Various flags (see LKRN) */ + unsigned RRflags2; /* Various flags (see LKRN) */ + long RRhighest; /* Highest message number in room */ + long RRlastread; /* Highest message user has read */ + char RRismailbox; /* Is this room a mailbox room? */ + char RRaide; /* User can do aide commands in room */ + char RRfloor; /* Which floor this room is on */ + char RRcurrentview; /* The user's current view for this room */ + char RRdefaultview; /* The default view for this room */ }; struct parts { struct parts *next; - char number[16]; /* part number */ - char name[PATH_MAX]; /* Name */ + char number[16]; /* part number */ + char name[PATH_MAX]; /* Name */ char filename[PATH_MAX]; /* Suggested filename */ - char mimetype[SIZ]; /* MIME type */ - char disposition[SIZ]; /* Content disposition */ - unsigned long length; /* Content length */ + char mimetype[SIZ]; /* MIME type */ + char disposition[SIZ]; /* Content disposition */ + unsigned long length; /* Content length */ }; struct ctdlipcmessage { - char msgid[SIZ]; /* Original message ID */ - char path[SIZ]; /* Return path to sender */ - char zaps[SIZ]; /* Message ID that this supersedes */ - char subject[SIZ]; /* Message subject */ - char email[SIZ]; /* Email address of sender */ - char author[SIZ]; /* Sender of message */ - char recipient[SIZ]; /* Recipient of message */ - char room[SIZ]; /* Originating room */ + char msgid[SIZ]; /* Original message ID */ + char path[SIZ]; /* Return path to sender */ + char zaps[SIZ]; /* Message ID that this supersedes */ + char subject[SIZ]; /* Message subject */ + char email[SIZ]; /* Email address of sender */ + char author[SIZ]; /* Sender of message */ + char recipient[SIZ]; /* Recipient of message */ + char room[SIZ]; /* Originating room */ struct parts *attachments; /* Available attachments */ - char *text; /* Message text */ - int type; /* Message type */ - time_t time; /* Time message was posted */ - char nhdr; /* Suppress message header? */ - char anonymous; /* An anonymous message */ - char mime_chosen[SIZ]; /* Chosen MIME part to output */ - char content_type[SIZ]; /* How would you like that? */ - char references[SIZ]; /* Thread references */ - int is_local; /* Nonzero if the message originated on the local system */ + char *text; /* Message text */ + int type; /* Message type */ + time_t time; /* Time message was posted */ + char nhdr; /* Suppress message header? */ + char anonymous; /* An anonymous message */ + char mime_chosen[SIZ]; /* Chosen MIME part to output */ + char content_type[SIZ]; /* How would you like that? */ + char references[SIZ]; /* Thread references */ + int is_local; /* Nonzero if the message originated on the local system */ }; struct ctdlipcfile { char remote_name[PATH_MAX]; /* Filename on server */ char local_name[PATH_MAX]; /* Filename on client */ - char description[80]; /* Description on server */ - FILE *local_fd; /* Open file on client */ - size_t size; /* Size of file in octets */ - unsigned int upload:1; /* uploading? 0 if downloading */ + char description[80]; /* Description on server */ + FILE *local_fd; /* Open file on client */ + size_t size; /* Size of file in octets */ + unsigned int upload:1; /* uploading? 0 if downloading */ unsigned int complete:1; /* Transfer has finished? */ }; struct ctdlipcmisc { - long newmail; /* Number of new Mail messages */ - char needregis; /* Nonzero if user needs to register */ - char needvalid; /* Nonzero if users need validation */ + long newmail; /* Number of new Mail messages */ + char needregis; /* Nonzero if user needs to register */ + char needvalid; /* Nonzero if users need validation */ }; enum RoomList { @@ -369,128 +373,141 @@ extern char file_citadel_config[PATH_MAX]; #define DH_L 4096 #define CIT_CIPHERS "ALL:RC4+RSA:+SSLv2:+TLSv1:!MD5:@STRENGTH" /* see ciphers(1) */ -int CtdlIPCNoop(CtdlIPC *ipc); -int CtdlIPCEcho(CtdlIPC *ipc, const char *arg, char *cret); -int CtdlIPCQuit(CtdlIPC *ipc); -int CtdlIPCLogout(CtdlIPC *ipc); -int CtdlIPCTryLogin(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCTryPassword(CtdlIPC *ipc, const char *passwd, char *cret); -int CtdlIPCTryApopPassword(CtdlIPC *ipc, const char *response, char *cret); -int CtdlIPCCreateUser(CtdlIPC *ipc, const char *username, int selfservice, char *cret); -int CtdlIPCChangePassword(CtdlIPC *ipc, const char *passwd, char *cret); -int CtdlIPCKnownRooms(CtdlIPC *ipc, enum RoomList which, int floor, struct march **listing, char *cret); -int CtdlIPCGetConfig(CtdlIPC *ipc, struct ctdluser **uret, char *cret); -int CtdlIPCSetConfig(CtdlIPC *ipc, struct ctdluser *uret, char *cret); -int CtdlIPCGotoRoom(CtdlIPC *ipc, const char *room, const char *passwd, struct ctdlipcroom **rret, char *cret); -int CtdlIPCGetMessages(CtdlIPC *ipc, enum MessageList which, int whicharg, const char *mtemplate, unsigned long **mret, char *cret); -int CtdlIPCGetSingleMessage(CtdlIPC *ipc, long msgnum, int headers, int as_mime, struct ctdlipcmessage **mret, char *cret); -int CtdlIPCWhoKnowsRoom(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCServerInfo(CtdlIPC *ipc, char *cret); -int CtdlIPCReadDirectory(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCSetLastRead(CtdlIPC *ipc, long msgnum, char *cret); -int CtdlIPCInviteUserToRoom(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCKickoutUserFromRoom(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct ctdlroom **qret, char *cret); -int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct ctdlroom *qret, char *cret); -int CtdlIPCGetRoomAide(CtdlIPC *ipc, char *cret); -int CtdlIPCSetRoomAide(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCPostMessage(CtdlIPC *ipc, int flag, int *subject_required, struct ctdlipcmessage *mr, char *cret); -int CtdlIPCRoomInfo(CtdlIPC *ipc, char **iret, char *cret); -int CtdlIPCDeleteMessage(CtdlIPC *ipc, long msgnum, char *cret); -int CtdlIPCMoveMessage(CtdlIPC *ipc, int copy, long msgnum, const char *destroom, char *cret); -int CtdlIPCDeleteRoom(CtdlIPC *ipc, int for_real, char *cret); -int CtdlIPCCreateRoom(CtdlIPC *ipc, int for_real, const char *roomname, int type, const char *password, int floor, char *cret); -int CtdlIPCForgetRoom(CtdlIPC *ipc, char *cret); -int CtdlIPCSystemMessage(CtdlIPC *ipc, const char *message, char **mret, char *cret); -int CtdlIPCNextUnvalidatedUser(CtdlIPC *ipc, char *cret); -int CtdlIPCGetUserRegistration(CtdlIPC *ipc, const char *username, char **rret, char *cret); -int CtdlIPCValidateUser(CtdlIPC *ipc, const char *username, int axlevel, char *cret); -int CtdlIPCSetRoomInfo(CtdlIPC *ipc, int for_real, const char *info, char *cret); -int CtdlIPCUserListing(CtdlIPC *ipc, char *searchstring, char **list, char *cret); -int CtdlIPCSetRegistration(CtdlIPC *ipc, const char *info, char *cret); -int CtdlIPCMiscCheck(CtdlIPC *ipc, struct ctdlipcmisc *chek, char *cret); -int CtdlIPCDeleteFile(CtdlIPC *ipc, const char *filename, char *cret); -int CtdlIPCMoveFile(CtdlIPC *ipc, const char *filename, const char *destroom, char *cret); -int CtdlIPCNetSendFile(CtdlIPC *ipc, const char *filename, const char *destnode, char *cret); -int CtdlIPCOnlineUsers(CtdlIPC *ipc, char **listing, time_t *stamp, char *cret); -int CtdlIPCFileDownload(CtdlIPC *ipc, const char *filename, void **buf, size_t resume, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCAttachmentDownload(CtdlIPC *ipc, long msgnum, const char *part, void **buf, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCImageDownload(CtdlIPC *ipc, const char *filename, void **buf, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCFileUpload(CtdlIPC *ipc, const char *save_as, const char *comment, const char *path, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCImageUpload(CtdlIPC *ipc, int for_real, const char *path, const char *save_as, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCQueryUsername(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCFloorListing(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCCreateFloor(CtdlIPC *ipc, int for_real, const char *name, char *cret); -int CtdlIPCDeleteFloor(CtdlIPC *ipc, int for_real, int floornum, char *cret); -int CtdlIPCEditFloor(CtdlIPC *ipc, int floornum, const char *floorname, char *cret); -int CtdlIPCIdentifySoftware(CtdlIPC *ipc, int developerid, int clientid, int revision, const char *software_name, const char *hostname, char *cret); -int CtdlIPCSendInstantMessage(CtdlIPC *ipc, const char *username, const char *text, char *cret); -int CtdlIPCGetInstantMessage(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCEnableInstantMessageReceipt(CtdlIPC *ipc, int mode, char *cret); -int CtdlIPCSetBio(CtdlIPC *ipc, char *bio, char *cret); -int CtdlIPCGetBio(CtdlIPC *ipc, const char *username, char **listing, char *cret); -int CtdlIPCListUsersWithBios(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCStealthMode(CtdlIPC *ipc, int mode, char *cret); -int CtdlIPCTerminateSession(CtdlIPC *ipc, int sid, char *cret); -int CtdlIPCTerminateServerNow(CtdlIPC *ipc, char *cret); -int CtdlIPCTerminateServerScheduled(CtdlIPC *ipc, int mode, char *cret); -int CtdlIPCEnterSystemMessage(CtdlIPC *ipc, const char *filename, const char *text, char *cret); -time_t CtdlIPCServerTime(CtdlIPC *ipc, char *crert); -int CtdlIPCAideGetUserParameters(CtdlIPC *ipc, const char *who, struct ctdluser **uret, char *cret); -int CtdlIPCAideGetEmailAddresses(CtdlIPC *ipc, const char *who, char *, char *cret); -int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct ctdluser *uret, char *cret); -int CtdlIPCAideSetEmailAddresses(CtdlIPC *ipc, const char *who, char *emailaddrs, char *cret); -int CtdlIPCRenameUser(CtdlIPC *ipc, char *oldname, char *newname, char *cret); -int CtdlIPCGetMessageExpirationPolicy(CtdlIPC *ipc, GPEXWhichPolicy which, struct ExpirePolicy **policy, char *cret); -int CtdlIPCSetMessageExpirationPolicy(CtdlIPC *ipc, int which, struct ExpirePolicy *policy, char *cret); -int CtdlIPCGetSystemConfig(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCSetSystemConfig(CtdlIPC *ipc, const char *listing, char *cret); -int CtdlIPCGetSystemConfigByType(CtdlIPC *ipc, const char *mimetype, char **listing, char *cret); -int CtdlIPCSetSystemConfigByType(CtdlIPC *ipc, const char *mimetype, const char *listing, char *cret); -int CtdlIPCGetRoomNetworkConfig(CtdlIPC *ipc, char **listing, char *cret); -int CtdlIPCSetRoomNetworkConfig(CtdlIPC *ipc, const char *listing, char *cret); -int CtdlIPCRequestClientLogout(CtdlIPC *ipc, int session, char *cret); -int CtdlIPCSetMessageSeen(CtdlIPC *ipc, long msgnum, int seen, char *cret); -int CtdlIPCStartEncryption(CtdlIPC *ipc, char *cret); -int CtdlIPCDirectoryLookup(CtdlIPC *ipc, const char *address, char *cret); -int CtdlIPCSpecifyPreferredFormats(CtdlIPC *ipc, char *cret, char *formats); -int CtdlIPCInternalProgram(CtdlIPC *ipc, int secret, char *cret); +int CtdlIPCNoop(CtdlIPC * ipc); +int CtdlIPCEcho(CtdlIPC * ipc, const char *arg, char *cret); +int CtdlIPCQuit(CtdlIPC * ipc); +int CtdlIPCLogout(CtdlIPC * ipc); +int CtdlIPCTryLogin(CtdlIPC * ipc, const char *username, char *cret); +int CtdlIPCTryPassword(CtdlIPC * ipc, const char *passwd, char *cret); +int CtdlIPCTryApopPassword(CtdlIPC * ipc, const char *response, char *cret); +int CtdlIPCCreateUser(CtdlIPC * ipc, const char *username, int selfservice, char *cret); +int CtdlIPCChangePassword(CtdlIPC * ipc, const char *passwd, char *cret); +int CtdlIPCKnownRooms(CtdlIPC * ipc, enum RoomList which, int floor, struct march **listing, char *cret); +int CtdlIPCGetConfig(CtdlIPC * ipc, struct ctdluser **uret, char *cret); +int CtdlIPCSetConfig(CtdlIPC * ipc, struct ctdluser *uret, char *cret); +int CtdlIPCGotoRoom(CtdlIPC * ipc, const char *room, const char *passwd, struct ctdlipcroom **rret, char *cret); +int CtdlIPCGetMessages(CtdlIPC * ipc, enum MessageList which, int whicharg, const char *mtemplate, unsigned long **mret, + char *cret); +int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime, struct ctdlipcmessage **mret, char *cret); +int CtdlIPCWhoKnowsRoom(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCServerInfo(CtdlIPC * ipc, char *cret); +int CtdlIPCReadDirectory(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCSetLastRead(CtdlIPC * ipc, long msgnum, char *cret); +int CtdlIPCInviteUserToRoom(CtdlIPC * ipc, const char *username, char *cret); +int CtdlIPCKickoutUserFromRoom(CtdlIPC * ipc, const char *username, char *cret); +int CtdlIPCGetRoomAttributes(CtdlIPC * ipc, struct ctdlroom **qret, char *cret); +int CtdlIPCSetRoomAttributes(CtdlIPC * ipc, int forget, struct ctdlroom *qret, char *cret); +int CtdlIPCGetRoomAide(CtdlIPC * ipc, char *cret); +int CtdlIPCSetRoomAide(CtdlIPC * ipc, const char *username, char *cret); +int CtdlIPCPostMessage(CtdlIPC * ipc, int flag, int *subject_required, struct ctdlipcmessage *mr, char *cret); +int CtdlIPCRoomInfo(CtdlIPC * ipc, char **iret, char *cret); +int CtdlIPCDeleteMessage(CtdlIPC * ipc, long msgnum, char *cret); +int CtdlIPCMoveMessage(CtdlIPC * ipc, int copy, long msgnum, const char *destroom, char *cret); +int CtdlIPCDeleteRoom(CtdlIPC * ipc, int for_real, char *cret); +int CtdlIPCCreateRoom(CtdlIPC * ipc, int for_real, const char *roomname, int type, const char *password, int floor, char *cret); +int CtdlIPCForgetRoom(CtdlIPC * ipc, char *cret); +int CtdlIPCSystemMessage(CtdlIPC * ipc, const char *message, char **mret, char *cret); +int CtdlIPCNextUnvalidatedUser(CtdlIPC * ipc, char *cret); +int CtdlIPCGetUserRegistration(CtdlIPC * ipc, const char *username, char **rret, char *cret); +int CtdlIPCValidateUser(CtdlIPC * ipc, const char *username, int axlevel, char *cret); +int CtdlIPCSetRoomInfo(CtdlIPC * ipc, int for_real, const char *info, char *cret); +int CtdlIPCUserListing(CtdlIPC * ipc, char *searchstring, char **list, char *cret); +int CtdlIPCSetRegistration(CtdlIPC * ipc, const char *info, char *cret); +int CtdlIPCMiscCheck(CtdlIPC * ipc, struct ctdlipcmisc *chek, char *cret); +int CtdlIPCDeleteFile(CtdlIPC * ipc, const char *filename, char *cret); +int CtdlIPCMoveFile(CtdlIPC * ipc, const char *filename, const char *destroom, char *cret); +int CtdlIPCNetSendFile(CtdlIPC * ipc, const char *filename, const char *destnode, char *cret); +int CtdlIPCOnlineUsers(CtdlIPC * ipc, char **listing, time_t * stamp, char *cret); +int CtdlIPCFileDownload(CtdlIPC * ipc, const char *filename, void **buf, size_t resume, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCAttachmentDownload(CtdlIPC * ipc, long msgnum, const char *part, void **buf, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCImageDownload(CtdlIPC * ipc, const char *filename, void **buf, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCFileUpload(CtdlIPC * ipc, const char *save_as, const char *comment, const char *path, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCImageUpload(CtdlIPC * ipc, int for_real, const char *path, const char *save_as, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCQueryUsername(CtdlIPC * ipc, const char *username, char *cret); +int CtdlIPCFloorListing(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCCreateFloor(CtdlIPC * ipc, int for_real, const char *name, char *cret); +int CtdlIPCDeleteFloor(CtdlIPC * ipc, int for_real, int floornum, char *cret); +int CtdlIPCEditFloor(CtdlIPC * ipc, int floornum, const char *floorname, char *cret); +int CtdlIPCIdentifySoftware(CtdlIPC * ipc, int developerid, int clientid, int revision, const char *software_name, + const char *hostname, char *cret); +int CtdlIPCSendInstantMessage(CtdlIPC * ipc, const char *username, const char *text, char *cret); +int CtdlIPCGetInstantMessage(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCEnableInstantMessageReceipt(CtdlIPC * ipc, int mode, char *cret); +int CtdlIPCSetBio(CtdlIPC * ipc, char *bio, char *cret); +int CtdlIPCGetBio(CtdlIPC * ipc, const char *username, char **listing, char *cret); +int CtdlIPCListUsersWithBios(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCStealthMode(CtdlIPC * ipc, int mode, char *cret); +int CtdlIPCTerminateSession(CtdlIPC * ipc, int sid, char *cret); +int CtdlIPCTerminateServerNow(CtdlIPC * ipc, char *cret); +int CtdlIPCTerminateServerScheduled(CtdlIPC * ipc, int mode, char *cret); +int CtdlIPCEnterSystemMessage(CtdlIPC * ipc, const char *filename, const char *text, char *cret); +time_t CtdlIPCServerTime(CtdlIPC * ipc, char *crert); +int CtdlIPCAideGetUserParameters(CtdlIPC * ipc, const char *who, struct ctdluser **uret, char *cret); +int CtdlIPCAideGetEmailAddresses(CtdlIPC * ipc, const char *who, char *, char *cret); +int CtdlIPCAideSetUserParameters(CtdlIPC * ipc, const struct ctdluser *uret, char *cret); +int CtdlIPCAideSetEmailAddresses(CtdlIPC * ipc, const char *who, char *emailaddrs, char *cret); +int CtdlIPCRenameUser(CtdlIPC * ipc, char *oldname, char *newname, char *cret); +int CtdlIPCGetMessageExpirationPolicy(CtdlIPC * ipc, GPEXWhichPolicy which, struct ExpirePolicy **policy, char *cret); +int CtdlIPCSetMessageExpirationPolicy(CtdlIPC * ipc, int which, struct ExpirePolicy *policy, char *cret); +int CtdlIPCGetSystemConfig(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCSetSystemConfig(CtdlIPC * ipc, const char *listing, char *cret); +int CtdlIPCGetSystemConfigByType(CtdlIPC * ipc, const char *mimetype, char **listing, char *cret); +int CtdlIPCSetSystemConfigByType(CtdlIPC * ipc, const char *mimetype, const char *listing, char *cret); +int CtdlIPCGetRoomNetworkConfig(CtdlIPC * ipc, char **listing, char *cret); +int CtdlIPCSetRoomNetworkConfig(CtdlIPC * ipc, const char *listing, char *cret); +int CtdlIPCRequestClientLogout(CtdlIPC * ipc, int session, char *cret); +int CtdlIPCSetMessageSeen(CtdlIPC * ipc, long msgnum, int seen, char *cret); +int CtdlIPCStartEncryption(CtdlIPC * ipc, char *cret); +int CtdlIPCDirectoryLookup(CtdlIPC * ipc, const char *address, char *cret); +int CtdlIPCSpecifyPreferredFormats(CtdlIPC * ipc, char *cret, char *formats); +int CtdlIPCInternalProgram(CtdlIPC * ipc, int secret, char *cret); /* ************************************************************************** */ + /* Stuff below this line is not for public consumption */ + /* ************************************************************************** */ -char *CtdlIPCReadListing(CtdlIPC *ipc, char *dest); -int CtdlIPCSendListing(CtdlIPC *ipc, const char *listing); -size_t CtdlIPCPartialRead(CtdlIPC *ipc, void **buf, size_t offset, size_t bytes, char *cret); -int CtdlIPCEndUpload(CtdlIPC *ipc, int discard, char *cret); -int CtdlIPCWriteUpload(CtdlIPC *ipc, FILE *uploadFP, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCEndDownload(CtdlIPC *ipc, char *cret); -int CtdlIPCReadDownload(CtdlIPC *ipc, void **buf, size_t bytes, size_t resume, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCHighSpeedReadDownload(CtdlIPC *ipc, void **buf, size_t bytes, size_t resume, void (*progress_gauge_callback)(CtdlIPC*, unsigned long, unsigned long), char *cret); -int CtdlIPCGenericCommand(CtdlIPC *ipc, const char *command, const char *to_send, size_t bytes_to_send, char **to_receive, size_t *bytes_to_receive, char *proto_response); +char *CtdlIPCReadListing(CtdlIPC * ipc, char *dest); +int CtdlIPCSendListing(CtdlIPC * ipc, const char *listing); +size_t CtdlIPCPartialRead(CtdlIPC * ipc, void **buf, size_t offset, size_t bytes, char *cret); +int CtdlIPCEndUpload(CtdlIPC * ipc, int discard, char *cret); +int CtdlIPCWriteUpload(CtdlIPC * ipc, FILE * uploadFP, void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), + char *cret); +int CtdlIPCEndDownload(CtdlIPC * ipc, char *cret); +int CtdlIPCReadDownload(CtdlIPC * ipc, void **buf, size_t bytes, size_t resume, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCHighSpeedReadDownload(CtdlIPC * ipc, void **buf, size_t bytes, size_t resume, + void (*progress_gauge_callback)(CtdlIPC *, unsigned long, unsigned long), char *cret); +int CtdlIPCGenericCommand(CtdlIPC * ipc, const char *command, const char *to_send, size_t bytes_to_send, char **to_receive, + size_t *bytes_to_receive, char *proto_response); /* Internals */ -int starttls(CtdlIPC *ipc); +int starttls(CtdlIPC * ipc); void setCryptoStatusHook(void (*hook)(char *s)); -void CtdlIPC_SetNetworkStatusCallback(CtdlIPC *ipc, void (*hook)(int state)); +void CtdlIPC_SetNetworkStatusCallback(CtdlIPC * ipc, void (*hook)(int state)); extern int (*error_printf)(char *s, ...); void setIPCDeathHook(void (*hook)(void)); void setIPCErrorPrintf(int (*func)(char *s, ...)); -void connection_died(CtdlIPC* ipc, int using_ssl); -void CtdlIPC_lock(CtdlIPC *ipc); -void CtdlIPC_unlock(CtdlIPC *ipc); +void connection_died(CtdlIPC * ipc, int using_ssl); +void CtdlIPC_lock(CtdlIPC * ipc); +void CtdlIPC_unlock(CtdlIPC * ipc); char *libcitadelclient_version_string(void); -void chatmode(CtdlIPC *ipc); -void page_user(CtdlIPC *ipc); -void quiet_mode(CtdlIPC *ipc); -void stealth_mode(CtdlIPC *ipc); +void chatmode(CtdlIPC * ipc); +void page_user(CtdlIPC * ipc); +void quiet_mode(CtdlIPC * ipc); +void stealth_mode(CtdlIPC * ipc); extern char last_paged[]; void determine_pwfilename(char *pwfile, size_t n); -void get_stored_password( char *host, char *port, char *username, char *password); -void set_stored_password( char *host, char *port, char *username, char *password); -void offer_to_remember_password(CtdlIPC *ipc, char *host, char *port, char *username, char *password); +void get_stored_password(char *host, char *port, char *username, char *password); +void set_stored_password(char *host, char *port, char *username, char *password); +void offer_to_remember_password(CtdlIPC * ipc, char *host, char *port, char *username, char *password); void load_command_set(void); void stty_ctdl(int cmd); @@ -498,9 +515,9 @@ void newprompt(char *prompt, char *str, int len); void strprompt(char *prompt, char *str, int len); int boolprompt(char *prompt, int prev_val); int intprompt(char *prompt, int ival, int imin, int imax); -int fmout(int width, FILE *fpin, char *text, FILE *fpout, int subst); -int getcmd(CtdlIPC *ipc, char *argbuf); -void display_help(CtdlIPC *ipc, char *name); +int fmout(int width, FILE * fpin, char *text, FILE * fpout, int subst); +int getcmd(CtdlIPC * ipc, char *argbuf); +void display_help(CtdlIPC * ipc, char *name); void color(int colornum); void cls(int colornum); void send_ansi_detect(void); @@ -518,7 +535,7 @@ int checkpagin(int lp, unsigned int pagin, unsigned int height); char was_a_key_pressed(void); #ifdef __GNUC__ -void pprintf(const char *format, ...) __attribute__((__format__(__printf__,1,2))); +void pprintf(const char *format, ...) __attribute__((__format__(__printf__, 1, 2))); #else void pprintf(const char *format, ...); #endif @@ -530,52 +547,47 @@ extern char rc_gotmail_cmd[SIZ]; extern int lines_printed; extern int rc_remember_passwords; -#define MAXURLS 50 // Max embedded URL's per message (oooh, can we use our elastic array class here?) +#define MAXURLS 50 // Max embedded URL's per message (oooh, can we use our elastic array class here?) extern int num_urls; extern char urls[MAXURLS][SIZ]; int ka_system(char *shc); -int entmsg(CtdlIPC *ipc, int is_reply, int c, int masquerade); -void readmsgs(CtdlIPC *ipc, enum MessageList c, enum MessageDirection rdir, int q); -void edit_system_message(CtdlIPC *ipc, char *which_message); +int entmsg(CtdlIPC * ipc, int is_reply, int c, int masquerade); +void readmsgs(CtdlIPC * ipc, enum MessageList c, enum MessageDirection rdir, int q); +void edit_system_message(CtdlIPC * ipc, char *which_message); pid_t ka_wait(int *kstatus); -void list_urls(CtdlIPC *ipc); -int client_make_message(CtdlIPC *ipc, - char *filename, /* temporary file name */ +void list_urls(CtdlIPC * ipc); +int client_make_message(CtdlIPC * ipc, char *filename, /* temporary file name */ char *recipient, /* NULL if it's not mail */ - int anon_type, /* see MES_ types in header file */ - int format_type, - int mode, - char *subject, - int subject_required -); + int anon_type, /* see MES_ types in header file */ + int format_type, int mode, char *subject, int subject_required); void citedit(FILE *); -char *load_message_from_file(FILE *src); +char *load_message_from_file(FILE * src); int file_checksum(char *filename); -void listzrooms(CtdlIPC *ipc); -void readinfo(CtdlIPC *ipc); -void forget(CtdlIPC *ipc); -void entroom(CtdlIPC *ipc); -void killroom(CtdlIPC *ipc); -void invite(CtdlIPC *ipc); -void kickout(CtdlIPC *ipc); -void editthisroom(CtdlIPC *ipc); -void roomdir(CtdlIPC *ipc); -void download(CtdlIPC *ipc, int proto); -void ungoto(CtdlIPC *ipc); -void dotungoto(CtdlIPC *ipc, char *towhere); -void whoknows(CtdlIPC *ipc); -void enterinfo(CtdlIPC *ipc); -void knrooms(CtdlIPC *ipc, int kn_floor_mode); -void dotknown(CtdlIPC *ipc, int what, char *match); -void load_floorlist(CtdlIPC *ipc); -void create_floor(CtdlIPC *ipc); -void edit_floor(CtdlIPC *ipc); -void kill_floor(CtdlIPC *ipc); -void enter_bio(CtdlIPC *ipc); +void listzrooms(CtdlIPC * ipc); +void readinfo(CtdlIPC * ipc); +void forget(CtdlIPC * ipc); +void entroom(CtdlIPC * ipc); +void killroom(CtdlIPC * ipc); +void invite(CtdlIPC * ipc); +void kickout(CtdlIPC * ipc); +void editthisroom(CtdlIPC * ipc); +void roomdir(CtdlIPC * ipc); +void download(CtdlIPC * ipc, int proto); +void ungoto(CtdlIPC * ipc); +void dotungoto(CtdlIPC * ipc, char *towhere); +void whoknows(CtdlIPC * ipc); +void enterinfo(CtdlIPC * ipc); +void knrooms(CtdlIPC * ipc, int kn_floor_mode); +void dotknown(CtdlIPC * ipc, int what, char *match); +void load_floorlist(CtdlIPC * ipc); +void create_floor(CtdlIPC * ipc); +void edit_floor(CtdlIPC * ipc); +void kill_floor(CtdlIPC * ipc); +void enter_bio(CtdlIPC * ipc); int save_buffer(void *file, size_t filelen, const char *pathname); void destination_directory(char *dest, const char *supplied_filename); -void do_edit(CtdlIPC *ipc, char *desc, char *read_cmd, char *check_cmd, char *write_cmd); +void do_edit(CtdlIPC * ipc, char *desc, char *read_cmd, char *check_cmd, char *write_cmd); /* @@ -583,49 +595,49 @@ void do_edit(CtdlIPC *ipc, char *desc, char *read_cmd, char *check_cmd, char *wr * (oooh, a tree!) */ struct ctdlroomlisting { - struct ctdlroomlisting *lnext; + struct ctdlroomlisting *lnext; struct ctdlroomlisting *rnext; - char rlname[ROOMNAMELEN]; - unsigned rlflags; + char rlname[ROOMNAMELEN]; + unsigned rlflags; int rlfloor; - int rlorder; - }; + int rlorder; +}; enum { - LISTRMS_NEW_ONLY, - LISTRMS_OLD_ONLY, - LISTRMS_ALL + LISTRMS_NEW_ONLY, + LISTRMS_OLD_ONLY, + LISTRMS_ALL }; -void updatels(CtdlIPC *ipc); -void updatelsa(CtdlIPC *ipc); -void movefile(CtdlIPC *ipc); -void deletefile(CtdlIPC *ipc); -void netsendfile(CtdlIPC *ipc); -void entregis(CtdlIPC *ipc); +void updatels(CtdlIPC * ipc); +void updatelsa(CtdlIPC * ipc); +void movefile(CtdlIPC * ipc); +void deletefile(CtdlIPC * ipc); +void netsendfile(CtdlIPC * ipc); +void entregis(CtdlIPC * ipc); void subshell(void); -void upload(CtdlIPC *ipc, int c); -void cli_upload(CtdlIPC *ipc); -void validate(CtdlIPC *ipc); -void read_bio(CtdlIPC *ipc); -void cli_image_upload(CtdlIPC *ipc, char *keyname); +void upload(CtdlIPC * ipc, int c); +void cli_upload(CtdlIPC * ipc); +void validate(CtdlIPC * ipc); +void read_bio(CtdlIPC * ipc); +void cli_image_upload(CtdlIPC * ipc, char *keyname); int room_prompt(unsigned int qrflags); -int val_user(CtdlIPC *ipc, char *user, int do_validate); +int val_user(CtdlIPC * ipc, char *user, int do_validate); -void edituser(CtdlIPC *ipc, int cmd); +void edituser(CtdlIPC * ipc, int cmd); void interr(int errnum); int struncmp(char *lstr, char *rstr, int len); int pattern(char *search, char *patn); -void enter_config(CtdlIPC* ipc, int mode); -void locate_host(CtdlIPC* ipc, char *hbuf); -void misc_server_cmd(CtdlIPC *ipc, char *cmd); +void enter_config(CtdlIPC * ipc, int mode); +void locate_host(CtdlIPC * ipc, char *hbuf); +void misc_server_cmd(CtdlIPC * ipc, char *cmd); int nukedir(char *dirname); void strproc(char *string); void back(int spaces); -void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax); -int set_attr(CtdlIPC *ipc, unsigned int sval, char *prompt, unsigned int sbit, int backwards); +void progress(CtdlIPC * ipc, unsigned long curr, unsigned long cmax); +int set_attr(CtdlIPC * ipc, unsigned int sval, char *prompt, unsigned int sbit, int backwards); void screen_new(void); int scr_printf(char *fmt, ...); @@ -643,10 +655,10 @@ extern char status_line[]; extern void check_screen_dims(void); extern int screenwidth; extern int screenheight; -void do_internet_configuration(CtdlIPC *ipc); -void network_config_management(CtdlIPC *ipc, char *entrytype, char *comment); -void do_pop3client_configuration(CtdlIPC *ipc); -void do_rssclient_configuration(CtdlIPC *ipc); -void do_system_configuration(CtdlIPC *ipc); +void do_internet_configuration(CtdlIPC * ipc); +void network_config_management(CtdlIPC * ipc, char *entrytype, char *comment); +void do_pop3client_configuration(CtdlIPC * ipc); +void do_rssclient_configuration(CtdlIPC * ipc); +void do_system_configuration(CtdlIPC * ipc); extern char editor_path[PATH_MAX]; extern int enable_status_line; -- 2.39.2