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

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

unix.superglobalmegacorp.com

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