Annotation of sbbs/src/sbbs3/scfg/scfgnet.c, revision 1.1.1.2

1.1.1.2 ! root        1: /* scfgnet.c */
        !             2: 
        !             3: /* $Id: scfgnet.c,v 1.25 2010/03/12 08:39:14 rswindell Exp $ */
        !             4: 
        !             5: /****************************************************************************
        !             6:  * @format.tab-size 4          (Plain Text/Source Code File Header)                    *
        !             7:  * @format.use-tabs true       (see http://www.synchro.net/ptsc_hdr.html)              *
        !             8:  *                                                                                                                                                     *
        !             9:  * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html         *
        !            10:  *                                                                                                                                                     *
        !            11:  * This program is free software; you can redistribute it and/or                       *
        !            12:  * modify it under the terms of the GNU General Public License                         *
        !            13:  * as published by the Free Software Foundation; either version 2                      *
        !            14:  * of the License, or (at your option) any later version.                                      *
        !            15:  * See the GNU General Public License for more details: gpl.txt or                     *
        !            16:  * http://www.fsf.org/copyleft/gpl.html                                                                                *
        !            17:  *                                                                                                                                                     *
        !            18:  * Anonymous FTP access to the most recent released source is available at     *
        !            19:  * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net     *
        !            20:  *                                                                                                                                                     *
        !            21:  * Anonymous CVS access to the development source and modification history     *
        !            22:  * is available at cvs.synchro.net:/cvsroot/sbbs, example:                                     *
        !            23:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs login                       *
        !            24:  *     (just hit return, no password is necessary)                                                     *
        !            25:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src                *
        !            26:  *                                                                                                                                                     *
        !            27:  * For Synchronet coding style and modification guidelines, see                                *
        !            28:  * http://www.synchro.net/source.html                                                                          *
        !            29:  *                                                                                                                                                     *
        !            30:  * You are encouraged to submit any modifications (preferably in Unix diff     *
        !            31:  * format) via e-mail to [email protected]                                                                      *
        !            32:  *                                                                                                                                                     *
        !            33:  * Note: If this box doesn't appear square, then you need to fix your tabs.    *
        !            34:  ****************************************************************************/
        !            35: 
        !            36: #include "scfg.h"
        !            37: 
        !            38: void qhub_edit(int num);
        !            39: void phub_edit(int num);
        !            40: char *daystr(char days);
        !            41: void qhub_sub_edit(uint num);
        !            42: /****************************************************************************/
        !            43: /* Returns the FidoNet address kept in str as ASCII.                        */
        !            44: /****************************************************************************/
        !            45: faddr_t atofaddr(char *str)
        !            46: {
        !            47:     char *p;
        !            48:     faddr_t addr;
        !            49: 
        !            50:        addr.zone=addr.net=addr.node=addr.point=0;
        !            51:        if((p=strchr(str,':'))!=NULL) {
        !            52:                addr.zone=atoi(str);
        !            53:                addr.net=atoi(p+1); 
        !            54:        }
        !            55:        else {
        !            56:                if(cfg.total_faddrs)
        !            57:                        addr.zone=cfg.faddr[0].zone;
        !            58:                else
        !            59:                        addr.zone=1;
        !            60:                addr.net=atoi(str); 
        !            61:        }
        !            62:        if(!addr.zone)              /* no such thing as zone 0 */
        !            63:                addr.zone=1;
        !            64:        if((p=strchr(str,'/'))!=NULL)
        !            65:                addr.node=atoi(p+1);
        !            66:        else {
        !            67:                if(cfg.total_faddrs)
        !            68:                        addr.net=cfg.faddr[0].net;
        !            69:                else
        !            70:                        addr.net=1;
        !            71:                addr.node=atoi(str); 
        !            72:        }
        !            73:        if((p=strchr(str,'.'))!=NULL)
        !            74:                addr.point=atoi(p+1);
        !            75:        return(addr);
        !            76: }
        !            77: 
        !            78: uint getsub(void)
        !            79: {
        !            80:        static int grp_dflt,sub_dflt,grp_bar,sub_bar;
        !            81:        char str[81];
        !            82:        int i,j,k;
        !            83:        uint subnum[MAX_OPTS+1];
        !            84: 
        !            85:        while(1) {
        !            86:                for(i=0;i<cfg.total_grps && i<MAX_OPTS;i++)
        !            87:                        sprintf(opt[i],"%-25s",cfg.grp[i]->lname);
        !            88:                opt[i][0]=0;
        !            89:                i=uifc.list(WIN_SAV|WIN_RHT|WIN_BOT,0,0,45,&grp_dflt,&grp_bar
        !            90:                        ,"Message Groups"
        !            91:                        ,opt);
        !            92:                if(i==-1)
        !            93:                        return(-1);
        !            94:                for(j=k=0;j<cfg.total_subs && k<MAX_OPTS;j++)
        !            95:                        if(cfg.sub[j]->grp==i) {
        !            96:                                sprintf(opt[k],"%-25s",cfg.sub[j]->lname);
        !            97:                                subnum[k++]=j; 
        !            98:                        }
        !            99:                opt[k][0]=0;
        !           100:                sprintf(str,"%s Sub-boards",cfg.grp[i]->sname);
        !           101:                j=uifc.list(WIN_RHT|WIN_BOT|WIN_SAV,0,0,45,&sub_dflt,&sub_bar,str,opt);
        !           102:                if(j==-1)
        !           103:                        continue;
        !           104:                return(subnum[j]); 
        !           105:        }
        !           106: }
        !           107: 
        !           108: void net_cfg()
        !           109: {
        !           110:        static  int net_dflt,qnet_dflt,pnet_dflt,fnet_dflt,inet_dflt
        !           111:                        ,qhub_dflt,phub_dflt;
        !           112:        char    str[81],done;
        !           113:        int     i,j,k,l;
        !           114: 
        !           115: while(1) {
        !           116:        i=0;
        !           117:        strcpy(opt[i++],"Internet E-mail");
        !           118:        strcpy(opt[i++],"QWK Packet Networks");
        !           119:        strcpy(opt[i++],"FidoNet EchoMail and NetMail");
        !           120:        strcpy(opt[i++],"PostLink Networks");
        !           121:        opt[i][0]=0;
        !           122:        SETHELP(WHERE);
        !           123: /*
        !           124: `Configure Networks:`
        !           125: 
        !           126: This is the network configuration menu. Select the type of network
        !           127: technology that you want to configure.
        !           128: */
        !           129:        i=uifc.list(WIN_ORG|WIN_ACT|WIN_CHE,0,0,0,&net_dflt,0,"Networks",opt);
        !           130:        if(i==1) {      /* QWK net stuff */
        !           131:                done=0;
        !           132:                while(!done) {
        !           133:                        i=0;
        !           134:                        strcpy(opt[i++],"Network Hubs...");
        !           135:                        strcpy(opt[i++],"Default Tagline");
        !           136:                        opt[i][0]=0;
        !           137:                        SETHELP(WHERE);
        !           138: /*
        !           139: `QWK Packet Networks:`
        !           140: 
        !           141: From this menu you can configure the default tagline to use for
        !           142: outgoing messages on QWK networked sub-boards, or you can select
        !           143: `Network Hubs...` to add, delete, or configure QWK hubs that your system
        !           144: calls to exchange packets with.
        !           145: */
        !           146:                        i=uifc.list(WIN_ACT|WIN_RHT|WIN_BOT|WIN_CHE,0,0,0,&qnet_dflt,0
        !           147:                                ,"QWK Packet Networks",opt);
        !           148:                        switch(i) {
        !           149:                                case -1:        /* ESC */
        !           150:                                        done=1;
        !           151:                                        break;
        !           152:                                case 1:
        !           153:                                        SETHELP(WHERE);
        !           154: /*
        !           155: `QWK Network Default Tagline:`
        !           156: 
        !           157: This is the default tagline to use for outgoing messages on QWK
        !           158: networked sub-boards. This default can be overridden on a per sub-board
        !           159: basis with the sub-board configuration `Network Options...`.
        !           160: */
        !           161:                                        uifc.input(WIN_MID|WIN_SAV,0,0,nulstr
        !           162:                                                ,cfg.qnet_tagline,sizeof(cfg.qnet_tagline)-1,K_MSG|K_EDIT);
        !           163:                                        break;
        !           164:                                case 0:
        !           165:                                        while(1) {
        !           166:                                                for(i=0;i<cfg.total_qhubs && i<MAX_OPTS;i++)
        !           167:                                                        sprintf(opt[i],"%-8.8s",cfg.qhub[i]->id);
        !           168:                                                opt[i][0]=0;
        !           169:                                                i=WIN_ACT|WIN_RHT|WIN_SAV;
        !           170:                                                if(cfg.total_qhubs<MAX_OPTS)
        !           171:                                                        i|=WIN_INS|WIN_INSACT|WIN_XTR;
        !           172:                                                if(cfg.total_qhubs)
        !           173:                                                        i|=WIN_DEL;
        !           174:                                                SETHELP(WHERE);
        !           175: /*
        !           176: `QWK Network Hubs:`
        !           177: 
        !           178: This is a list of QWK network hubs that your system calls to exchange
        !           179: packets with.
        !           180: 
        !           181: To add a hub, select the desired location with the arrow keys and hit
        !           182: ~ INS ~.
        !           183: 
        !           184: To delete a hub, select it and hit ~ DEL ~.
        !           185: 
        !           186: To configure a hub, select it and hit ~ ENTER ~.
        !           187: */
        !           188:                                                i=uifc.list(i,0,0,0,&qhub_dflt,0
        !           189:                                                        ,"QWK Network Hubs",opt);
        !           190:                                                if(i==-1)
        !           191:                                                        break;
        !           192:                                                if((i&MSK_ON)==MSK_INS) {
        !           193:                                                        i&=MSK_OFF;
        !           194:                                                        if((cfg.qhub=(qhub_t **)realloc(cfg.qhub
        !           195:                                 ,sizeof(qhub_t *)*(cfg.total_qhubs+1)))==NULL) {
        !           196:                                 errormsg(WHERE,ERR_ALLOC,nulstr
        !           197:                                     ,sizeof(qhub_t *)*(cfg.total_qhubs+1));
        !           198:                                                                cfg.total_qhubs=0;
        !           199:                                                                bail(1);
        !           200:                                 continue; 
        !           201:                                                        }
        !           202: 
        !           203:                                                        SETHELP(WHERE);
        !           204: /*
        !           205: `QWK Network Hub System ID:`
        !           206: 
        !           207: This is the QWK System ID of this hub. It is used for incoming and
        !           208: outgoing network packets and must be accurate.
        !           209: */
        !           210:                                                        if(uifc.input(WIN_MID|WIN_SAV,0,0
        !           211:                                                                ,"System ID",str,LEN_QWKID,K_UPPER)<1)
        !           212:                                                                continue;
        !           213: 
        !           214:                                                        for(j=cfg.total_qhubs;j>i;j--)
        !           215:                                 cfg.qhub[j]=cfg.qhub[j-1];
        !           216:                                                        if((cfg.qhub[i]=(qhub_t *)malloc(sizeof(qhub_t)))
        !           217:                                                                ==NULL) {
        !           218:                                                                errormsg(WHERE,ERR_ALLOC,nulstr
        !           219:                                                                        ,sizeof(qhub_t));
        !           220:                                                                continue; 
        !           221:                                                        }
        !           222:                                                        memset(cfg.qhub[i],0,sizeof(qhub_t));
        !           223:                                                        strcpy(cfg.qhub[i]->id,str);
        !           224:                                                        strcpy(cfg.qhub[i]->pack,"%@zip -jD %f %s");
        !           225:                                                        strcpy(cfg.qhub[i]->unpack,"%@unzip -Coj %f %s -d %g");
        !           226:                                                        strcpy(cfg.qhub[i]->call,"*qnet-ftp VERT vert.synchro.net YOURPASS");
        !           227:                                                        cfg.qhub[i]->node=1;
        !           228:                                                        cfg.qhub[i]->days=(uchar)0xff; /* all days */
        !           229:                                                        cfg.total_qhubs++;
        !           230:                                                        uifc.changes=1;
        !           231:                                                        continue; 
        !           232:                                                }
        !           233:                                                if((i&MSK_ON)==MSK_DEL) {
        !           234:                                                        i&=MSK_OFF;
        !           235:                                                        free(cfg.qhub[i]->mode);
        !           236:                                                        free(cfg.qhub[i]->conf);
        !           237:                                                        free(cfg.qhub[i]->sub);
        !           238:                                                        free(cfg.qhub[i]);
        !           239:                                                        cfg.total_qhubs--;
        !           240:                                                        while(i<cfg.total_qhubs) {
        !           241:                                                                cfg.qhub[i]=cfg.qhub[i+1];
        !           242:                                                                i++; 
        !           243:                                                        }
        !           244:                                                        uifc.changes=1;
        !           245:                                                        continue; 
        !           246:                                                }
        !           247:                                                qhub_edit(i); 
        !           248:                                        }
        !           249:                                        break; 
        !           250:                        } 
        !           251:                } 
        !           252:        }
        !           253: 
        !           254:        else if(i==2) {         /* FidoNet Stuff */
        !           255:                done=0;
        !           256:                while(!done) {
        !           257:                        i=0;
        !           258:                        sprintf(opt[i++],"%-27.27s%s"
        !           259:                                ,"System Addresses",cfg.total_faddrs
        !           260:                        ? smb_faddrtoa(&cfg.faddr[0],tmp) : nulstr);
        !           261:                        sprintf(opt[i++],"%-27.27s%s"
        !           262:                                ,"Default Outbound Address"
        !           263:                                ,cfg.dflt_faddr.zone
        !           264:                        ? smb_faddrtoa(&cfg.dflt_faddr,tmp) : "No");
        !           265:                        sprintf(opt[i++],"%-27.27s"
        !           266:                                ,"Default Origin Line");
        !           267:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           268:                                ,"NetMail Semaphore",cfg.netmail_sem);
        !           269:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           270:                                ,"EchoMail Semaphore",cfg.echomail_sem);
        !           271:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           272:                                ,"Inbound File Directory",cfg.fidofile_dir);
        !           273:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           274:                                ,"EchoMail Base Directory",cfg.echomail_dir);
        !           275:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           276:                                ,"NetMail Directory",cfg.netmail_dir);
        !           277:                        sprintf(opt[i++],"%-27.27s%s"
        !           278:                                ,"Allow Sending of NetMail"
        !           279:                                ,cfg.netmail_misc&NMAIL_ALLOW ? "Yes":"No");
        !           280:                        sprintf(opt[i++],"%-27.27s%s"
        !           281:                                ,"Allow File Attachments"
        !           282:                                ,cfg.netmail_misc&NMAIL_FILE ? "Yes":"No");
        !           283:                        sprintf(opt[i++],"%-27.27s%s"
        !           284:                                ,"Send NetMail Using Alias"
        !           285:                                ,cfg.netmail_misc&NMAIL_ALIAS ? "Yes":"No");
        !           286:                        sprintf(opt[i++],"%-27.27s%s"
        !           287:                                ,"NetMail Defaults to Crash"
        !           288:                                ,cfg.netmail_misc&NMAIL_CRASH ? "Yes":"No");
        !           289:                        sprintf(opt[i++],"%-27.27s%s"
        !           290:                                ,"NetMail Defaults to Direct"
        !           291:                                ,cfg.netmail_misc&NMAIL_DIRECT ? "Yes":"No");
        !           292:                        sprintf(opt[i++],"%-27.27s%s"
        !           293:                                ,"NetMail Defaults to Hold"
        !           294:                                ,cfg.netmail_misc&NMAIL_HOLD ? "Yes":"No");
        !           295:                        sprintf(opt[i++],"%-27.27s%s"
        !           296:                                ,"Kill NetMail After Sent"
        !           297:                                ,cfg.netmail_misc&NMAIL_KILL ? "Yes":"No");
        !           298:                        sprintf(opt[i++],"%-27.27s%lu"
        !           299:                                ,"Cost to Send NetMail",cfg.netmail_cost);
        !           300:                        opt[i][0]=0;
        !           301:                        SETHELP(WHERE);
        !           302: /*
        !           303: `FidoNet EchoMail and NetMail:`
        !           304: 
        !           305: This menu contains configuration options that pertain specifically to
        !           306: networking E-mail (NetMail) and sub-boards (EchoMail) through networks
        !           307: using FidoNet technology.
        !           308: */
        !           309:                        i=uifc.list(WIN_ACT|WIN_MID|WIN_CHE,0,0,60,&fnet_dflt,0
        !           310:                                ,"FidoNet EchoMail and NetMail",opt);
        !           311:                        switch(i) {
        !           312:                                case -1:        /* ESC */
        !           313:                                        done=1;
        !           314:                                        break;
        !           315:                                case 0:
        !           316:                                        SETHELP(WHERE);
        !           317: /*
        !           318: `System FidoNet Addresses:`
        !           319: 
        !           320: This is the FidoNet address of this system used to receive NetMail.
        !           321: The Main address is also used as the default address for sub-boards.
        !           322: Format: `Zone:Net/Node[.Point]`
        !           323: */
        !           324:                                        k=l=0;
        !           325:                                        while(1) {
        !           326:                                                for(i=0;i<cfg.total_faddrs && i<MAX_OPTS;i++) {
        !           327:                                                        if(i==0)
        !           328:                                                                strcpy(str,"Main");
        !           329:                                                        else
        !           330:                                                                sprintf(str,"AKA %u",i);
        !           331:                                                        sprintf(opt[i],"%-8.8s %-16s"
        !           332:                                                                ,str,smb_faddrtoa(&cfg.faddr[i],tmp)); 
        !           333:                                                }
        !           334:                                                opt[i][0]=0;
        !           335:                                                j=WIN_RHT|WIN_SAV|WIN_ACT|WIN_INSACT;
        !           336:                                                if(cfg.total_faddrs<MAX_OPTS)
        !           337:                                                        j|=WIN_INS|WIN_XTR;
        !           338:                                                if(cfg.total_faddrs)
        !           339:                                                        j|=WIN_DEL;
        !           340:                                                i=uifc.list(j,0,0,0,&k,&l
        !           341:                                                        ,"System Addresses",opt);
        !           342:                                                if(i==-1)
        !           343:                                                        break;
        !           344:                                                if((i&MSK_ON)==MSK_INS) {
        !           345:                                                        i&=MSK_OFF;
        !           346: 
        !           347:                                                        if(!cfg.total_faddrs)
        !           348:                                                                strcpy(str,"1:1/0");
        !           349:                                                        else
        !           350:                                                                smb_faddrtoa(&cfg.faddr[0],str);
        !           351:                                                        if(!uifc.input(WIN_MID|WIN_SAV,0,0,"Address"
        !           352:                                                                ,str,25,K_EDIT|K_UPPER))
        !           353:                                                                continue;
        !           354: 
        !           355:                                                        if((cfg.faddr=(faddr_t *)realloc(cfg.faddr
        !           356:                                 ,sizeof(faddr_t)*(cfg.total_faddrs+1)))==NULL) {
        !           357:                                 errormsg(WHERE,ERR_ALLOC,nulstr
        !           358:                                     ,sizeof(faddr_t)*cfg.total_faddrs+1);
        !           359:                                                                cfg.total_faddrs=0;
        !           360:                                                                bail(1);
        !           361:                                 continue; 
        !           362:                                                        }
        !           363: 
        !           364:                                                        for(j=cfg.total_faddrs;j>i;j--)
        !           365:                                 cfg.faddr[j]=cfg.faddr[j-1];
        !           366: 
        !           367:                                                        cfg.faddr[i]=atofaddr(str);
        !           368:                                                        cfg.total_faddrs++;
        !           369:                                                        uifc.changes=1;
        !           370:                                                        continue; 
        !           371:                                                }
        !           372:                                                if((i&MSK_ON)==MSK_DEL) {
        !           373:                                                        i&=MSK_OFF;
        !           374:                                                        cfg.total_faddrs--;
        !           375:                                                        while(i<cfg.total_faddrs) {
        !           376:                                                                cfg.faddr[i]=cfg.faddr[i+1];
        !           377:                                                                i++; 
        !           378:                                                        }
        !           379:                                                        uifc.changes=1;
        !           380:                                                        continue; 
        !           381:                                                }
        !           382:                                                smb_faddrtoa(&cfg.faddr[i],str);
        !           383:                                                uifc.input(WIN_MID|WIN_SAV,0,0,"Address"
        !           384:                                                        ,str,25,K_EDIT);
        !           385:                                                cfg.faddr[i]=atofaddr(str); 
        !           386:                                        }
        !           387:                     break;
        !           388:                                case 1:
        !           389:                                        i=0;
        !           390:                                        SETHELP(WHERE);
        !           391: /*
        !           392: `Use Default Outbound NetMail Address:`
        !           393: 
        !           394: If you would like to have a default FidoNet address adding to outbound
        !           395: NetMail mail messages that do not have an address specified, select
        !           396: `Yes`.
        !           397: */
        !           398:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           399:                                                ,"Use Default Outbound NetMail Address",uifcYesNoOpts);
        !           400:                                        if(i==1) {
        !           401:                                                if(cfg.dflt_faddr.zone)
        !           402:                                                        uifc.changes=1;
        !           403:                                                cfg.dflt_faddr.zone=0;
        !           404:                                                break; 
        !           405:                                        }
        !           406:                                        if(i==-1)
        !           407:                                                break;
        !           408:                                        if(!cfg.dflt_faddr.zone) {
        !           409:                                                cfg.dflt_faddr.zone=1;
        !           410:                                                uifc.changes=1; 
        !           411:                                        }
        !           412:                                        smb_faddrtoa(&cfg.dflt_faddr,str);
        !           413:                                        SETHELP(WHERE);
        !           414: /*
        !           415: `Default Outbound FidoNet NetMail Address:`
        !           416: 
        !           417: If you would like to automatically add a FidoNet address to outbound
        !           418: NetMail that does not have an address specified, set this option
        !           419: to that address. This is useful for Fido/UUCP gateway mail.
        !           420: Format: `Zone:Net/Node[.Point]`
        !           421: */
        !           422:                                        if(uifc.input(WIN_MID|WIN_SAV,0,0,"Outbound Address"
        !           423:                                                ,str,25,K_EDIT)) {
        !           424:                                                cfg.dflt_faddr=atofaddr(str);
        !           425:                                                uifc.changes=1; 
        !           426:                                        }
        !           427:                     break;
        !           428:                                case 2:
        !           429:                                        SETHELP(WHERE);
        !           430: /*
        !           431: `Default Origin Line:`
        !           432: 
        !           433: This is the default origin line used for sub-boards networked via
        !           434: EchoMail. This origin line can be overridden on a per sub-board basis
        !           435: with the sub-board configuration `Network Options...`.
        !           436: */
        !           437:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"* Origin"
        !           438:                                                ,cfg.origline,sizeof(cfg.origline)-1,K_EDIT);
        !           439:                     break;
        !           440:                                case 3:
        !           441:                                        SETHELP(WHERE);
        !           442: /*
        !           443: `NetMail Semaphore File:`
        !           444: 
        !           445: This is a filename that will be used as a semaphore (signal) to your
        !           446: FidoNet front-end that new NetMail has been created and the messages
        !           447: should be re-scanned.
        !           448: */
        !           449:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"NetMail Semaphore"
        !           450:                                                ,cfg.netmail_sem,sizeof(cfg.netmail_sem)-1,K_EDIT);
        !           451:                     break;
        !           452:                                case 4:
        !           453:                                        SETHELP(WHERE);
        !           454: /*
        !           455: `EchoMail Semaphore File:`
        !           456: 
        !           457: This is a filename that will be used as a semaphore (signal) to your
        !           458: FidoNet front-end that new EchoMail has been created and the messages
        !           459: should be re-scanned.
        !           460: */
        !           461:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"EchoMail Semaphore"
        !           462:                                                ,cfg.echomail_sem,sizeof(cfg.echomail_sem)-1,K_EDIT);
        !           463:                     break;
        !           464:                                case 5:
        !           465:                                        SETHELP(WHERE);
        !           466: /*
        !           467: `Inbound File Directory:`
        !           468: 
        !           469: This directory is where inbound files are placed. This directory is
        !           470: only used when an incoming message has a file attached.
        !           471: */
        !           472:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"Inbound Files"
        !           473:                                                ,cfg.fidofile_dir,sizeof(cfg.fidofile_dir)-1,K_EDIT);
        !           474:                     break;
        !           475:                                case 6:
        !           476:                                        SETHELP(WHERE);
        !           477: /*
        !           478: `EchoMail Base Directory:`
        !           479: 
        !           480: This is an optional field used as a base directory for the location
        !           481: of EchoMail messages for sub-boards that do not have a specified
        !           482: `EchoMail Storage Directory`. If a sub-board does not have a specified
        !           483: storage directory for EchoMail, its messages will be imported from and
        !           484: exported to a sub-directory off of this base directory. The name of the
        !           485: sub-directory is the same as the internal code for the sub-directory.
        !           486: 
        !           487: If all EchoMail sub-boards have specified EchoMail storage directories,
        !           488: this option is not used at all.
        !           489: */
        !           490:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"EchoMail Base"
        !           491:                                                ,cfg.echomail_dir,sizeof(cfg.echomail_dir)-1,K_EDIT);
        !           492:                     break;
        !           493:                                case 7:
        !           494:                                        SETHELP(WHERE);
        !           495: /*
        !           496: `NetMail Directory:`
        !           497: 
        !           498: This is the directory where NetMail will be imported from and exported
        !           499: to.
        !           500: */
        !           501:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"NetMail"
        !           502:                                                ,cfg.netmail_dir,sizeof(cfg.netmail_dir)-1,K_EDIT);
        !           503:                     break;
        !           504:                                case 8:
        !           505:                                        i=0;
        !           506:                                        SETHELP(WHERE);
        !           507: /*
        !           508: `Allow Users to Send NetMail:`
        !           509: 
        !           510: If you are on a FidoNet style network and want your users to be allowed
        !           511: to send NetMail, set this option to `Yes`.
        !           512: */
        !           513:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           514:                                                ,"Allow Users to Send NetMail",uifcYesNoOpts);
        !           515:                                        if(!i && !(cfg.netmail_misc&NMAIL_ALLOW)) {
        !           516:                                                uifc.changes=1;
        !           517:                                                cfg.netmail_misc|=NMAIL_ALLOW; 
        !           518:                                        }
        !           519:                                        else if(i==1 && cfg.netmail_misc&NMAIL_ALLOW) {
        !           520:                                                uifc.changes=1;
        !           521:                                                cfg.netmail_misc&=~NMAIL_ALLOW; 
        !           522:                                        }
        !           523:                                        break;
        !           524:                                case 9:
        !           525:                                        i=0;
        !           526:                                        SETHELP(WHERE);
        !           527: /*
        !           528: `Allow Users to Send NetMail File Attachments:`
        !           529: 
        !           530: If you are on a FidoNet style network and want your users to be allowed
        !           531: to send NetMail file attachments, set this option to `Yes`.
        !           532: */
        !           533:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           534:                                                ,"Allow Users to Send NetMail File Attachments",uifcYesNoOpts);
        !           535:                                        if(!i && !(cfg.netmail_misc&NMAIL_FILE)) {
        !           536:                                                uifc.changes=1;
        !           537:                                                cfg.netmail_misc|=NMAIL_FILE; 
        !           538:                                        }
        !           539:                                        else if(i==1 && cfg.netmail_misc&NMAIL_FILE) {
        !           540:                                                uifc.changes=1;
        !           541:                                                cfg.netmail_misc&=~NMAIL_FILE; 
        !           542:                                        }
        !           543:                     break;
        !           544:                                case 10:
        !           545:                                        i=1;
        !           546:                                        SETHELP(WHERE);
        !           547: /*
        !           548: `Use Aliases in NetMail:`
        !           549: 
        !           550: If you allow aliases on your system and wish users to have their NetMail
        !           551: contain their alias as the `From User`, set this option to `Yes`. If you
        !           552: want all NetMail to be sent using users' real names, set this option to
        !           553: `No`.
        !           554: */
        !           555:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           556:                                                ,"Use Aliases in NetMail",uifcYesNoOpts);
        !           557:                                        if(!i && !(cfg.netmail_misc&NMAIL_ALIAS)) {
        !           558:                                                uifc.changes=1;
        !           559:                                                cfg.netmail_misc|=NMAIL_ALIAS; 
        !           560:                                        }
        !           561:                                        else if(i==1 && cfg.netmail_misc&NMAIL_ALIAS) {
        !           562:                                                uifc.changes=1;
        !           563:                                                cfg.netmail_misc&=~NMAIL_ALIAS; 
        !           564:                                        }
        !           565:                     break;
        !           566:                                case 11:
        !           567:                                        i=1;
        !           568:                                        SETHELP(WHERE);
        !           569: /*
        !           570: `NetMail Defaults to Crash Status:`
        !           571: 
        !           572: If you want all NetMail to default to crash (send immediately) status,
        !           573: set this option to `Yes`.
        !           574: */
        !           575:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           576:                                                ,"NetMail Defaults to Crash Status",uifcYesNoOpts);
        !           577:                                        if(!i && !(cfg.netmail_misc&NMAIL_CRASH)) {
        !           578:                                                uifc.changes=1;
        !           579:                                                cfg.netmail_misc|=NMAIL_CRASH; 
        !           580:                                        }
        !           581:                                        else if(i==1 && cfg.netmail_misc&NMAIL_CRASH) {
        !           582:                                                uifc.changes=1;
        !           583:                                                cfg.netmail_misc&=~NMAIL_CRASH; 
        !           584:                                        }
        !           585:                     break;
        !           586:                                case 12:
        !           587:                                        i=1;
        !           588:                                        SETHELP(WHERE);
        !           589: /*
        !           590: `NetMail Defaults to Direct Status:`
        !           591: 
        !           592: If you want all NetMail to default to direct (send directly) status,
        !           593: set this option to `Yes`.
        !           594: */
        !           595:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           596:                                                ,"NetMail Defaults to Direct Status",uifcYesNoOpts);
        !           597:                                        if(!i && !(cfg.netmail_misc&NMAIL_DIRECT)) {
        !           598:                                                uifc.changes=1;
        !           599:                                                cfg.netmail_misc|=NMAIL_DIRECT; 
        !           600:                                        }
        !           601:                                        else if(i==1 && cfg.netmail_misc&NMAIL_DIRECT) {
        !           602:                                                uifc.changes=1;
        !           603:                                                cfg.netmail_misc&=~NMAIL_DIRECT; 
        !           604:                                        }
        !           605:                     break;
        !           606:                                case 13:
        !           607:                                        i=1;
        !           608:                                        SETHELP(WHERE);
        !           609: /*
        !           610: `NetMail Defaults to Hold Status:`
        !           611: 
        !           612: If you want all NetMail to default to hold status, set this option to
        !           613: `Yes`.
        !           614: */
        !           615:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           616:                                                ,"NetMail Defaults to Hold Status",uifcYesNoOpts);
        !           617:                                        if(!i && !(cfg.netmail_misc&NMAIL_HOLD)) {
        !           618:                                                uifc.changes=1;
        !           619:                                                cfg.netmail_misc|=NMAIL_HOLD; 
        !           620:                                        }
        !           621:                                        else if(i==1 && cfg.netmail_misc&NMAIL_HOLD) {
        !           622:                                                uifc.changes=1;
        !           623:                                                cfg.netmail_misc&=~NMAIL_HOLD; 
        !           624:                                        }
        !           625:                     break;
        !           626:                                case 14:
        !           627:                                        i=0;
        !           628:                                        SETHELP(WHERE);
        !           629: /*
        !           630: `Kill NetMail After it is Sent:`
        !           631: 
        !           632: If you want NetMail messages to be deleted after they are successfully
        !           633: sent, set this option to `Yes`.
        !           634: */
        !           635:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           636:                                                ,"Kill NetMail After it is Sent",uifcYesNoOpts);
        !           637:                                        if(!i && !(cfg.netmail_misc&NMAIL_KILL)) {
        !           638:                                                uifc.changes=1;
        !           639:                                                cfg.netmail_misc|=NMAIL_KILL; 
        !           640:                                        }
        !           641:                                        else if(i==1 && cfg.netmail_misc&NMAIL_KILL) {
        !           642:                                                uifc.changes=1;
        !           643:                                                cfg.netmail_misc&=~NMAIL_KILL; 
        !           644:                                        }
        !           645:                     break;
        !           646:                                case 15:
        !           647:                                        ultoa(cfg.netmail_cost,str,10);
        !           648:                                        SETHELP(WHERE);
        !           649: /*
        !           650: `Cost in Credits to Send NetMail:`
        !           651: 
        !           652: This is the number of credits it will cost your users to send NetMail.
        !           653: If you want the sending of NetMail to be free, set this value to `0`.
        !           654: */
        !           655:                                        uifc.input(WIN_MID|WIN_SAV,0,0
        !           656:                                                ,"Cost in Credits to Send NetMail"
        !           657:                                                ,str,10,K_EDIT|K_NUMBER);
        !           658:                                        cfg.netmail_cost=atol(str);
        !           659:                                        break; 
        !           660:                        } 
        !           661:                } 
        !           662:        }
        !           663:        else if(i==3) {
        !           664:                done=0;
        !           665:                while(!done) {
        !           666:                        i=0;
        !           667:                        strcpy(opt[i++],"Network Hubs...");
        !           668:                        sprintf(opt[i++],"%-20.20s%-12s","Site Name",cfg.sys_psname);
        !           669:                        sprintf(opt[i++],"%-20.20s%-lu","Site Number",cfg.sys_psnum);
        !           670:                        opt[i][0]=0;
        !           671:                        SETHELP(WHERE);
        !           672: /*
        !           673: `PostLink Networks:`
        !           674: 
        !           675: From this menu you can configure PostLink or PCRelay Networks.
        !           676: */
        !           677:                        i=uifc.list(WIN_ACT|WIN_RHT|WIN_BOT|WIN_CHE,0,0,0,&pnet_dflt,0
        !           678:                                ,"PostLink Networks",opt);
        !           679:                        switch(i) {
        !           680:                                case -1:        /* ESC */
        !           681:                                        done=1;
        !           682:                                        break;
        !           683:                                case 1:
        !           684:                                        SETHELP(WHERE);
        !           685: /*
        !           686: `PostLink Site Name:`
        !           687: 
        !           688: If your system is networked via PostLink or PCRelay, this should be the
        !           689: Site Name for your BBS.
        !           690: */
        !           691:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"Site Name"
        !           692:                                                ,cfg.sys_psname,sizeof(cfg.sys_psname)-1,K_UPPER|K_EDIT);
        !           693:                                        break;
        !           694:                                case 2:
        !           695:                                        SETHELP(WHERE);
        !           696: /*
        !           697: `PostLink Site Number:`
        !           698: 
        !           699: If your system is networked via PostLink or PCRelay, this should be the
        !           700: Site Number for your BBS.
        !           701: */
        !           702:                                        ultoa(cfg.sys_psnum,str,10);
        !           703:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"Site Number"
        !           704:                                                ,str,10,K_NUMBER|K_EDIT);
        !           705:                                        cfg.sys_psnum=atol(str);
        !           706:                     break;
        !           707:                                case 0:
        !           708:                                        while(1) {
        !           709:                                                for(i=0;i<cfg.total_phubs && i<MAX_OPTS;i++)
        !           710:                                                        sprintf(opt[i],"%-10.10s",cfg.phub[i]->name);
        !           711:                                                opt[i][0]=0;
        !           712:                                                i=WIN_ACT|WIN_RHT|WIN_SAV;
        !           713:                                                if(cfg.total_phubs<MAX_OPTS)
        !           714:                                                        i|=WIN_INS|WIN_INSACT|WIN_XTR;
        !           715:                                                if(cfg.total_phubs)
        !           716:                                                        i|=WIN_DEL;
        !           717:                                                SETHELP(WHERE);
        !           718: /*
        !           719: `PostLink Network Hubs:`
        !           720: 
        !           721: This is a list of PostLink and/or PCRelay network hubs that your system
        !           722: calls to exchange packets with.
        !           723: 
        !           724: To add a hub, select the desired location with the arrow keys and hit
        !           725: ~ INS ~.
        !           726: 
        !           727: To delete a hub, select it and hit ~ DEL ~.
        !           728: 
        !           729: To configure a hub, select it and hit ~ ENTER ~.
        !           730: */
        !           731:                                                i=uifc.list(i,0,0,0,&phub_dflt,0
        !           732:                                                        ,"PostLink Hubs",opt);
        !           733:                                                if(i==-1)
        !           734:                                                        break;
        !           735:                                                if((i&MSK_ON)==MSK_INS) {
        !           736:                                                        i&=MSK_OFF;
        !           737:                                                        if((cfg.phub=(phub_t **)realloc(cfg.phub
        !           738:                                 ,sizeof(phub_t *)*(cfg.total_phubs+1)))==NULL) {
        !           739:                                 errormsg(WHERE,ERR_ALLOC,nulstr
        !           740:                                     ,sizeof(phub_t *)*(cfg.total_phubs+1));
        !           741:                                                                cfg.total_phubs=0;
        !           742:                                                                bail(1);
        !           743:                                 continue; 
        !           744:                                                        }
        !           745: 
        !           746:                                                        SETHELP(WHERE);
        !           747: /*
        !           748: `Network Hub Site Name:`
        !           749: 
        !           750: This is the Site Name of this hub. It is used for only for reference.
        !           751: */
        !           752:                                                        if(uifc.input(WIN_MID|WIN_SAV,0,0
        !           753:                                                                ,"Site Name",str,10,K_UPPER)<1)
        !           754:                                                                continue;
        !           755: 
        !           756:                                                        for(j=cfg.total_phubs;j>i;j--)
        !           757:                                 cfg.phub[j]=cfg.phub[j-1];
        !           758: 
        !           759:                                                        if((cfg.phub[i]=(phub_t *)malloc(sizeof(phub_t)))
        !           760:                                                                ==NULL) {
        !           761:                                                                errormsg(WHERE,ERR_ALLOC,nulstr
        !           762:                                                                        ,sizeof(phub_t));
        !           763:                                                                continue; 
        !           764:                                                        }
        !           765:                                                        memset(cfg.phub[i],0,sizeof(phub_t));
        !           766:                                                        strcpy(cfg.phub[i]->name,str);
        !           767:                                                        strcpy(cfg.phub[i]->call,"%!pnet");
        !           768:                                                        cfg.phub[i]->node=1;
        !           769:                                                        cfg.phub[i]->days=(uchar)0xff; /* all days */
        !           770:                                                        cfg.total_phubs++;
        !           771:                                                        uifc.changes=1;
        !           772:                                                        continue; 
        !           773:                                                }
        !           774:                                                if((i&MSK_ON)==MSK_DEL) {
        !           775:                                                        i&=MSK_OFF;
        !           776:                                                        free(cfg.phub[i]);
        !           777:                                                        cfg.total_phubs--;
        !           778:                                                        while(i<cfg.total_phubs) {
        !           779:                                                                cfg.phub[i]=cfg.phub[i+1];
        !           780:                                                                i++; 
        !           781:                                                        }
        !           782:                                                        uifc.changes=1;
        !           783:                                                        continue; 
        !           784:                                                }
        !           785:                                                phub_edit(i); 
        !           786:                                        }
        !           787:                     break; 
        !           788:                        } 
        !           789:                } 
        !           790:        }
        !           791: 
        !           792:        else if(i==0) {         /* Internet E-mail */
        !           793:                done=0;
        !           794:                while(!done) {
        !           795:                        i=0;
        !           796:                        sprintf(opt[i++],"%-27.27s%s"
        !           797:                                ,"System Address",cfg.sys_inetaddr);
        !           798:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           799:                                ,"Inbound E-mail Semaphore",cfg.smtpmail_sem);
        !           800:                        sprintf(opt[i++],"%-27.27s%.40s"
        !           801:                                ,"Outbound E-mail Semaphore",cfg.inetmail_sem);
        !           802:                        sprintf(opt[i++],"%-27.27s%s"
        !           803:                                ,"Allow Sending of E-mail"
        !           804:                                ,cfg.inetmail_misc&NMAIL_ALLOW ? "Yes":"No");
        !           805:                        sprintf(opt[i++],"%-27.27s%s"
        !           806:                                ,"Allow File Attachments"
        !           807:                                ,cfg.inetmail_misc&NMAIL_FILE ? "Yes":"No");
        !           808:                        sprintf(opt[i++],"%-27.27s%s"
        !           809:                                ,"Send E-mail Using Alias"
        !           810:                                ,cfg.inetmail_misc&NMAIL_ALIAS ? "Yes":"No");
        !           811:                        sprintf(opt[i++],"%-27.27s%lu"
        !           812:                                ,"Cost to Send E-mail",cfg.inetmail_cost);
        !           813:                        opt[i][0]=0;
        !           814:                        SETHELP(WHERE);
        !           815: /*
        !           816: `Internet E-mail:`
        !           817: 
        !           818: This menu contains configuration options that pertain specifically to
        !           819: Internet E-mail.
        !           820: */
        !           821:                        i=uifc.list(WIN_ACT|WIN_MID|WIN_CHE,0,0,60,&inet_dflt,0
        !           822:                                ,"Internet E-mail",opt);
        !           823:                        switch(i) {
        !           824:                                case -1:        /* ESC */
        !           825:                                        done=1;
        !           826:                                        break;
        !           827:                                case 0:
        !           828:                                        SETHELP(WHERE);
        !           829: /*
        !           830: `Sytem Internet Address:`
        !           831: 
        !           832: Enter your system's Internet address (hostname or IP address) here
        !           833: (e.g. `joesbbs.com`).
        !           834: */
        !           835:                                        uifc.input(WIN_MID|WIN_SAV,0,0,""
        !           836:                                                ,cfg.sys_inetaddr,sizeof(cfg.sys_inetaddr)-1,K_EDIT);
        !           837:                     break;
        !           838:                                case 1:
        !           839:                                        SETHELP(WHERE);
        !           840: /*
        !           841: `Inbound Internet E-mail Semaphore File:`
        !           842: 
        !           843: This is a filename that will be used as a semaphore (signal) to any
        !           844: external Internet e-mail processors that new mail has been received
        !           845: and the message base should be re-scanned.
        !           846: */
        !           847:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"Inbound Semaphore"
        !           848:                                                ,cfg.smtpmail_sem,sizeof(cfg.smtpmail_sem)-1,K_EDIT);
        !           849:                     break;
        !           850:                                case 2:
        !           851:                                        SETHELP(WHERE);
        !           852: /*
        !           853: `Outbound Internet E-mail Semaphore File:`
        !           854: 
        !           855: This is a filename that will be used as a semaphore (signal) to any
        !           856: external Internet gateways (if supported) that new mail has been created
        !           857: and the message base should be re-scanned.
        !           858: */
        !           859:                                        uifc.input(WIN_MID|WIN_SAV,0,0,"Outbound Semaphore"
        !           860:                                                ,cfg.inetmail_sem,sizeof(cfg.inetmail_sem)-1,K_EDIT);
        !           861:                     break;
        !           862:                                case 3:
        !           863:                                        i=0;
        !           864:                                        SETHELP(WHERE);
        !           865: /*
        !           866: `Allow Users to Send Internet E-mail:`
        !           867: 
        !           868: If you want your users to be allowed to send Internet E-mail, set this
        !           869: option to `Yes`.
        !           870: */
        !           871:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           872:                                                ,"Allow Users to Send E-mail",uifcYesNoOpts);
        !           873:                                        if(!i && !(cfg.inetmail_misc&NMAIL_ALLOW)) {
        !           874:                                                uifc.changes=1;
        !           875:                                                cfg.inetmail_misc|=NMAIL_ALLOW; 
        !           876:                                        }
        !           877:                                        else if(i==1 && cfg.inetmail_misc&NMAIL_ALLOW) {
        !           878:                                                uifc.changes=1;
        !           879:                                                cfg.inetmail_misc&=~NMAIL_ALLOW; 
        !           880:                                        }
        !           881:                                        break;
        !           882:                                case 4:
        !           883:                                        i=0;
        !           884:                                        SETHELP(WHERE);
        !           885: /*
        !           886: `Allow Users to Send Internet E-mail File Attachments:`
        !           887: 
        !           888: If you want your users to be allowed to send Internet E-mail with file
        !           889: attachments, set this option to `Yes`.
        !           890: */
        !           891:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           892:                                                ,"Allow Users to Send E-mail with File Attachments",uifcYesNoOpts);
        !           893:                                        if(!i && !(cfg.inetmail_misc&NMAIL_FILE)) {
        !           894:                                                uifc.changes=1;
        !           895:                                                cfg.inetmail_misc|=NMAIL_FILE; 
        !           896:                                        }
        !           897:                                        else if(i==1 && cfg.inetmail_misc&NMAIL_FILE) {
        !           898:                                                uifc.changes=1;
        !           899:                                                cfg.inetmail_misc&=~NMAIL_FILE; 
        !           900:                                        }
        !           901:                     break;
        !           902:                                case 5:
        !           903:                                        i=1;
        !           904:                                        SETHELP(WHERE);
        !           905: /*
        !           906: `Use Aliases in Internet E-mail:`
        !           907: 
        !           908: If you allow aliases on your system and wish users to have their
        !           909: Internet E-mail contain their alias as the `From User`, set this option to
        !           910: `Yes`. If you want all E-mail to be sent using users' real names, set this
        !           911: option to `No`.
        !           912: */
        !           913:                                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !           914:                                                ,"Use Aliases in Internet E-mail",uifcYesNoOpts);
        !           915:                                        if(!i && !(cfg.inetmail_misc&NMAIL_ALIAS)) {
        !           916:                                                uifc.changes=1;
        !           917:                                                cfg.inetmail_misc|=NMAIL_ALIAS; 
        !           918:                                        }
        !           919:                                        else if(i==1 && cfg.inetmail_misc&NMAIL_ALIAS) {
        !           920:                                                uifc.changes=1;
        !           921:                                                cfg.inetmail_misc&=~NMAIL_ALIAS; 
        !           922:                                        }
        !           923:                                        break;
        !           924:                                case 6:
        !           925:                                        ultoa(cfg.inetmail_cost,str,10);
        !           926:                                        SETHELP(WHERE);
        !           927: /*
        !           928: `Cost in Credits to Send Internet E-mail:`
        !           929: 
        !           930: This is the number of credits it will cost your users to send Internet
        !           931: E-mail. If you want the sending of Internet E-mail to be free, set this
        !           932: value to `0`.
        !           933: */
        !           934:                                        uifc.input(WIN_MID|WIN_SAV,0,0
        !           935:                                                ,"Cost in Credits to Send Internet E-mail"
        !           936:                                                ,str,10,K_EDIT|K_NUMBER);
        !           937:                                        cfg.inetmail_cost=atol(str);
        !           938:                                        break; 
        !           939:                        } 
        !           940:                } 
        !           941:        }
        !           942: 
        !           943:        else { /* ESC */
        !           944:                i=save_changes(WIN_MID|WIN_SAV);
        !           945:                if(i==-1)
        !           946:                        continue;
        !           947:                if(!i) {
        !           948:                        write_msgs_cfg(&cfg,backup_level);
        !           949:             refresh_cfg(&cfg);
        !           950:         }
        !           951:                break;
        !           952:         }
        !           953:     }
        !           954: }
        !           955: 
        !           956: void qhub_edit(int num)
        !           957: {
        !           958:        static int qhub_dflt;
        !           959:        char *p,done=0,str[256];
        !           960:        int i,j;
        !           961: 
        !           962: while(!done) {
        !           963:        i=0;
        !           964:        sprintf(opt[i++],"%-27.27s%s","Hub System ID",cfg.qhub[num]->id);
        !           965:        sprintf(opt[i++],"%-27.27s%.40s","Pack Command Line",cfg.qhub[num]->pack);
        !           966:        sprintf(opt[i++],"%-27.27s%.40s","Unpack Command Line",cfg.qhub[num]->unpack);
        !           967:        sprintf(opt[i++],"%-27.27s%.40s","Call-out Command Line",cfg.qhub[num]->call);
        !           968:        sprintf(opt[i++],"%-27.27s%u","Call-out Node",cfg.qhub[num]->node);
        !           969:        sprintf(opt[i++],"%-27.27s%s","Call-out Days",daystr(cfg.qhub[num]->days));
        !           970:        if(cfg.qhub[num]->freq) {
        !           971:                sprintf(str,"%u times a day",1440/cfg.qhub[num]->freq);
        !           972:                sprintf(opt[i++],"%-27.27s%s","Call-out Frequency",str); 
        !           973:        }
        !           974:        else {
        !           975:                sprintf(str,"%2.2u:%2.2u",cfg.qhub[num]->time/60,cfg.qhub[num]->time%60);
        !           976:                sprintf(opt[i++],"%-27.27s%s","Call-out Time",str); 
        !           977:        }
        !           978:        strcpy(opt[i++],"Networked Sub-boards...");
        !           979:        opt[i][0]=0;
        !           980:        sprintf(str,"%s Network Hub",cfg.qhub[num]->id);
        !           981:        SETHELP(WHERE);
        !           982: /*
        !           983: `QWK Network Hub Configuration:`
        !           984: 
        !           985: This menu allows you to configure options specific to this QWK network
        !           986: hub.
        !           987: */
        !           988:        switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&qhub_dflt,0
        !           989:                ,str,opt)) {
        !           990:                case -1:
        !           991:                        done=1;
        !           992:                        break;
        !           993:                case 0:
        !           994:                        SETHELP(WHERE);
        !           995: /*
        !           996: `QWK Network Hub System ID:`
        !           997: 
        !           998: This is the QWK System ID of this hub. It is used for incoming and
        !           999: outgoing network packets and must be accurate.
        !          1000: */
        !          1001:                        strcpy(str,cfg.qhub[num]->id);  /* save */
        !          1002:                        if(!uifc.input(WIN_MID|WIN_SAV,0,0,"QWK Network Hub System ID"
        !          1003:                                ,cfg.qhub[num]->id,LEN_QWKID,K_UPPER|K_EDIT))
        !          1004:                                strcpy(cfg.qhub[num]->id,str);
        !          1005:                        break;
        !          1006:                case 1:
        !          1007:                        SETHELP(WHERE);
        !          1008: /*
        !          1009: `REP Packet Creation Command:`
        !          1010: 
        !          1011: This is the command line to use to create (compress) REP packets for
        !          1012: this QWK network hub.
        !          1013: */
        !          1014:                        uifc.input(WIN_MID|WIN_SAV,0,0,""
        !          1015:                                ,cfg.qhub[num]->pack,sizeof(cfg.qhub[num]->pack)-1,K_EDIT);
        !          1016:                        break;
        !          1017:                case 2:
        !          1018:                        SETHELP(WHERE);
        !          1019: /*
        !          1020: `QWK Packet Extraction Command:`
        !          1021: 
        !          1022: This is the command line to use to extract (decompress) QWK packets from
        !          1023: this QWK network hub.
        !          1024: */
        !          1025:                        uifc.input(WIN_MID|WIN_SAV,0,0,""
        !          1026:                                ,cfg.qhub[num]->unpack,sizeof(cfg.qhub[num]->unpack)-1,K_EDIT);
        !          1027:                        break;
        !          1028:                case 3:
        !          1029:                        SETHELP(WHERE);
        !          1030: /*
        !          1031: `QWK Network Hub Call-out Command Line:`
        !          1032: 
        !          1033: This is the command line to use to initiate a call-out to this QWK
        !          1034: network hub.
        !          1035: */
        !          1036:                        uifc.input(WIN_MID|WIN_SAV,0,0,""
        !          1037:                                ,cfg.qhub[num]->call,sizeof(cfg.qhub[num]->call)-1,K_EDIT);
        !          1038:                        break;
        !          1039:                case 4:
        !          1040:                        sprintf(str,"%u",cfg.qhub[num]->node);
        !          1041:                        SETHELP(WHERE);
        !          1042: /*
        !          1043: `Node to Perform Call-out:`
        !          1044: 
        !          1045: This is the number of the node to perform the call-out for this QWK
        !          1046: network hub.
        !          1047: */
        !          1048:                        uifc.input(WIN_MID|WIN_SAV,0,0
        !          1049:                                ,"Node to Perform Call-out",str,3,K_EDIT|K_NUMBER);
        !          1050:                        cfg.qhub[num]->node=atoi(str);
        !          1051:                        break;
        !          1052:                case 5:
        !          1053:                        j=0;
        !          1054:                        while(1) {
        !          1055:                                for(i=0;i<7;i++)
        !          1056:                                        sprintf(opt[i],"%s        %s"
        !          1057:                                                ,wday[i],(cfg.qhub[num]->days&(1<<i)) ? "Yes":"No");
        !          1058:                                opt[i][0]=0;
        !          1059:                                SETHELP(WHERE);
        !          1060: /*
        !          1061: `Days to Perform Call-out:`
        !          1062: 
        !          1063: These are the days that a call-out will be performed for this QWK
        !          1064: network hub.
        !          1065: */
        !          1066:                                i=uifc.list(WIN_MID,0,0,0,&j,0
        !          1067:                                        ,"Days to Perform Call-out",opt);
        !          1068:                                if(i==-1)
        !          1069:                                        break;
        !          1070:                                cfg.qhub[num]->days^=(1<<i);
        !          1071:                                uifc.changes=1; 
        !          1072:                        }
        !          1073:                        break;
        !          1074:                case 6:
        !          1075:                        i=1;
        !          1076:                        SETHELP(WHERE);
        !          1077: /*
        !          1078: `Perform Call-out at a Specific Time:`
        !          1079: 
        !          1080: If you want the system call this QWK network hub at a specific time,
        !          1081: set this option to `Yes`. If you want the system to call this network
        !          1082: hub more than once a day at predetermined intervals, set this option to
        !          1083: `No`.
        !          1084: */
        !          1085:                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !          1086:                                ,"Perform Call-out at a Specific Time",uifcYesNoOpts);
        !          1087:                        if(i==0) {
        !          1088:                                sprintf(str,"%2.2u:%2.2u",cfg.qhub[num]->time/60
        !          1089:                                        ,cfg.qhub[num]->time%60);
        !          1090:                                SETHELP(WHERE);
        !          1091: /*
        !          1092: `Time to Perform Call-out:`
        !          1093: 
        !          1094: This is the time (in 24 hour HH:MM format) to perform the call-out to
        !          1095: this QWK network hub.
        !          1096: */
        !          1097:                                if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1098:                                        ,"Time to Perform Call-out (HH:MM)"
        !          1099:                                        ,str,5,K_UPPER|K_EDIT)>0) {
        !          1100:                                        cfg.qhub[num]->freq=0;
        !          1101:                                        cfg.qhub[num]->time=atoi(str)*60;
        !          1102:                                        if((p=strchr(str,':'))!=NULL)
        !          1103:                                                cfg.qhub[num]->time+=atoi(p+1); 
        !          1104:                                } 
        !          1105:                        }
        !          1106:                        else if(i==1) {
        !          1107:                                sprintf(str,"%u",cfg.qhub[num]->freq
        !          1108:                                        && cfg.qhub[num]->freq<=1440 ? 1440/cfg.qhub[num]->freq : 0);
        !          1109:                                SETHELP(WHERE);
        !          1110: /*
        !          1111: `Number of Call-outs Per Day:`
        !          1112: 
        !          1113: This is the maximum number of times the system will perform a call-out
        !          1114: per day to this QWK network hub. This value is actually converted by
        !          1115: Synchronet into minutes between call-outs and when the BBS is idle
        !          1116: and this number of minutes since the last call-out is reached, it will
        !          1117: perform a call-out.
        !          1118: */
        !          1119:                                if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1120:                                        ,"Number of Call-outs Per Day"
        !          1121:                                        ,str,4,K_NUMBER|K_EDIT)>0) {
        !          1122:                                        cfg.qhub[num]->time=0;
        !          1123:                                        i=atoi(str);
        !          1124:                                        if(i && i<=1440)
        !          1125:                                                cfg.qhub[num]->freq=1440/i;
        !          1126:                                        else
        !          1127:                                                cfg.qhub[num]->freq=0; 
        !          1128:                                } 
        !          1129:                        }
        !          1130:                        break;
        !          1131:                case 7:
        !          1132:                        qhub_sub_edit(num);
        !          1133:                        break; 
        !          1134:                } 
        !          1135:        }
        !          1136: }
        !          1137: 
        !          1138: void qhub_sub_edit(uint num)
        !          1139: {
        !          1140:        char str[256];
        !          1141:        int j,k,l,m,n,bar=0;
        !          1142: 
        !          1143: k=0;
        !          1144: while(1) {
        !          1145:        for(j=0;j<cfg.qhub[num]->subs;j++)
        !          1146:                sprintf(opt[j],"%-5u %-*.*s %-*.*s"
        !          1147:                        ,cfg.qhub[num]->conf[j]
        !          1148:                        ,LEN_GSNAME,LEN_GSNAME
        !          1149:                        ,cfg.grp[cfg.sub[cfg.qhub[num]->sub[j]]->grp]->sname
        !          1150:                        ,LEN_SSNAME,LEN_SSNAME
        !          1151:                        ,cfg.sub[cfg.qhub[num]->sub[j]]->sname);
        !          1152:        opt[j][0]=0;
        !          1153:        j=WIN_BOT|WIN_SAV|WIN_ACT;
        !          1154:        if(cfg.qhub[num]->subs<MAX_OPTS)
        !          1155:                j|=WIN_INS|WIN_INSACT|WIN_XTR;
        !          1156:        if(cfg.qhub[num]->subs)
        !          1157:                j|=WIN_DEL;
        !          1158:        SETHELP(WHERE);
        !          1159: /*
        !          1160: `QWK Networked Sub-boards:`
        !          1161: 
        !          1162: This is a list of the sub-boards that are networked with this QWK
        !          1163: network hub.
        !          1164: 
        !          1165: To add a sub-board, select the desired location and hit ~ INS ~.
        !          1166: 
        !          1167: To remove a sub-board, select it and hit ~ DEL ~.
        !          1168: 
        !          1169: To configure a sub-board for this QWK network hub, select it and hit
        !          1170: ~ ENTER ~.
        !          1171: */
        !          1172:        j=uifc.list(j,0,0,0,&k,&bar
        !          1173:                ,"Networked Sub-boards",opt);
        !          1174:        if(j==-1)
        !          1175:                break;
        !          1176:        if((j&MSK_ON)==MSK_INS) {
        !          1177:                j&=MSK_OFF;
        !          1178:                if((l=getsub())==-1)
        !          1179:                        continue;
        !          1180:                SETHELP(WHERE);
        !          1181: /*
        !          1182: `Conference Number on Hub:`
        !          1183: 
        !          1184: This is the number of the conference on the QWK network hub, that this
        !          1185: sub-board is networked with. On Synchronet systems, this number is
        !          1186: derived by multiplying the group number by 10 and adding the sub-board
        !          1187: number. For example, group 2, sub-board 3, is conference number 203.
        !          1188: 
        !          1189: It is important to understand that this is `NOT` the conference number of
        !          1190: this sub-board on your system. It is the number of the conference this
        !          1191: sub-board is networked with on this `QWK network hub`.
        !          1192: */
        !          1193:                if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1194:                        ,"Conference Number on Hub"
        !          1195:                        ,str,5,K_NUMBER)<1)
        !          1196:                        continue;
        !          1197:                strcpy(opt[0],"Strip out");
        !          1198:                strcpy(opt[1],"Leave in");
        !          1199:                strcpy(opt[2],"Expand to ANSI");
        !          1200:                opt[3][0]=0;
        !          1201:                m=0;
        !          1202:                SETHELP(WHERE);
        !          1203: /*
        !          1204: `Ctrl-A Codes:`
        !          1205: 
        !          1206: You are being prompted for the method of handling Ctrl-A attribute codes
        !          1207: generated by Synchronet. If this QWK network hub is a Synchronet BBS,
        !          1208: set this option to `Leave in`. If the QWK network hub is not a Synchronet
        !          1209: BBS, but allows ANSI escape sequences in messages, set this option to
        !          1210: `Expand to ANSI`. If the QWK network hub is not a Synchronet BBS and does
        !          1211: not support ANSI escape sequences in messages (or you're not sure), set
        !          1212: this option to `Strip out`.
        !          1213: */
        !          1214:                if((m=uifc.list(WIN_MID|WIN_SAV,0,0,0,&m,0
        !          1215:                        ,"Ctrl-A Codes",opt))==-1)
        !          1216:                        continue;
        !          1217:                if((cfg.qhub[num]->sub=(ulong *)realloc(cfg.qhub[num]->sub
        !          1218:                        ,sizeof(ulong *)*(cfg.qhub[num]->subs+1)))==NULL
        !          1219:                || (cfg.qhub[num]->conf=(ushort *)realloc(cfg.qhub[num]->conf
        !          1220:             ,sizeof(ushort *)*(cfg.qhub[num]->subs+1)))==NULL
        !          1221:                || (cfg.qhub[num]->mode=(uchar *)realloc(cfg.qhub[num]->mode
        !          1222:                        ,sizeof(uchar *)*(cfg.qhub[num]->subs+1)))==NULL) {
        !          1223:                        errormsg(WHERE,ERR_ALLOC,nulstr,cfg.qhub[num]->subs+1);
        !          1224:                        continue; 
        !          1225:                }
        !          1226:                if(cfg.qhub[num]->subs)                           /* insert */
        !          1227:                        for(n=cfg.qhub[num]->subs;n>j;n--) {
        !          1228:                                cfg.qhub[num]->sub[n]=cfg.qhub[num]->sub[n-1];
        !          1229:                                cfg.qhub[num]->conf[n]=cfg.qhub[num]->conf[n-1];
        !          1230:                                cfg.qhub[num]->mode[n]=cfg.qhub[num]->mode[n-1]; 
        !          1231:                        }
        !          1232:                if(!m)
        !          1233:                        cfg.qhub[num]->mode[j]=A_STRIP;
        !          1234:                else if(m==1)
        !          1235:                        cfg.qhub[num]->mode[j]=A_LEAVE;
        !          1236:                else
        !          1237:                        cfg.qhub[num]->mode[j]=A_EXPAND;
        !          1238:                cfg.qhub[num]->sub[j]=l;
        !          1239:                cfg.qhub[num]->conf[j]=atoi(str);
        !          1240:                cfg.qhub[num]->subs++;
        !          1241:                uifc.changes=1;
        !          1242:                continue; 
        !          1243:        }
        !          1244:        if((j&MSK_ON)==MSK_DEL) {
        !          1245:                j&=MSK_OFF;
        !          1246:                cfg.qhub[num]->subs--;
        !          1247:                while(j<cfg.qhub[num]->subs) {
        !          1248:                        cfg.qhub[num]->sub[j]=cfg.qhub[num]->sub[j+1];
        !          1249:                        cfg.qhub[num]->mode[j]=cfg.qhub[num]->mode[j+1];
        !          1250:                        cfg.qhub[num]->conf[j]=cfg.qhub[num]->conf[j+1];
        !          1251:                        j++; 
        !          1252:                }
        !          1253:                uifc.changes=1;
        !          1254:                continue; 
        !          1255:        }
        !          1256:        l=0;
        !          1257:        while(1) {
        !          1258:                n=0;
        !          1259:                sprintf(opt[n++],"%-22.22s%.*s %.*s"
        !          1260:                        ,"Sub-board"
        !          1261:                        ,LEN_GSNAME
        !          1262:                        ,cfg.grp[cfg.sub[cfg.qhub[num]->sub[j]]->grp]->sname
        !          1263:                        ,LEN_SSNAME
        !          1264:                        ,cfg.sub[cfg.qhub[num]->sub[j]]->sname);
        !          1265:                sprintf(opt[n++],"%-22.22s%u"
        !          1266:                        ,"Conference Number",cfg.qhub[num]->conf[j]);
        !          1267:                sprintf(opt[n++],"%-22.22s%s"
        !          1268:                        ,"Ctrl-A Codes",cfg.qhub[num]->mode[j]==A_STRIP ?
        !          1269:                        "Strip out" : cfg.qhub[num]->mode[j]==A_LEAVE ?
        !          1270:                        "Leave in" : "Expand to ANSI");
        !          1271:                opt[n][0]=0;
        !          1272:                SETHELP(WHERE);
        !          1273: /*
        !          1274: `QWK Netted Sub-board:`
        !          1275: 
        !          1276: You are configuring the options for this sub-board for this QWK network
        !          1277: hub.
        !          1278: */
        !          1279:                l=uifc.list(WIN_MID|WIN_SAV|WIN_ACT,0,0,
        !          1280:                        22+LEN_GSNAME+LEN_SSNAME,&l,0
        !          1281:                        ,"Netted Sub-board",opt);
        !          1282:                if(l==-1)
        !          1283:                        break;
        !          1284:                if(!l) {
        !          1285:                        m=getsub();
        !          1286:                        if(m!=-1) {
        !          1287:                                cfg.qhub[num]->sub[j]=m;
        !          1288:                                uifc.changes=1; 
        !          1289:                        } 
        !          1290:                }
        !          1291:                else if(l==1) {
        !          1292:                        SETHELP(WHERE);
        !          1293: /*
        !          1294: `Conference Number on Hub:`
        !          1295: 
        !          1296: This is the number of the conference on the QWK network hub, that this
        !          1297: sub-board is networked with. On Synchronet systems, this number is
        !          1298: derived by multiplying the group number by 10 and adding the sub-board
        !          1299: number. For example, group 2, sub-board 3, is conference number 203.
        !          1300: 
        !          1301: It is important to understand that this is `NOT` the conference number of
        !          1302: this sub-board on your system. It is the number of the conference this
        !          1303: sub-board is networked with on this `QWK network hub`.
        !          1304: */
        !          1305:                        if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1306:                                ,"Conference Number on Hub"
        !          1307:                                ,str,5,K_NUMBER)>0)
        !          1308:                                cfg.qhub[num]->conf[j]=atoi(str); 
        !          1309:                }
        !          1310:                else if(l==2) {
        !          1311:                        strcpy(opt[0],"Strip out");
        !          1312:                        strcpy(opt[1],"Leave in");
        !          1313:                        strcpy(opt[2],"Expand to ANSI");
        !          1314:                        opt[3][0]=0;
        !          1315:                        m=0;
        !          1316:                        SETHELP(WHERE);
        !          1317: /*
        !          1318: `Ctrl-A Codes:`
        !          1319: 
        !          1320: You are being prompted for the method of handling Ctrl-A attribute codes
        !          1321: generated by Synchronet. If this QWK network hub is a Synchronet BBS,
        !          1322: set this option to `Leave in`. If the QWK network hub is not a Synchronet
        !          1323: BBS, but allows ANSI escape sequences in messages, set this option to
        !          1324: `Expand to ANSI`. If the QWK network hub is not a Synchronet BBS and does
        !          1325: not support ANSI escape sequences in messages (or you're not sure), set
        !          1326: this option to `Strip out`.
        !          1327: */
        !          1328:                        m=uifc.list(WIN_MID|WIN_SAV,0,0,0,&m,0
        !          1329:                                ,"Ctrl-A Codes",opt);
        !          1330:                        uifc.changes=1;
        !          1331:                        if(!m)
        !          1332:                                cfg.qhub[num]->mode[j]=A_STRIP;
        !          1333:                        else if(m==1)
        !          1334:                                cfg.qhub[num]->mode[j]=A_LEAVE;
        !          1335:                        else if(m==2)
        !          1336:                                cfg.qhub[num]->mode[j]=A_EXPAND; 
        !          1337:                        } 
        !          1338:                } 
        !          1339:        }
        !          1340: }
        !          1341: 
        !          1342: void phub_edit(int num)
        !          1343: {
        !          1344:        static int phub_dflt;
        !          1345:        char *p,done=0,str[256];
        !          1346:        int i,j;
        !          1347: 
        !          1348: while(!done) {
        !          1349:        i=0;
        !          1350:        sprintf(opt[i++],"%-27.27s%s","Hub Site Name",cfg.phub[num]->name);
        !          1351:        sprintf(opt[i++],"%-27.27s%.40s","Call-out Command Line",cfg.phub[num]->call);
        !          1352:        sprintf(opt[i++],"%-27.27s%u","Call-out Node",cfg.phub[num]->node);
        !          1353:        sprintf(opt[i++],"%-27.27s%s","Call-out Days",daystr(cfg.phub[num]->days));
        !          1354:        if(cfg.phub[num]->freq) {
        !          1355:                sprintf(str,"%u times a day",1440/cfg.phub[num]->freq);
        !          1356:                sprintf(opt[i++],"%-27.27s%s","Call-out Frequency",str); 
        !          1357:        }
        !          1358:        else {
        !          1359:                sprintf(str,"%2.2u:%2.2u",cfg.phub[num]->time/60
        !          1360:                        ,cfg.phub[num]->time%60);
        !          1361:                sprintf(opt[i++],"%-27.27s%s","Call-out Time",str); 
        !          1362:        }
        !          1363:        opt[i][0]=0;
        !          1364:        sprintf(str,"%s Network Hub",cfg.phub[num]->name);
        !          1365:        SETHELP(WHERE);
        !          1366: /*
        !          1367: `PostLink Network Hub Configuration:`
        !          1368: 
        !          1369: This menu allows you to configure options specific to this network hub.
        !          1370: */
        !          1371:        switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&phub_dflt,0
        !          1372:                ,str,opt)) {
        !          1373:                case -1:
        !          1374:                        done=1;
        !          1375:                        break;
        !          1376:                case 0:
        !          1377:                        SETHELP(WHERE);
        !          1378: /*
        !          1379: `Network Hub Site Name:`
        !          1380: 
        !          1381: This is the Site Name of this hub. It is used for only for reference.
        !          1382: */
        !          1383:                        strcpy(str,cfg.phub[num]->name);        /* save */
        !          1384:                        if(!uifc.input(WIN_MID|WIN_SAV,0,0,"Hub Site Name"
        !          1385:                                ,cfg.phub[num]->name,sizeof(cfg.phub[num]->name)-1,K_UPPER|K_EDIT))
        !          1386:                                strcpy(cfg.phub[num]->name,str);        /* restore */
        !          1387:                        break;
        !          1388:                case 1:
        !          1389:                        SETHELP(WHERE);
        !          1390: /*
        !          1391: `Network Hub Call-out Command Line:`
        !          1392: 
        !          1393: This is the command line to use to initiate a call-out to this network
        !          1394: hub.
        !          1395: */
        !          1396:                        uifc.input(WIN_MID|WIN_SAV,0,0,"Call-out Command"
        !          1397:                                ,cfg.phub[num]->call,sizeof(cfg.phub[num]->call)-1,K_EDIT);
        !          1398:                        break;
        !          1399:                case 2:
        !          1400:                        sprintf(str,"%u",cfg.phub[num]->node);
        !          1401:                        SETHELP(WHERE);
        !          1402: /*
        !          1403: `Node to Perform Call-out:`
        !          1404: 
        !          1405: This is the number of the node to perform the call-out for this network
        !          1406: hub.
        !          1407: */
        !          1408:                        uifc.input(WIN_MID|WIN_SAV,0,0
        !          1409:                                ,"Node to Perform Call-out",str,3,K_EDIT|K_NUMBER);
        !          1410:                        cfg.phub[num]->node=atoi(str);
        !          1411:                        break;
        !          1412:                case 3:
        !          1413:                        j=0;
        !          1414:                        while(1) {
        !          1415:                                for(i=0;i<7;i++)
        !          1416:                                        sprintf(opt[i],"%s        %s"
        !          1417:                                                ,wday[i],(cfg.phub[num]->days&(1<<i)) ? "Yes":"No");
        !          1418:                                opt[i][0]=0;
        !          1419:                                SETHELP(WHERE);
        !          1420: /*
        !          1421: `Days to Perform Call-out:`
        !          1422: 
        !          1423: These are the days that a call-out will be performed for this network
        !          1424: hub.
        !          1425: */
        !          1426:                                i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,0
        !          1427:                                        ,"Days to Perform Call-out",opt);
        !          1428:                                if(i==-1)
        !          1429:                                        break;
        !          1430:                                cfg.phub[num]->days^=(1<<i);
        !          1431:                                uifc.changes=1; 
        !          1432:                        }
        !          1433:                        break;
        !          1434:                case 4:
        !          1435:                        i=1;
        !          1436:                        SETHELP(WHERE);
        !          1437: /*
        !          1438: `Perform Call-out at a Specific Time:`
        !          1439: 
        !          1440: If you want the system call this network hub at a specific time, set
        !          1441: this option to `Yes`. If you want the system to call this hub more than
        !          1442: once a day at predetermined intervals, set this option to `No`.
        !          1443: */
        !          1444:                        i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
        !          1445:                                ,"Perform Call-out at a Specific Time",uifcYesNoOpts);
        !          1446:                        if(i==0) {
        !          1447:                                sprintf(str,"%2.2u:%2.2u",cfg.phub[num]->time/60
        !          1448:                                        ,cfg.phub[num]->time%60);
        !          1449:                                SETHELP(WHERE);
        !          1450: /*
        !          1451: `Time to Perform Call-out:`
        !          1452: 
        !          1453: This is the time (in 24 hour HH:MM format) to perform the call-out to
        !          1454: this network hub.
        !          1455: */
        !          1456:                                if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1457:                                        ,"Time to Perform Call-out (HH:MM)"
        !          1458:                                        ,str,5,K_UPPER|K_EDIT)>0) {
        !          1459:                                        cfg.phub[num]->freq=0;
        !          1460:                                        cfg.phub[num]->time=atoi(str)*60;
        !          1461:                                        if((p=strchr(str,':'))!=NULL)
        !          1462:                                                cfg.phub[num]->time+=atoi(p+1); 
        !          1463:                                } 
        !          1464:                        }
        !          1465:                        else if(i==1) {
        !          1466:                                sprintf(str,"%u",cfg.phub[num]->freq
        !          1467:                                        && cfg.phub[num]->freq<=1440 ? 1440/cfg.phub[num]->freq : 0);
        !          1468:                                SETHELP(WHERE);
        !          1469: /*
        !          1470: `Number of Call-outs Per Day:`
        !          1471: 
        !          1472: This is the maximum number of times the system will perform a call-out
        !          1473: per day to this network hub. This value is actually converted by
        !          1474: Synchronet into minutes between call-outs and when the BBS is idle
        !          1475: and this number of minutes since the last call-out is reached, it will
        !          1476: perform a call-out.
        !          1477: */
        !          1478:                                if(uifc.input(WIN_MID|WIN_SAV,0,0
        !          1479:                                        ,"Number of Call-outs Per Day"
        !          1480:                                        ,str,4,K_NUMBER|K_EDIT)>0) {
        !          1481:                                        cfg.phub[num]->time=0;
        !          1482:                                        i=atoi(str);
        !          1483:                                        if(i && i<=1440)
        !          1484:                                                cfg.phub[num]->freq=1440/i;
        !          1485:                                        else
        !          1486:                                                cfg.phub[num]->freq=0; 
        !          1487:                                } 
        !          1488:                        }
        !          1489:                        break; 
        !          1490:                } 
        !          1491:        }
        !          1492: }
        !          1493: 
        !          1494: char *daystr(char days)
        !          1495: {
        !          1496:        static char str[256];
        !          1497:        int i;
        !          1498: 
        !          1499:        days&=0x7f;
        !          1500: 
        !          1501:        if(days==0)             return("None");
        !          1502: 
        !          1503:        if(days==0x7f)  return("All");
        !          1504: 
        !          1505:        str[0]=0;
        !          1506:        for(i=0;i<7;i++) {
        !          1507:                if(days&(1<<i)) {
        !          1508:                        strcat(str,wday[i]);
        !          1509:                        strcat(str," "); 
        !          1510:                }
        !          1511:        }
        !          1512:        return(str);
        !          1513: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.