More stoopid ANSI colour additions
authorArt Cancro <ajc@citadel.org>
Sun, 1 Nov 1998 01:49:19 +0000 (01:49 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 1 Nov 1998 01:49:19 +0000 (01:49 +0000)
citadel/ChangeLog
citadel/Makefile.in
citadel/commands.c
citadel/database.c
citadel/messages.c
citadel/serv_upgrade.c

index 2234e33e84617d0846a1f0da457397156acd378d..c3495adf83731a555ef74a543a09e8f5c5933329 100644 (file)
@@ -1,3 +1,6 @@
+Sat Oct 31 20:48:44 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * More stoopid ANSI colour additions
+
 1998-10-31 Nathan Bryant <bryant@cs.usm.maine.edu>
        * citadel.c, commands.c, commands.h: set background color to black
          before clearing screen, so that we can actually see text on
index dc622f4f9270431431b0635dcf5fcca9b7745a7a..cffd1ca4d0e8e2afc73ab578c00d6b805b2cd4ee 100644 (file)
@@ -18,7 +18,7 @@ all: $(TARGETS)
 
 CLIENT_TARGETS=citadel whobbs
 SERVER_TARGETS=citserver setup
-SERV_MODULES=modules/serv_chat.so modules/serv_test.so
+SERV_MODULES=modules/serv_chat.so modules/serv_test.so modules/serv_upgrade.so
 UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
        readlog rcit stats citmail netpoll mailinglist userlist
 PROXY_TARGETS=proxy
@@ -107,6 +107,9 @@ modules/serv_chat.so: serv_chat.mo
 modules/serv_test.so: serv_test.mo
        $(CC) -shared -o modules/serv_test.so serv_test.mo
 
+modules/serv_upgrade.so: serv_upgrade.mo
+       $(CC) -shared -o modules/serv_upgrade.so serv_upgrade.mo
+
 aidepost: aidepost.o config.o
        $(CC) aidepost.o config.o $(LDFLAGS) -o aidepost
 
index 6af5de5ed67dbae408a2e572c6bcb07d64f2e5d1..c04bf35de61ff257bc65e5e5fcc5df855cf3f01a 100644 (file)
@@ -855,7 +855,8 @@ void color(int colornum)
 {
 #ifdef ANSI_COLOR
        if (enable_color) {
-               printf("\033[3%dm\033[1m", colornum);
+               printf("\033[3%dm", colornum);
+               /* printf("\033[1m"); */ /* uncomment for bold colours */
                fflush(stdout);
                }
 #endif
index 0e6c08b277fa0a369e90791f2a6e8b78b9b5ffe3..b7127fca5dcacfabc1ed84f4d0fa2bf9b8552fb3 100644 (file)
@@ -134,7 +134,8 @@ void close_databases(void) {
 
        /* Hmm... we should decide when would be a good time to defrag.
         * Server shutdowns might be an opportune time.
-       defrag_databases(); */
+        */
+       defrag_databases();
 
        for (a=0; a<MAXCDB; ++a) {
                lprintf(7, "Closing database %d\n", a);
index a3c6326bdc94f636c9d882322aa3a5b4bc360be0..dac55a3f9d1ac5e97b6c8612e996219d7170e822 100644 (file)
@@ -385,25 +385,32 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                if (!struncmp(buf,"type=",5))
                        format_type=atoi(&buf[5]);
                if ((!struncmp(buf,"msgn=",5))&&(rc_display_message_numbers)) {
+                       color(1);
                        printf("[#%s] ",&buf[5]);
                        }
                if (!struncmp(buf,"from=",5)) {
+                       color(3);
                        printf("from %s ",&buf[5]);
                        }
                if (!struncmp(buf,"subj=",5))
                        strcpy(m_subject,&buf[5]);
                if ((!struncmp(buf,"hnod=",5)) 
-                  && (strucmp(&buf[5],serv_info.serv_humannode)))
+                  && (strucmp(&buf[5],serv_info.serv_humannode))) {
+                       color(6);
                        printf("(%s) ",&buf[5]);
+                       }
                if ((!struncmp(buf,"room=",5))
-                  && (strucmp(&buf[5],room_name)))
+                  && (strucmp(&buf[5],room_name))) {
+                       color(4);
                        printf("in %s> ",&buf[5]);
+                       }
 
                if (!struncmp(buf,"node=",5)) {
                        if ( (room_flags&QR_NETWORK)
                           || ((strucmp(&buf[5],serv_info.serv_nodename)
                           &&(strucmp(&buf[5],serv_info.serv_fqdn)))))
                                {
+                               color(5);
                                printf("@%s ",&buf[5]);
                                }
                        if ((!strucmp(&buf[5],serv_info.serv_nodename))
@@ -416,13 +423,16 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                                }
                        }
 
-               if (!struncmp(buf,"rcpt=",5))
+               if (!struncmp(buf,"rcpt=",5)) {
+                       color(3);
                        printf("to %s ",&buf[5]);
+                       }
                if (!struncmp(buf,"time=",5)) {
                        now=atol(&buf[5]);
                        tm=(struct tm *)localtime(&now);
                        strcpy(buf,asctime(tm)); buf[strlen(buf)-1]=0;
                        strcpy(&buf[16],&buf[19]);
+                       color(6);
                        printf("%s ",&buf[4]);
                        }
                }
index c076875efca17a0b8d47c389ade74f3600c51bff..f803611867982663f6523d060650985dad30f2ea 100644 (file)
@@ -452,11 +452,6 @@ void import_databases() {
 void do_import(char *argbuf) {
        char import_filename[PATH_MAX];
        
-
-       if (num_parms(argbuf) != 1) {
-               cprintf("%d usage: IMPO unpacked_filename\n", ERROR);
-               return;
-               }
        extract(import_filename, argbuf, 0);
        imfp = fopen(import_filename, "rb");
        if (imfp == NULL) {