home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / ios_src / vars.c < prev    next >
C/C++ Source or Header  |  1993-01-31  |  8KB  |  426 lines

  1. /*********************************************************************
  2.  
  3.                     IOS - global variables
  4.                     
  5.     Program : IOSmail
  6.     Source  : free
  7.     Author  : Rinaldo Visscher
  8.     Date    : 1991
  9.     
  10.     All global variables used by IOS are here.
  11. ***********************************************************************/
  12.  
  13. #include        <stdio.h>
  14. #include        <ext.h>
  15.  
  16. #include        "portab.h"
  17.  
  18. #include        "defs.h"
  19. #include        "lang.h"
  20.  
  21.  
  22. BOOLEAN            registered,
  23.                 debugflag,
  24.                 dooutdeb,
  25.                 SENDfido_bits,
  26.                 StatusScreen,
  27.                 
  28.                 Dareas[N_AREAS],
  29.  
  30.                 dokillsent,
  31.                 dorealname,
  32.                 dokillall,
  33.                 dopvtmail,
  34.                 doknown,
  35.                 doareafix,
  36.                 doniceout,
  37.                 doreport,
  38.                 dodiskcheck,
  39.                 dopathcheck,
  40.                 donozone,
  41.                 doadd_AKA,
  42.                 dolog,
  43.                 doquit,
  44.                 dosecure,
  45.                 doifna,
  46.                 doled,
  47.                 dopkt,
  48.                 domsg,
  49.                 dostripzone,
  50.                 doimport,
  51.                 doscanmail,
  52.                 dochanged,
  53.                 dopack,
  54.                 keepmsg,
  55.                 toprivate,
  56.                 domulti_reg,
  57.                 dowait,
  58.                 docrunch,
  59.                 dolabel,
  60.                 donopack,
  61.                 doredirect,
  62.                 doQbbslr,
  63.                 dosaveprivate,
  64.                 dosavelocal,
  65.                 doextra,
  66.                 donewbink,
  67.                 dothebox,
  68.                 dopointcpy,
  69.                 doonly_tear = FALSE,
  70.                 doadd_domain,
  71.                 dofastimport,
  72.                 dosentpkt,
  73.                 donopointadd,
  74.                 donopointpath,
  75.                 docheckname,
  76.                 dostripPID,
  77.                 doNOdupecheck,
  78.                 doDEFgroup,
  79.                 dostripINTL,
  80.                 doAUTOaddareas,
  81.                 doDENIED,
  82.                 doNODELIST,
  83.                 
  84.                 AreaAdded,
  85.                 
  86.                 HaveDUPES,
  87.                 
  88.                 MSGheader4d,
  89.                 
  90.                 CRspec = FALSE,
  91.                 
  92.                 defPKT = FTS_TYPE,
  93.                 
  94.                 Copy_area[N_AREAS],
  95.                 
  96.                 Read_only[N_AREAS],
  97.                 
  98.                 FDcompare[N_FDBASE],
  99.  
  100. #if defined AREAFIX
  101.                 dorescan = FALSE,
  102.                 areafix_on,
  103.                 doquery = FALSE,
  104.                 dototallist = FALSE,
  105. #endif
  106.                 Fsystem,
  107.                 Tsystem;
  108.  
  109. WORD            Areamsgs[N_AREAS],
  110.                 Areaday[N_AREAS],
  111.                 Areamin[N_AREAS],
  112.                 
  113.                 Tosysop[N_AREAS],
  114.                 Ncreated[N_AREAS],
  115.                 Lledmsgs[N_AREAS],
  116.                 Lledmask[N_AREAS],
  117.  
  118.                 HDR,                /* File pointers for log_line and header     */
  119.                 MSG,                /* files                                      */
  120.                 newHDR,
  121.                 newMSG,
  122.                 F_LSTBBS = -1,        /* used for updating the lastread.bbs file    */
  123.                                     /*  initially closed                        */
  124.  
  125.                 g_curarea,            /* area we're processing                    */
  126.                 
  127.                 g_users=0,            /* number of qbbs lastreas.bbs records        */
  128.                 *g_newnum,            /* new numbers of messages, malloced        */
  129.                 
  130.                 g_lsttype = 2,        /* type of the lastread.ced file, 2 for LED    */
  131.                 g_minhdrs,            /*  1 for the old way...                    */
  132.                 g_nrhdrs,
  133.                 g_safety,
  134.  
  135.                 g_totdel,                /* total deleted messages                    */
  136.                 g_totleft,                /* total remaining messages                    */
  137.                 g_amhdr,                /* Amount hdr    */
  138.                 
  139.                 ToCopy,
  140.                 
  141.                 nalias,
  142.                 nkey,
  143.                 domain,
  144.                 nbosses,
  145.                 msgareas,
  146.                 ncopyareas = 0,
  147.                 nled,
  148.                 nkill,
  149.                 ncapbuf,
  150.                 nRouteDef,
  151.                 MaxRouteDef,
  152.                 nimported,
  153.                 nechos,
  154.                 nnetmails,
  155.                 nnet_priv,
  156.                 nprivate,
  157.                 ntrashed,
  158.                 nseenby,
  159.                 npath,
  160.                 nreaddress,
  161.                 nnodelist,
  162.                 
  163.                 nfdbase = 0,
  164.                 
  165.                 def_days = 21,
  166.                 maildays,
  167.                 pvtboxdays,
  168.                 trashdays,
  169.                 dupedays,
  170.                 
  171.                 mailmin,
  172.                 pvtboxmin,
  173.                 trashmin,
  174.                 dupemin,
  175.                 
  176.                 loglevel,
  177.                 
  178.                 minmsgs,
  179.                 _screen = -1,
  180.                 defcrunch = AFTERSCAN,
  181.                 
  182.                 lastareawritten[N_MAXAREA],
  183.                 areafixmsgs = 0,
  184.                 
  185.                 PKTchannel[N_MAXPKT],
  186.                 
  187.                 v_handle,
  188.                 vdi_handle,
  189.                 gl_wchar,
  190.                 gl_hchar,
  191.                 gl_hbox,
  192.                 gl_wbox,
  193.                 work_in[12],
  194.                 work_out[57],
  195.                 
  196.                 __MiNT;
  197.  
  198. UWORD            maxmsgs = 0xfffeU,
  199.  
  200.                 TOSversion,
  201.                 IOSKEY_zone,
  202.                 
  203.                 *Tozone[N_AREAS],
  204.                 *Tonet[N_AREAS],
  205.                 *Tonode[N_AREAS],
  206.                 *Topoint[N_AREAS],
  207.                 
  208.                 maxPRD = 0,
  209.                 
  210.                 Tz[N_SEENS],
  211.                 Tnt[N_SEENS],
  212.                 Tne[N_SEENS],
  213.                 Tp[N_SEENS],
  214.                 
  215.                 SeenZ[N_SEENS],
  216.                 SeenN[N_SEENS],
  217.                 SeenO[N_SEENS],
  218.                 
  219.                 Pathzone[N_SEENS],
  220.                 Pathnet[N_SEENS],
  221.                 Pathnode[N_SEENS],
  222.                 
  223.                 bosszone[N_ALIAS],
  224.                 bossnet[N_ALIAS],
  225.                 bossnode[N_ALIAS],
  226.                 bosspoint[N_ALIAS],
  227.                 
  228.                 Zdomain[N_DOMAINS],
  229.                 Ndomain = 0,
  230.                 
  231.                 Zpoint[N_DOMAINS],
  232.                 Npoint = 0,
  233.                 
  234.                 Fzone, Fnet, Fnode, Fpoint, Ffake,
  235.                 Tzone, Tnet, Tnode, Tpoint, Tfake,
  236.                 fzone, fnet, fnode, fpoint,
  237.                 tzone, tnet, tnode, tpoint,
  238.                 
  239.                 c_zone, c_net, c_node, c_point, c_fakenet;
  240.                 
  241.                 PKTzone[N_MAXPKT],
  242.                 PKTnet[N_MAXPKT],
  243.                 PKTnode[N_MAXPKT],
  244.                 PKTpoint[N_MAXPKT],
  245.                 Files_to_open;            /* Files can be opened by MT */
  246.  
  247. LONG            mindiskspace,
  248.                 minpktsize,
  249.                 secs,
  250.                 bundlesize,
  251.                 pktsize,
  252.  
  253.                 g_hdr_fsize,        /* file length of current headerfile        */
  254.                 g_bod_fsize,        /* file length of current bodyfile            */
  255.                 
  256.                 g_curtime,            /* current time                                */
  257.                 
  258.                 g_offset,            /* offset in new file                        */
  259.                 
  260.                 g_dfree[MAXDRIVES],    /* to hold free space on the drives            */
  261.                 AreaSize[N_AREAS],    /* size of area after last scan             */
  262.                 
  263.                 switch_it,
  264.                 *scr1,
  265.                 *scr2,
  266.                 *oldestscr,
  267.                 
  268.                 DupeLog = 0L;
  269.  
  270. ULONG            MAXMSGLENGTH = 0x8000L,
  271.                 Ttest;
  272.  
  273. BYTE            IOSmail[40],
  274.                 InMail[40],
  275.                 OutMail[40],
  276.                 ScanMail[40],
  277.                 Consultant[40],
  278.                 LOG_line = 0,
  279.                 TEAR_buffer[512],
  280.                 
  281.                 MTask = NOTASK,
  282.  
  283.                 Todomain[N_AREAS] [30],
  284.                 
  285.                 oldmsg[80],            /* names of the log_line and header files     */
  286.                 newmsg[80],
  287.                 oldhdr[80],
  288.                 newhdr[80],
  289.  
  290.                 pkttype = STONEAGE,
  291.                 org_domain[8],
  292.                 dest_domain[8],
  293.                 
  294.                 tm_now[40],
  295.                 
  296.                 *mailarea = "",
  297.                 *trasharea = "",
  298.                 *privatebox = "",
  299.                 *dupearea = "",
  300.                 *mailtemp = "",
  301.                 *pkt_temp = "",
  302.                 *outbound = "",
  303.                 *inbound = "",
  304.                 *Inboundpaths[4],
  305.                 *Arch = "",
  306.                 *Archcmdi = "",
  307.                 *Archcmdo = "",
  308.                 *Qbbslr = "",
  309.                 *Envpath = "",
  310.                 envp[254],
  311.                 *configlabel,
  312.                 *logfile = "",
  313.                 *TRACKmsg= "",
  314.                                 
  315. #if defined EXTERNDEBUG
  316.                 *logtypes = "$%+-#?!*=~>",
  317.                 *disptypes = "$%+-#?!*=~>",
  318. #else
  319.                 *logtypes = "$%+-#?!*=~",
  320.                 *disptypes = "$%+-#?!*=~",
  321. #endif
  322.                 
  323.                 *Lzh = "",
  324.                 *Zip = "",
  325.                 *Arc = "",
  326.                 *Arj = "",
  327.                 
  328.                 *LzheC = "",
  329.                 *ZipeC = "",
  330.                 *ArceC = "",
  331.                 *ArjeC = "",
  332.                 
  333.                 *LzheA = "",
  334.                 *ZipeA = "",
  335.                 *ArceA = "",
  336.                 *ArjeA = "",
  337.                 *FDbase= "",
  338.                 
  339.                 *ToBase[N_FDBASE],
  340.                 
  341.                 SysOp[78],
  342.  
  343.                 *ROnode[N_AREAS],
  344.                 *NODElist[N_NODELIST],
  345.                 
  346.                 *Areaname[N_AREAS],
  347.                 *Lareaname[N_AREAS],
  348.                 *Areapath[N_AREAS],
  349.                 *Areaorg[N_AREAS],
  350.                 *Copyarea[N_AREAS],
  351.                 *Destarea[N_AREAS],
  352.                 *Copylegal[N_AREAS],
  353.                 *Ausername[N_AREAS],
  354.                 *Randorgfile[N_AREAS],
  355.                 Areakeep[N_AREAS],
  356.                 Areagroup[N_AREAS],
  357.                 
  358.                 mailkeep,
  359.                 trashkeep,
  360.                 pvtkeep,
  361.                 dupekeep,
  362.                 
  363.                 *Mainorg = "",
  364.                 
  365.                 *Killfrom[N_KILL],
  366.                 we_have_inbound = PROTINBOUND,
  367.                 
  368.                 *Areafix,
  369.                 *Areafixcmd,
  370.                 
  371.                 mtime[20],
  372.                 mfrom[36],
  373.                 mto[36],
  374.                 mtopic[72],
  375.                 
  376.                 *toarea,
  377.                 
  378.                 *messagebuffer,
  379.                 *messagebody,
  380.                 *Logmessage[LAST_MESSAGE],
  381.                 Dateformat[80],
  382.                 *PRDcode[256],
  383.                 
  384.                 Defaultgroup,
  385.                 
  386.                 LMSGfile[N_MAXAREA], LHDRfile[N_MAXAREA];
  387.  
  388. FILE            *LOG,
  389.                 *FDUMMY,
  390.                 *OUT,
  391.                 *PACKET,
  392.                 *MSGHDR, *MSGMSG,
  393.                 *MMSG, *MHDR,
  394.                 *FMSG, *FHDR,
  395.                 *PKTfile[N_MAXPKT],
  396.                 *LMSG[N_MAXAREA],
  397.                 *LHDR[N_MAXAREA],
  398.                 *SIZE,                    /* sizes of the areas                        */
  399.                 *LEDNEW,                /* to update led.new, area sizes part of it    */
  400.                 *LRD;                    /* last read messages per area                */
  401.  
  402. Aliases            alias[N_ALIAS];
  403. Key                pwd[N_POINTS];
  404. Dom_            Appl[N_DOMAINS];
  405. CAPTUREBUF        capbuf[N_POINTS];
  406.  
  407. MSGHEADER        hdr,
  408.                 mhdr;
  409.  
  410. READDRESS        readdress[N_POINTS];
  411.  
  412. struct tm            *tijd;
  413. struct ffblk        blok;
  414. struct stat            stbuf;
  415. struct _pkthdr        phdr;
  416. struct _phdr2        phdr2;
  417. struct _pktmsg        pmsg;
  418. struct _RouteDef    *RouteDef;
  419. struct _ndi            *nodeidx;
  420.  
  421. CONST BYTE        *isuf[] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA", NULL},
  422.                 *ArcMail[] = {"ARCmail", "LZHmail", "ZIPmail", "UNKNOWN", "ARJmail"};
  423.                 
  424. CONST BYTE        *Mtasker[] = {"MultiGEM", "Mint", NULL};
  425.  
  426.