extern char floorlist[128][SIZ];
-void load_floorlist(CtdlIPC * ipc)
-{
+void load_floorlist(CtdlIPC * ipc) {
int a;
char buf[SIZ];
char *listing = NULL;
}
-void room_tree_list(struct ctdlroomlisting *rp)
-{
+void room_tree_list(struct ctdlroomlisting *rp) {
static int c = 0;
char rmname[ROOMNAMELEN];
int f;
}
if (f & QR_MAILBOX) {
color(BRIGHT_YELLOW);
- } else if (f & QR_PRIVATE) {
+ }
+ else if (f & QR_PRIVATE) {
color(BRIGHT_RED);
- } else {
+ }
+ else {
color(DIM_WHITE);
}
scr_printf("%s", rmname);
if (f & QR_DIRECTORY) {
scr_printf("] ");
- } else {
+ }
+ else {
scr_printf("> ");
}
c = c + strlen(rmname) + 3;
/*
* Room ordering stuff (compare first by floor, then by order)
*/
-int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2)
-{
+int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2) {
if ((r1 == NULL) && (r2 == NULL))
return (0);
if (r1 == NULL)
/*
* Common code for all room listings
*/
-static void listrms(struct march *listing, int new_only, int floor_only, unsigned int flags, char *match)
-{
+static void listrms(struct march *listing, int new_only, int floor_only, unsigned int flags, char *match) {
struct march *mptr;
struct ctdlroomlisting *rl = NULL;
struct ctdlroomlisting *rp;
rs = rl;
if (rl == NULL) {
rl = rp;
- } else {
+ }
+ else {
while (rp != NULL) {
if (rordercmp(rp, rs) < 0) {
if (rs->lnext == NULL) {
rs->lnext = rp;
rp = NULL;
- } else {
+ }
+ else {
rs = rs->lnext;
}
- } else {
+ }
+ else {
if (rs->rnext == NULL) {
rs->rnext = rp;
rp = NULL;
- } else {
+ }
+ else {
rs = rs->rnext;
}
}
}
-void list_other_floors(void)
-{
+void list_other_floors(void) {
int a, c;
c = 1;
* List known rooms. kn_floor_mode should be set to 0 for a 'flat' listing,
* 1 to list rooms on the current floor, or 2 to list rooms on all floors.
*/
-void knrooms(CtdlIPC * ipc, int kn_floor_mode)
-{
+void knrooms(CtdlIPC * ipc, int kn_floor_mode) {
int a;
struct march *listing = NULL;
struct march *mptr;
}
-void listzrooms(CtdlIPC * ipc)
-{ /* list public forgotten rooms */
+void listzrooms(CtdlIPC * ipc) { /* list public forgotten rooms */
struct march *listing = NULL;
struct march *mptr;
int r; /* IPC response code */
color(DIM_WHITE);
}
-void dotknown(CtdlIPC * ipc, int what, char *match)
-{ /* list rooms according to attribute */
+void dotknown(CtdlIPC * ipc, int what, char *match) { /* list rooms according to attribute */
struct march *listing = NULL;
struct march *mptr;
int r; /* IPC response code */
}
-int set_room_attr(CtdlIPC * ipc, unsigned int ibuf, char *prompt, unsigned int sbit)
-{
+int set_room_attr(CtdlIPC * ipc, unsigned int ibuf, char *prompt, unsigned int sbit) {
int a;
a = boolprompt(prompt, (ibuf & sbit));
* The supplied argument is the 'default' floor number.
* This function returns the selected floor number.
*/
-int select_floor(CtdlIPC * ipc, int rfloor)
-{
+int select_floor(CtdlIPC * ipc, int rfloor) {
int a, newfloor;
char floorstr[SIZ];
/*
* .<A>ide <E>dit room
*/
-void editthisroom(CtdlIPC * ipc)
-{
+void editthisroom(CtdlIPC * ipc) {
int rbump = 0;
char room_admin_name[USERNAME_SIZE];
char buf[SIZ];
r = CtdlIPCGetRoomAide(ipc, buf);
if (r / 100 == 2) {
strncpy(room_admin_name, buf, sizeof room_admin_name);
- } else {
+ }
+ else {
strcpy(room_admin_name, "");
}
if (IsEmptyStr(room_admin_name)) {
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);
if (IsEmptyStr(save_dir)) {
if (getenv("HOME") == NULL) {
strcpy(save_dir, ".");
- } else {
+ }
+ else {
sprintf(save_dir, "%s/Desktop", getenv("HOME"));
if (access(save_dir, W_OK) != 0) {
sprintf(save_dir, "%s", getenv("HOME"));
strcpy(save_dir, dest);
if (strrchr(save_dir, '/') != NULL) {
strcpy(strrchr(save_dir, '/'), "");
- } else {
+ }
+ else {
strcpy(save_dir, ".");
}
}
char tempname[PATH_MAX];
char transmit_cmd[SIZ];
FILE *tpipe = NULL;
+
/* int broken = 0;*/
int r;
int rv = 0;
/* FIXME: display internally instead */
snprintf(transmit_cmd, sizeof transmit_cmd,
"SHELL=/dev/null; export SHELL; TERM=dumb; export TERM; exec more -d <%s", tempname);
- } else if (proto == 1)
+ }
+ else if (proto == 1)
snprintf(transmit_cmd, sizeof transmit_cmd, "exec sx %s", tempname);
else if (proto == 3)
snprintf(transmit_cmd, sizeof transmit_cmd, "exec sb %s", tempname);
/*
* read directory of this room
*/
-void roomdir(CtdlIPC * ipc)
-{
+void roomdir(CtdlIPC * ipc) {
char flnm[256];
char flsz[32];
char comment[256];
/*
* add a user to a private room
*/
-void invite(CtdlIPC * ipc)
-{
+void invite(CtdlIPC * ipc) {
char username[USERNAME_SIZE];
char buf[SIZ];
/*
* kick a user out of a room
*/
-void kickout(CtdlIPC * ipc)
-{
+void kickout(CtdlIPC * ipc) {
char username[USERNAME_SIZE];
char buf[SIZ];
/*
* aide command: kill the current room
*/
-void killroom(CtdlIPC * ipc)
-{
+void killroom(CtdlIPC * ipc) {
char aaa[100];
int r;
dotgoto(ipc, "_BASEROOM_", 0, 0);
}
-void forget(CtdlIPC * ipc)
-{ /* forget the current room */
+void forget(CtdlIPC * ipc) { /* forget the current room */
char buf[SIZ];
scr_printf("Are you sure you want to forget this room? ");
/*
* create a new room
*/
-void entroom(CtdlIPC * ipc)
-{
+void entroom(CtdlIPC * ipc) {
char buf[SIZ];
char new_room_name[ROOMNAMELEN];
int new_room_type;
for (a = 0; !IsEmptyStr(&new_room_pass[a]); ++a)
if (new_room_pass[a] == '|')
new_room_pass[a] = '_';
- } else {
+ }
+ else {
strcpy(new_room_pass, "");
}
-void readinfo(CtdlIPC * ipc)
-{ /* read info file for current room */
+void readinfo(CtdlIPC * ipc) { /* read info file for current room */
char buf[SIZ];
char room_admin_name[64];
int r; /* IPC response code */
/*
* <W>ho knows room...
*/
-void whoknows(CtdlIPC * ipc)
-{
+void whoknows(CtdlIPC * ipc) {
char buf[256];
char *listing = NULL;
int r;
}
-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) {
FILE *fp;
char cmd[SIZ];
int b, cksum, editor_exit;
editor_pid = (-1);
scr_printf("Executed %s\n", editor_path);
stty_ctdl(0);
- } else {
+ }
+ else {
scr_printf("Entering %s. Press return twice when finished.\n", desc);
fp = fopen(temp, "r+");
citedit(fp);
}
-void enterinfo(CtdlIPC * ipc)
-{ /* edit info file for current room */
+void enterinfo(CtdlIPC * ipc) { /* edit info file for current room */
do_edit(ipc, "the Info file for this room", "RINF", "EINF 0", "EINF 1");
}
-void enter_bio(CtdlIPC * ipc)
-{
+void enter_bio(CtdlIPC * ipc) {
char cmd[SIZ];
snprintf(cmd, sizeof cmd, "RBIO %s", fullname);
do_edit(ipc, "your Bio", cmd, "NOOP", "EBIO");
/*
* create a new floor
*/
-void create_floor(CtdlIPC * ipc)
-{
+void create_floor(CtdlIPC * ipc) {
char buf[SIZ];
char newfloorname[SIZ];
int r; /* IPC response code */
r = CtdlIPCCreateFloor(ipc, 1, newfloorname, buf);
if (r / 100 == 2) {
scr_printf("Floor has been created.\n");
- } else {
+ }
+ else {
scr_printf("%s\n", buf);
}
/*
* edit the current floor
*/
-void edit_floor(CtdlIPC * ipc)
-{
+void edit_floor(CtdlIPC * ipc) {
char buf[SIZ];
struct ExpirePolicy *ep = NULL;
/*
* kill the current floor
*/
-void kill_floor(CtdlIPC * ipc)
-{
+void kill_floor(CtdlIPC * ipc) {
int floornum_to_delete, a;
char buf[SIZ];