Updated the boilerplate on each file
[citadel.git] / textclient / commands.c
index bdd2dc4e55041b96317734b3bf477ba720732b4c..864cee44d6ba0f82ef6d8ae6a4845b9d69fdd22d 100644 (file)
@@ -1,17 +1,15 @@
-/*
- * This file contains functions which implement parts of the
- * text-mode user interface.
- *
- * Copyright (c) 1987-2018 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// This file contains functions which implement parts of the
+// text-mode user interface.
+//
+// Copyright (c) 1987-2018 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, and/or
+// disclosure are subject to the GNU General Purpose License version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
 
 #include "textclient.h"
 
@@ -22,7 +20,8 @@ char *helpnames[] = {
        "intro",
        "mail",
        "network",
-       "software"
+       "software",
+       "summary"
 };
 
 char *helptexts[] = {
@@ -52,12 +51,13 @@ char *helptexts[] = {
            " Z         Zap (forget) room. (Removes the room from your list)\n"
            " + -       Goto next, previous room on current floor.\n"
            " > <       Goto next, previous floor.\n"
-           " *         Enter any locally installed 'doors'.\n"
            "   \n"
            " In addition, there are dot commands. You hit the . (dot), then press the\n"
            "first letter of each word of the command. As you hit the letters, the words\n"
            "pop onto your screen. Exceptions: after you hit .Help or .Goto, the remainder\n"
-           "of the command is a help file name or room name.\n" "    \n" "      *** USE  .<H>elp ?    for additional help *** \n",
+           "of the command is a help file name or room name.\n"
+           "    \n"
+           "      *** USE  .<H>elp ?    for additional help *** \n",
 
        "The following commands are available only to Admins.  A subset of these\n"
            "commands are available to room aides when they are currently in the room\n"
@@ -433,7 +433,6 @@ int next_lazy_cmd = 5;
 extern int screenwidth, screenheight;
 extern int termn8;
 extern CtdlIPC *ipc_for_signal_handlers;       /* KLUDGE cover your eyes */
-
 struct citcmd *cmdlist = NULL;
 
 
@@ -444,13 +443,10 @@ time_t AnsiDetect;                /* when did we send the detect code? */
 int enable_color = 0;          /* nonzero for ANSI color */
 
 
-
-
 /*
  * If an interesting key has been pressed, return its value, otherwise 0
  */
-char was_a_key_pressed(void)
-{
+char was_a_key_pressed(void) {
        fd_set rfds;
        struct timeval tv;
        int the_character;
@@ -470,21 +466,18 @@ char was_a_key_pressed(void)
                set_keepalives(KA_NO);
                the_character = inkey();
                set_keepalives(KA_YES);
-       } else {
+       }
+       else {
                the_character = 0;
        }
        return (the_character);
 }
 
 
-
-
-
 /*
  * print_instant()  -  print instant messages if there are any
  */
-void print_instant(void)
-{
+void print_instant(void) {
        char buf[1024];
        FILE *outpipe;
        time_t timestamp;
@@ -495,12 +488,14 @@ void print_instant(void)
        char *listing = NULL;
        int r;                  /* IPC result code */
 
-       if (instant_msgs == 0)
+       if (instant_msgs == 0) {
                return;
+       }
 
        if (rc_exp_beep) {
                ctdl_beep();
        }
+
        if (IsEmptyStr(rc_exp_cmd)) {
                color(BRIGHT_RED);
                scr_printf("\r---");
@@ -508,8 +503,9 @@ void print_instant(void)
 
        while (instant_msgs != 0) {
                r = CtdlIPCGetInstantMessage(ipc_for_signal_handlers, &listing, buf);
-               if (r / 100 != 1)
+               if (r / 100 != 1) {
                        return;
+               }
 
                instant_msgs = extract_int(buf, 0);
                timestamp = extract_long(buf, 1);
@@ -595,19 +591,16 @@ void print_instant(void)
 }
 
 
-void set_keepalives(int s)
-{
+void set_keepalives(int s) {
        keepalives_enabled = (char) s;
 }
 
+
 /* 
  * This loop handles the "keepalive" messages sent to the server when idling.
  */
-
 static time_t idlet = 0;
-static void really_do_keepalive(void)
-{
-
+static void really_do_keepalive(void) {
        time(&idlet);
 
        /* This may sometimes get called before we are actually connected
@@ -640,6 +633,7 @@ static void really_do_keepalive(void)
        }
 }
 
+
 /* I changed this from static to not because I need to call it from
  * screen.c, either that or make something in screen.c not static.
  * Fix it how you like. Why all the staticness? stu
@@ -661,7 +655,6 @@ void do_keepalive(void)
 }
 
 
-
 int inkey(void)
 {                              /* get a character from the keyboard, with   */
        int a;                  /* the watchdog timer in effect if necessary */