home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MSGDP206.SZH / CONFIG.C < prev    next >
Text File  |  1991-01-23  |  20KB  |  737 lines

  1. /*
  2.  
  3. Title:  MsgEd
  4.  
  5. File:   config.c
  6.  
  7. Author: Jim Nutt
  8.  
  9. Copr:   released into the PUBLIC DOMAIN 30 Jul 1990 by jim nutt
  10.  
  11. Description:
  12.  
  13.     finds & reads config files, initializes everything
  14.  
  15. Support Files:
  16.  
  17.     msged.h
  18.  
  19. */
  20.  
  21. #define TEXTLEN 512
  22.  
  23. #define NDEBUG 1
  24. #define NOSPELL
  25.  
  26. #include "msged.h"
  27.  
  28. #if defined(__TURBOC__)
  29. #include <dir.h>
  30. #else
  31. #include <direct.h>
  32. #endif
  33.  
  34. void    _pascal e_assignkey(unsigned int key, char *label);
  35. void    _pascal r_assignkey(unsigned int key, char *label);
  36.  
  37. static void _pascal checkareas(char *cpath);
  38. static void _pascal set_colors(char *keyword,char *value);
  39. static FILE * _pascal fileopen(char *env, char *cpath);
  40. static void _pascal init(void);
  41. static void _pascal parsemail(char *keyword, char *value);
  42. static void _pascal parseconfig(FILE *fp);
  43. static unsigned int * _pascal parse_macro(char *macro);
  44.  
  45. char * _pascal striplwhite(char *s)
  46.  
  47. {
  48.     while (*s && isspace(*s))
  49.         s++;
  50.     return((*s) ? (s) : (NULL) );
  51. }
  52.  
  53. static FILE * _pascal fileopen(char *env,char *cfn)
  54.  
  55. {
  56.     FILE    *fp;
  57.     char    pathname[PATHLEN];
  58.     char    *ename;
  59.     char    *cpath;
  60.  
  61.     if (cfn == NULL)
  62.         return(NULL);
  63.  
  64.     if ((fp = fopen(cfn,"rt")) != NULL)
  65.         return(fp);
  66.  
  67.     ename = strtok(env,";");
  68.  
  69.     while (ename != NULL) {
  70.  
  71.         if ((cpath = getenv(ename)) == NULL)
  72.             break;
  73.  
  74.         strcpy(pathname, cpath);
  75.  
  76.         if (*(pathname + strlen(pathname) - 1) != '\\')
  77.             strcat(pathname,"\\");
  78.  
  79.         strcat(pathname,cfn);
  80.  
  81.         if ((fp = fopen(pathname,"rt")) != NULL)
  82.             return(fp);
  83.  
  84.         ename = strtok(NULL,";");
  85.     }
  86.  
  87.     return(NULL);
  88. }
  89.  
  90. static unsigned int * _pascal parse_macro(char *macro)
  91.  
  92. {
  93.     unsigned int *m;
  94.     unsigned int *t;
  95.     int l;
  96.     char tmp[5];
  97.  
  98.     t = m = (unsigned int *) calloc(strlen(macro) * 2,sizeof(int));
  99.  
  100.     if ((t == (void *) NULL) || (macro == NULL))
  101.         return(NULL);
  102.  
  103.     while (*macro) {
  104.         if (*macro == '^') {
  105.             *t++ = (unsigned int)(*(macro + 1) == '^')?'^':(toupper(*(macro + 1)) - 64);
  106.             macro += 2;
  107.         }
  108.         else if (*macro == '\\') {
  109.             if (*(macro + 1) == '\\') {
  110.                 *t++ = (unsigned int) '\\';
  111.                 macro += 2;
  112.             }
  113.             else {
  114.                 memset(tmp,0,sizeof tmp);
  115.                 strncpy(tmp,macro+1,4);
  116.                 *t++ = (unsigned int) strtol(tmp,NULL,0) << 8;
  117.                 macro += 5;
  118.             }
  119.         }
  120.         else
  121.             *t++ = (unsigned int) *macro++;
  122.     }
  123.  
  124.     *t = 0;
  125.  
  126.     l = (int) (t - m) + 1;
  127.  
  128.         t = realloc(m, l * sizeof (int));
  129.  
  130.     if (t)
  131.         return(t);
  132.  
  133.     return(m);
  134. }
  135.  
  136. static void _pascal checkareas(char *areafile)
  137.  
  138. {
  139.     FILE   *fp = NULL;
  140.     char    buffer[TEXTLEN];
  141.     char   *s = NULL;
  142.     int     flag = 1;
  143.  
  144.     if ((fp = fileopen("BINKLEY;OPUS;SEADOG;BBS;",areafile)) == NULL)
  145.         if ((fp = fileopen("BINKLEY;OPUS;SEADOG;BBS;","areas.bbs")) == NULL)
  146.             return;
  147.  
  148.     if (fp != NULL) {
  149.  
  150.         while (fgets(buffer, TEXTLEN, fp) != NULL) {
  151.             char *tag = NULL;
  152.             char *path = NULL;
  153.             int i = 0;
  154.  
  155.             if ((*buffer == '\r') || (*buffer == '\n'))
  156.                 continue;
  157.  
  158.             s = striplwhite(buffer);
  159.  
  160.             if (s == NULL)
  161.                 continue;
  162.  
  163.             if ((*s == ';') || (*s == '-') || (*s == '#'))
  164.                 continue;
  165.  
  166.             if ((strchr(buffer,'!')) && flag) {
  167.                 char *p = strrchr(buffer,'!');
  168.                 if (p != NULL) {
  169.                     *p = '\0';
  170.                     if (origin != NULL)
  171.                         free(origin);
  172.                                         origin = strdup(buffer);
  173.                 }
  174.                 flag = 0;
  175.                 continue;
  176.             }
  177.  
  178.             path = strtok(s," \t");
  179.             if (path) strlwr(path);
  180.             tag = strtok(NULL," \t\n");
  181.             if (tag) strlwr(tag);
  182.             flag = 0;
  183.  
  184.             for (;i < areas; i++)
  185.                 if ((arealist[i].path != NULL) &&
  186.                     (strcmp(path,arealist[i].path) == 0))
  187.                     break;
  188.  
  189.             if (i == areas) {
  190.                 areas++;
  191.                 area = areas - 1;
  192.                 arealist = handle_realloc(arealist, areas * sizeof(struct _area));
  193.  
  194.                 memset(&(arealist[area]),0,sizeof(struct _area));
  195.  
  196.                 arealist[area].echomail = 1;
  197.                 arealist[area].description = strdup(tag);
  198.                 arealist[area].tag = arealist[area].description;
  199.                 arealist[area].path = strdup(path);
  200.                 if (*(arealist[area].path + strlen(arealist[area].path) - 1) == '\\')
  201.                     *(arealist[area].path + strlen(arealist[area].path) - 1) = '\0';
  202.             }
  203.             else
  204.                 arealist[area].echomail = 1;
  205.         }
  206.     }
  207.  
  208.     if (fp != NULL)
  209.         fclose(fp);
  210. }
  211.  
  212. static void _pascal set_colors(char *keyword,char *value)
  213.  
  214. {
  215.     int     color = 0, i = 0;
  216.     char   *f = NULL,
  217.            *b = NULL;
  218.     static char *colors[] = {
  219.         "bla", "blu", "gre", "cya", "red", "mag", "yel", "whi"
  220.     };
  221.  
  222.     if (value) strlwr(value);
  223.     f = strtok(value,"/");
  224.     while (isspace(*f)) f++;
  225.     b = strtok(NULL,"\0");
  226.     while (isspace(*b)) b++;
  227.  
  228.     for (i = 0; (i < 8) && (strncmp(colors[i],f,3) != 0); i++)
  229.         /* empty loop */ ;
  230.     color = (i < 8)?i:0;
  231.     color |= (strchr(f,'+') != NULL)?8:0;
  232.  
  233.     for (i = 0; (i < 8) && (strncmp(colors[i],b,3) != 0); i++)
  234.         /* empty loop */ ;
  235.     color |= (i < 8)?i<<4:0;
  236.     color |= (strchr(b,'+') != NULL)?0x80:0;
  237.  
  238.     co_normal = (strncmp("normal", keyword,6))?co_normal:(unsigned char) color;
  239.     co_quote = (strncmp("quote", keyword,9))?co_quote:(unsigned char) color;
  240.     co_warn = (strncmp("warn", keyword,4))?co_warn:(unsigned char) color;
  241.     co_block = (strncmp("block", keyword,5))?co_block:(unsigned char) color;
  242.     co_info = (strncmp("info", keyword,4))?co_info:(unsigned char) color;
  243.     co_hilite = (strncmp("hilite", keyword,6))?co_hilite:(unsigned char) color;
  244. }
  245.  
  246. static void _pascal init()
  247.  
  248. {
  249.     memset(macros,0,sizeof(macros));
  250.     comspec = getenv("COMSPEC");
  251. #ifndef NOSPELL
  252.     speller = strdup("speller.com");
  253. #endif
  254.     outfile = strdup("prn");
  255.     quotestr = strdup(">");
  256.     attribline = strdup("In a message of <%^m %^d %^h>, %^f (%^a) writes:\n");
  257.     confmail = strdup("confmail.out");
  258.     lastread = strdup("lastread");
  259.     cfgfile = strdup("msged.cfg");
  260.     uucp_gate.notfound = 1;
  261. #ifdef __OS2__
  262.     videomethod = FOSSIL;
  263. #else
  264.     videomethod = BIOS;
  265. #endif
  266. }
  267.  
  268. static void _pascal parsemail(char *keyword, char *value)
  269.  
  270. {
  271.     char *s = value;
  272.     char *e = NULL;
  273.     AREA *t;
  274.     AREA a;
  275.  
  276.     check(username);
  277.     memset(&a,0,sizeof a);
  278.  
  279.     switch (tolower(*keyword)) { /* one letter is enough for now */
  280.         default  :
  281.         case 'f' : a.msgtype = FIDO; break;
  282.         case 'q' : a.msgtype = QUICK; break;
  283.     }
  284.  
  285.     while (*s && isspace(*s)) s++;
  286.     if (!*s) return;
  287.  
  288.     switch (tolower(*s)) { /* one letter is enough */
  289.         case 'n' : a.news = 1; break;
  290.         case 'u' : a.uucp = 1; break;
  291.         case 'm' : a.netmail = 1; break;
  292.         case 'e' : a.echomail = 1; break;
  293.         case 'l' :
  294.         default  : a.local = 1; break;
  295.     }
  296.  
  297.     while (*s && !isspace(*s)) s++;  /* skip the rest */
  298.     while (*s && isspace(*s)) s++;
  299.     if (!*s) return;
  300.  
  301.     if (*s != '\"') {
  302.         while (*s && !isspace(*s)) {
  303.             switch (tolower(*s)) {
  304.                 case 'p' : a.priv = 1; break;
  305.                 case 'h' : a.hold = 1; break;
  306.                 case 'd' : a.direct = 1; break;
  307.                 case 'c' : a.crash = 1; break;
  308.                 case 'k' : a.killsent = 1; break;
  309.                 case  0  : return;
  310.             }
  311.             s++;
  312.         }
  313.         while (*s && isspace(*s)) s++;
  314.         if (!*s) return;
  315.     }
  316.  
  317.     if ((e = strchr(++s,'\"')) == NULL) return;
  318.     *e++ = '\0';
  319.     a.description = strdup(s);
  320.     s = e;
  321.  
  322.     while (*s && isspace(*s)) s++;
  323.     if (!*s) {
  324.         free(a.description);
  325.         return;
  326.     }
  327.  
  328.     if ((e = strchr(s,' ')) == NULL)
  329.         e = strchr(s,'\t');
  330.  
  331.     if (e == NULL)
  332.         e = s;
  333.     else
  334.         *e++ = '\0';
  335.  
  336.     while (*s && isspace(*s)) s++;
  337.     if (!*s) {
  338.         free(a.description);
  339.         return;
  340.     }
  341.  
  342.     switch (a.msgtype) {
  343.         default :
  344.         case FIDO  : a.path = strdup(strlwr(s)); break;
  345.         case QUICK : a.board = atoi(s); break;
  346.     }
  347.  
  348.     if (a.echomail) {
  349.         s = e;
  350.         while (*s && isspace(*s)) s++;
  351.         if (s && *s)
  352.             a.tag = strdup(s);
  353.         else
  354.             a.tag = NULL;
  355.     }
  356.  
  357.     for (area = 0; area < areas; area++) {
  358.         /* this is a sneaky use of the ternary operator */
  359.  
  360.         if (((a.msgtype == QUICK) && (arealist[area].msgtype == QUICK))?
  361.             (a.board == arealist[area].board):
  362.             (strcmp(a.path,arealist[area].path)==0)) {
  363.                 arealist[area].priv |= a.priv;
  364.                 arealist[area].hold |= a.hold;
  365.                 arealist[area].direct |= a.direct;
  366.                 arealist[area].crash |= a.crash;
  367.                 arealist[area].killsent |= a.killsent;
  368.                 arealist[area].news |= a.news;
  369.                 arealist[area].echomail |= a.echomail;
  370.                 arealist[area].uucp |= a.uucp;
  371.                 arealist[area].netmail |= a.netmail;
  372.                 arealist[area].local |= a.local;
  373.  
  374.                 if (arealist[area].description == NULL)
  375.                     arealist[area].description = a.description;
  376.                 else if (a.description)
  377.                     free(a.description);
  378.  
  379.                 if (arealist[area].tag == NULL)
  380.                     arealist[area].tag = a.tag;
  381.                 else if (a.tag)
  382.                     free(a.tag);
  383.  
  384.                 if ((a.msgtype == FIDO) && (a.path))
  385.                     free(a.path);
  386.  
  387.                 return;
  388.         }
  389.     }
  390.  
  391.     areas++;
  392.     area = areas - 1;
  393.  
  394.     check(username);
  395.  
  396.     if (arealist == NULL)
  397.         arealist = handle_malloc(areas * sizeof(struct _area));
  398.     else {
  399.         check(username);
  400.         arealist = handle_realloc(arealist, areas * sizeof(struct _area));
  401.         check(username);
  402.     }
  403.  
  404.     check(username);
  405.  
  406.     if (arealist == NULL)
  407.         outamemory();
  408.  
  409.     check(username);
  410.     checkp(arealist);
  411.     t = arealist + area;
  412.     checkp(t);
  413.     checkp(arealist);
  414.     check(username);
  415.     *t = a;
  416.     checkp(t);
  417.     check(username);
  418. }
  419.  
  420. static void _pascal parseconfig(FILE *fp)
  421.  
  422. {
  423.     char    buffer[TEXTLEN];
  424.     char   *keyword = NULL;
  425.     char   *value = NULL;
  426.     char   *s = NULL;
  427.  
  428.     memset(buffer, 0, TEXTLEN);
  429.  
  430.     while (!feof(fp)) {
  431.  
  432.         if (fgets(buffer, TEXTLEN, fp) == NULL)
  433.             return;
  434.  
  435.         keyword = strtok(buffer, " \t\n\r");
  436.         if (keyword) strlwr(keyword); else continue;
  437.         if ((*keyword) == ';')
  438.             continue;
  439.  
  440.         value = strtok(NULL, ";\n\r");
  441.  
  442.         if (value != NULL) {
  443.             s = value + strlen(value) - 1;
  444.             while ((s > value) && isspace(*s))
  445.                 *s-- = '\0';
  446.         }
  447.  
  448.         while (value && *value && isspace(*value))
  449.             if ((*value == '\n') || (*value == ';'))
  450.                 break;
  451.             else
  452.                 value++;
  453.  
  454.         if (strcmp("attribution", keyword) == 0) {
  455.             free(attribline);
  456.             if (value)
  457.                 attribline = strdup(value);
  458.             else
  459.                 attribline = NULL;
  460.             continue;
  461.         }
  462.  
  463.         if (!value) continue;
  464.  
  465.         if (strcmp("name",keyword) == 0) {
  466.             check(value);
  467.             username = strdup(value);
  468.             check(username);
  469.         }
  470.  
  471.         else if (strcmp("include", keyword) == 0) {
  472.             FILE *ifp;
  473.             if ((ifp = fopen(value,"rt")) != NULL) {
  474.                 parseconfig(ifp);
  475.                 fclose(ifp);
  476.             }
  477.         }
  478.  
  479.         else if (strcmp("outfile", keyword) == 0) {
  480.             free(outfile);
  481.             outfile = strdup(value);
  482.         }
  483.  
  484.         else if (strcmp("uucp", keyword) == 0) {
  485.             uucp_gate = parsenode(value);
  486.             uucp_gate.notfound = 0;
  487.         }
  488.  
  489.         else if (strcmp("lastread", keyword) == 0) {
  490.             free(lastread);
  491.             lastread = strdup(value);
  492.         }
  493.  
  494.         else if (strcmp("tosslog", keyword) == 0) {
  495.             free(confmail);
  496.             confmail = strdup(value);
  497.         }
  498. #ifndef NOSPELL
  499.         else if (strcmp("speller", keyword) == 0) {
  500.             free(speller);
  501.             speller = strdup(value);
  502.         }
  503. #endif
  504.  
  505.         else if (strcmp("quickbbs", keyword) == 0) {
  506.             int i;
  507.             if (quickbbs != NULL)
  508.                 free(quickbbs);
  509.             quickbbs = strdup(value);
  510.             i = strlen(quickbbs);
  511.             if ((*(quickbbs + i - 1) != '\\') &&
  512.                 (*(quickbbs + i - 1) != '/')) {
  513.                 char *s = calloc(1,i+2);
  514.                 strcat(strcpy(s,quickbbs),"/");
  515.                 free(quickbbs);
  516.                 quickbbs = strdup(s);
  517.                 free(s);
  518.             }
  519.         }
  520.  
  521.         else if (strcmp("video",keyword) == 0) {
  522.             if (value) strlwr(value);
  523.             if (strncmp(value,"direct",6) == 0)
  524.                 videomethod = DIRECT;
  525.             else if (strncmp(value,"bios",4) == 0)
  526.                 videomethod = BIOS;
  527.             else if (strncmp(value,"fossil",6) == 0)
  528.                 videomethod = FOSSIL;
  529.             else if (strncmp(value,"ansi",4) == 0)
  530.                 videomethod = ANSI;
  531.         }
  532.  
  533.         else if (strcmp("gate",keyword) == 0) {
  534.             if (gate == 7)
  535.                 gate = 0;
  536.             if (value) strlwr(value);
  537.             if (strncmp(value,"zones",5) == 0)
  538.                 gate |= GZONES;
  539.             else if (strncmp(value,"domains",7) == 0)
  540.                 gate |= GDOMAINS;
  541.             else if (strncmp(value,"both",4) == 0)
  542.                 gate = GDOMAINS | GZONES;
  543.             else if (strncmp(value,"none",4) == 0)
  544.                 gate = 0;
  545.         }
  546.  
  547.         else if (strcmp("function",keyword) == 0) {
  548.             int i;
  549.             char *s;
  550.  
  551.             i = (int) strtol(value,&s,0);
  552.             s = striplwhite(s);
  553.  
  554.             if ((i >= 0) && (i <= 40) && (s != NULL))
  555.                 macros[i] = parse_macro(s);
  556.         }
  557.  
  558.         else if (strcmp("userlist", keyword) == 0) {
  559.             fidolist = strdup(strtok(value,",\n"));
  560.             if ((userlist = strtok(NULL,",\n")) != NULL)
  561.                 userlist = strdup(userlist);
  562.         }
  563.  
  564.         else if (strcmp("address", keyword) == 0) {
  565.             if (alias == NULL) {
  566.                 alias = (ADDRESS *) calloc(1, sizeof(ADDRESS));
  567.                 aliascount = 1;
  568.             }
  569.             else
  570.                 alias = (ADDRESS *) realloc(alias,++aliascount * sizeof(ADDRESS));
  571.             alias[aliascount - 1] = parsenode(value);
  572.         }
  573.  
  574.         else if (strcmp("videoseg", keyword) == 0)
  575.             vbase = (int) strtol(value,NULL,0);
  576.  
  577.         else if (strcmp("privatenet", keyword) == 0)
  578.             pointnet = (int) strtol(value,NULL,0);
  579.  
  580.         else if (strcmp("maxx", keyword) == 0)
  581.             maxx = (int) strtol(value,NULL,0);
  582.  
  583.         else if (strcmp("maxy", keyword) == 0)
  584.             maxy = (int) strtol(value,NULL,0);
  585.  
  586.         else if (strcmp("tabsize", keyword) == 0)
  587.             tabsize = (int) strtol(value,NULL,0);
  588.  
  589.         else if (strcmp("right", keyword) == 0)
  590.             rm = (int) strtol(value,NULL,0);
  591.  
  592.         else if (strcmp("quoteright", keyword) == 0)
  593.             qm = (int) strtol(value,NULL,0);
  594.  
  595.         else if (strcmp("no",keyword) == 0) {
  596.             if (value) strlwr(value);
  597.             softcr ^=        (strcmp("softcr", value) == 0);
  598.             seenbys ^=       (strcmp("seen-bys", value) == 0);
  599.             tearline ^=      (strcmp("tearline", value) == 0);
  600.             shownotes ^=     (strcmp("shownotes", value) == 0);
  601.             confirmations ^= (strcmp("confirm", value) == 0);
  602.             msgids ^=        (strcmp("msgids",value) == 0);
  603.             stripnotes ^=    (strcmp("strip",value) == 0);
  604.             opusdate ^=      (strcmp("opusdate",value) == 0);
  605.             swapping ^= (strcmp("swapping",value) == 0);
  606.         }
  607.  
  608.         else if (!(strcmp("editkey", keyword))||!(strcmp("readkey",keyword))) { /*WRA*/
  609.             int scancode;
  610.  
  611.             if (value) {
  612.                 strlwr(value);
  613.                 scancode = (int) strtol(value,&value,0);
  614.                 value = striplwhite(value);
  615.             }
  616.             if (*keyword == 'e')
  617.                 e_assignkey(scancode,value);
  618.             else
  619.                 r_assignkey(scancode,value);
  620.         }
  621.  
  622.         else if (strcmp("quote", keyword) == 0) {
  623.             char *s;
  624.             if (quotestr != NULL)
  625.                 free(quotestr);
  626.             s = quotestr = strdup(value);
  627.             while (*s) {
  628.                 *s = (*s == (char) '_')?(char)' ':*s;
  629.                 s++;
  630.             }
  631.         }
  632.  
  633.         else if (strcmp("origin", keyword) == 0) {
  634.             if (origin != NULL)
  635.                 free(origin);
  636.             origin = strdup(value);
  637.         }
  638.  
  639.         else if ((strcmp("quick", keyword) == 0) ||
  640.              (strcmp("fido", keyword) == 0)) {
  641.             parsemail(keyword,value);
  642.         }
  643.  
  644.         else if (strcmp("color", keyword) == 0) {
  645.             keyword = strtok(value," \t");
  646.             value   = strtok(NULL,"\0");
  647.             set_colors(keyword,value);
  648.         }
  649.  
  650.         memset(buffer, 0, TEXTLEN);
  651.     }
  652. }
  653.  
  654. void _pascal opening(char *cfgfile, char *areafile)
  655. {
  656.     FILE   *fp = NULL;
  657.     int     count = 0,i;
  658.     char    tmp[PATHLEN];
  659.  
  660.     init();
  661.  
  662.     video_init();
  663.  
  664.     /* start looking for the config file... */
  665.  
  666.     if ((fp = fileopen("BINKLEY;OPUS;SEADOG;BBS;",cfgfile)) == NULL)
  667.         if ((fp = fileopen("BINKLEY;OPUS;SEADOG;BBS","msged.cfg")) == NULL)
  668.             settings();
  669.  
  670.     if (fp) {
  671.         parseconfig(fp);
  672.         if (videomethod != BIOS)
  673.             video_init();
  674.     }
  675.  
  676.     if (opusdate)
  677.         fidozone = NO;
  678.  
  679.     for (i = 0; i < 40; i++)
  680.         count += (macros[i] != (void *) NULL)?1:0;
  681.  
  682.     if (fp != NULL)
  683.         fclose(fp);
  684.  
  685.     rm = (rm > maxx)?maxx:rm;
  686.     qm = (qm > rm)?rm - 5 - strlen(quotestr):qm;
  687.  
  688.     co_quote = (co_quote)?co_quote:co_normal;
  689.  
  690.     checkareas(areafile);
  691.  
  692.     set_color(co_normal);
  693.     cls();
  694.     gotoxy(6, 9);
  695.     set_color(co_hilite);
  696.     bputs("msged FTS Compatible Mail Editor");
  697.     set_color(co_normal);
  698.     gotoxy(6, 11);
  699.     bputs("version " VERSION " PUBLIC DOMAIN by Jim Nutt");
  700.     gotoxy(6,13);
  701.     bprintf("%d by %d ",maxx,maxy);
  702.     bputs((videomethod==DIRECT)?"direct video":(videomethod==BIOS)?"bios video":(videomethod==ANSI)?"ansi video":"fossil video");
  703.  
  704.     gotoxy(6, 15);
  705.     bprintf("%s at %s", username, show_address(thisnode));
  706.  
  707.     if (aliascount > 1)
  708.         bprintf(" (primary)");
  709.  
  710.     if (thisnode.point)
  711.         bprintf(" (private net %d/%d)", pointnet,
  712.             thisnode.point);
  713.  
  714.     if (origin != NULL) {
  715.         gotoxy(6,16);
  716.         bputs(origin);
  717.         gotoxy(6,18);
  718.     }
  719.     else
  720.         gotoxy(6,17);
  721.  
  722.     bprintf("%d message areas found", areas);
  723.     gotoxy(6,wherey() + 1);
  724.     bprintf("%d macros defined",count);
  725.     getcwd(tmp,PATHLEN);
  726.     if (tmp) strlwr(tmp);
  727.     home = strdup(tmp);
  728.     gotoxy(6,wherey() + 2);
  729.     bprintf("home directory is %s",home);
  730.  
  731.     if (arealist == NULL) {
  732.         puts("Oops! at least one message area must be defined.");
  733.         puts("Exiting...");
  734.         exit(0);
  735.     }
  736. }
  737.