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