home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / i / imail135.zip / IM_DEV.ZIP / IM_STRUC.PAS < prev   
Pascal/Delphi Source File  |  1992-12-20  |  25KB  |  433 lines

  1. {=========================================================================}
  2. {=========================================================================}
  3. {                                                                         }
  4. {                     IMAIL DEFINITIONS AND STRUCTURES                    }
  5. {                            for IMAIL = 1.35                             }
  6. {                                                                         }
  7. {=========================================================================}
  8. {                                                                         }
  9. {  * The contents of this file are subject to change without notice!      }
  10. {  * Fields marked reserved should NOT be used.                           }
  11. {  * It is an ERROR to write to any of the configuration files            }
  12. {  * while IMAIL (or any of its companion programs) is running.           }
  13. {  *                                                                      }
  14. {  * Copyright (C) 1992 by IMAIL INC. All rights reserved.                }
  15. {                                                                         }
  16. {=========================================================================}
  17.  
  18. {=========================================================================}
  19. {  CONSTANT DEFINITIONS                                                   }
  20. {=========================================================================}
  21.  
  22. const IM_MAJ_VERSION = 1;
  23.       IM_MIN_VERSION = 35;
  24.       IM_PRD_CODE    = $4B;
  25.  
  26. {-------------------------------------------------------------------------}
  27. {  Internal limits                                                        }
  28. {-------------------------------------------------------------------------}
  29.  
  30. const  MAXAKAS     = 16;                   { Max # of addresses           }
  31.        MAXPACKERS  = 11;                   { Max # of packer def          }
  32.        MAXEXPORT   = 60;                   { Max export defs              }
  33.        MAXVIA      = 40;                   { max nodes packed via         }
  34.        MAXPACK     = 32;                   { max default pack cmd         }
  35.        MAXEXCEPT   = 10;                   { max EXCEPT nodes             }
  36.        MAXFWDLINK  = 10;                   { max fwd link structs         }
  37.        MAXNOIMPT   = 20;                   { max # of names               }
  38.        ZONESDOM    = 10;                   { zones per domain entry       }
  39.        MAXTAG      = 51;                   { Max length of an areatag     }
  40.        MAXNAME     = 37;                   { Max length of a namefield    }
  41.        MAXPACKNAME = 50;                   { Max length of a packer entry }
  42.        MAXORIGIN   = 64;                   { Max length of an origin      }
  43.  
  44.        MAXPATH     = 80;                   { Max length of path           }
  45.        MAXFILE     = 11;                   { Max length of file           }
  46.        MAXEXT      = 3;                    { Max length of extension      }
  47.        MAXFNAME    = MAXFILE+MAXEXT;       { Max length of a filename     }
  48.        MAXDOMAIN   = 21;                   { Max length of a domainname   }
  49.        MAXPWD      = 21;                   { Max length of a password     }
  50.  
  51. {-------------------------------------------------------------------------}
  52. {  Log Style Definitions                                                  }
  53. {-------------------------------------------------------------------------}
  54.  
  55. const  LOG_NORMAL  = 0;                    { normal log level             }
  56.        LOG_VERBOSE = 1;                    { verbose log level            }
  57.  
  58. {-------------------------------------------------------------------------}
  59. {  Environment Type  (FroDo or Bink)                                      }
  60. {-------------------------------------------------------------------------}
  61.  
  62. const  ENV_FRODO   = 0;                    { FrontDoor/D'Bridge           }
  63.        ENV_BINK    = 1;                    { Binkley                      }
  64.  
  65. {-------------------------------------------------------------------------}
  66. { Sort Method (used in IMTHINGS SORT)                                     }
  67. {-------------------------------------------------------------------------}
  68.  
  69. const  A_SORT_NAME  = 1;
  70.        A_SORT_BOARD = 2;
  71.        A_SORT_GROUP = 3;
  72.  
  73. {-------------------------------------------------------------------------}
  74. {  File Attach Message Status (used in IMAIL.ND)                          }
  75. {-------------------------------------------------------------------------}
  76.  
  77. const  S_NORMAL       = 0;
  78.        S_HOLD         = 1;
  79.        S_CRASH        = 2;
  80.  
  81. {-------------------------------------------------------------------------}
  82. {  Message Base Types                                                     }
  83. {-------------------------------------------------------------------------}
  84.  
  85. const  MSGTYPE_SDM    = $01;
  86.        MSGTYPE_SQUISH = $02;
  87.        MSGTYPE_HUDSON = $03;
  88.        MSGTYPE_QBBS   = $03;
  89.        MSGTYPE_PASSTH = $0F;
  90.        MSGTYPE_ECHO   = $80;
  91.        MSGTYPE_LOCAL  = $90;
  92.        MSGTYPE_NET    = $A0;
  93.  
  94. {-------------------------------------------------------------------------}
  95. {  Via Line Switches                                                      }
  96. {-------------------------------------------------------------------------}
  97.  
  98. const VIA_NONE        =   0;
  99.       VIA_EXP         =   1;
  100.       VIA_IMP         =   2;
  101.       VIA_BOTH        =   3;
  102.  
  103. {-------------------------------------------------------------------------}
  104. {  Dupe ring check switches                                               }
  105. {-------------------------------------------------------------------------}
  106.  
  107. const DUPE_NONE       =   0;
  108.       DUPE_WARN       =   1;
  109.       DUPE_ZONE       =   2;
  110.       DUPE_KILL       =   3;
  111.  
  112. {-------------------------------------------------------------------------}
  113. {  Unlink Switches                                                        }
  114. {-------------------------------------------------------------------------}
  115.  
  116. const ULNK_NONE       =   0;
  117.       ULNK_PASSTH     =   1;
  118.       ULNK_ALL        =   2;
  119.  
  120. {-------------------------------------------------------------------------}
  121. {  Exit Errorlevels & Error Messages                                      }
  122. {-------------------------------------------------------------------------}
  123.  
  124. const  E_NOERR        =   0;               { no error                     }
  125.        E_ELOCK        = 239;               { File locking error           }
  126.        E_AOPEN        = 240;               { Error opening IMAIL.AX       }
  127.        E_BOPEN        = 241;               { Error opening IMAIL.BX       }
  128.        E_NOIDX        = 242;               { Index file missing/corrupt   }
  129.        E_NOCFG        = 243;               { IMAIL.CF not found           }
  130.        E_NOARE        = 244;               { IMAIL.AR not found           }
  131.        E_NONOD        = 245;               { IMAIL.ND not found           }
  132.        E_BADCF        = 246;               { Error in IMAIL.CF            }
  133.        E_BADVR        = 247;               { Bad version of IMAIL.CF      }
  134.        E_EOPEN        = 248;               { Error opening file           }
  135.        E_EREAD        = 249;               { Error reading file           }
  136.        E_EWRIT        = 250;               { Error writing file           }
  137.        E_CMDPR        = 251;               { Command Line Parameter error }
  138.        E_FILNF        = 252;               { File not found               }
  139.        E_MEMRY        = 253;               { Memory Allocation error      }
  140.        E_DISKF        = 254;               { Insufficient disk space      }
  141.        E_UNKWN        = 255;               { Unknown error                }
  142.  
  143. {-------------------------------------------------------------------------}
  144. {  Special values for 'ALL'                                               }
  145. {-------------------------------------------------------------------------}
  146.  
  147. const  ZONE_ALL       = 56685;             { Pack for all zones           }
  148.        NET_ALL        = 56685;             { Pack for all nets            }
  149.        NODE_ALL       = 56685;             { Pack for all nodes           }
  150.        POINT_ALL      = 56685;             { Pack for all points          }
  151.  
  152. {-------------------------------------------------------------------------}
  153. {  Capability defintions                                                  }
  154. {-------------------------------------------------------------------------}
  155.  
  156. const  CAP_TYPE2      = $01;               { Can make Type 2 bundles      }
  157.        CAP_STONAGE    = $00;               { No capabalities              }
  158.  
  159.  
  160. {=========================================================================}
  161. {  STRUCTURE DEFINITIONS                                                  }
  162. {=========================================================================}
  163.  
  164. {-------------------------------------------------------------------------}
  165. {  Structs used in IMAIL Configuration files                              }
  166. {-------------------------------------------------------------------------}
  167.  
  168. TYPE
  169.  
  170.    areatag    = array [1..MAXTAG] of char;
  171.  
  172.    origin_typ = array [1..MAXORIGIN] of char;
  173.  
  174.    path_typ   = array [1..MAXPATH] of char;
  175.  
  176.    packer_typ = array [1..MAXPACKNAME] of char;
  177.  
  178.    naddress = record                       { std node number ...          }
  179.      zone  : word;                         { Zone Number                  }
  180.      net   : word;                         { Net Number                   }
  181.      node  : word;                         { Node Number                  }
  182.      point : word;                         { Point Number                 }
  183.    end;
  184.  
  185.    pack_struct = record                       { used in pack routing      }
  186.      dst    : naddress;                       { pack via this node        }
  187.      nodes  : array [1..MAXVIA] of naddress;  { nodes to pack             }
  188.      except : array[1..MAXEXCEPT] of naddress;{ exceptions                }
  189.    end;
  190.  
  191.    eaddress = record
  192.      dstn      : naddress;                 { destination-address          }
  193.      bitfield1 : byte;
  194.    { exp_only  : bit_0;                      export only to this address  }
  195.    { imp_only  : bit_1;                      import only from this address}
  196.    { paused    : bit_2;                      echomail paused              }
  197.    { reserved  : bit_3-7;                    reserved                     }
  198.    end;
  199.  
  200.    fwd_link = record                          { used for forward requests }
  201.      areasfile : array [1..MAXFNAME] of char;  { name of areas file        }
  202.      toprogram : array [1..10] of char;       { name of area manager      }
  203.      password  : array [1..MAXPWD] of char;   { area manager password     }
  204.      uplink    : naddress;                    { address of uplink         }
  205.    end;
  206.  
  207.    dom      = record
  208.      domain    : array [1..MAXDOMAIN] of char;{ name of domain            }
  209.      outbound  : array [1..MAXPATH] of char;  { root outbound path        }
  210.      zones     : array [1..ZONESDOM] of word; { zones in this domain      }
  211.      akas      : array [1..MAXAKAS] of byte;  { =my= akas in this domain  }
  212.    end;
  213.  
  214.    im_stats = record                          { Used mainly by IUTIL      }
  215.      th_day   : word;                         { this day                  }
  216.      la_day   : word;                         { last day                  }
  217.      th_week  : word;                         { this week                 }
  218.      la_week  : word;                         { last week                 }
  219.      th_month : word;                         { this month                }
  220.      la_month : word;                         { last month                }
  221.      th_year  : word;                         { this year                 }
  222.      la_year  : word;                         { last year                 }
  223.    end;
  224.  
  225. {-------------------------------------------------------------------------}
  226. {  IMAIL.CF Structure                                                     }
  227. {-------------------------------------------------------------------------}
  228.  
  229. TYPE
  230.  
  231. im_config_type = record
  232.   im_ver_maj   : byte;                        { Major Version             }
  233.   im_ver_min   : byte;                        { Minor Version             }
  234.   sysop        : array [1..MAXNAME] of char;  { name of sysop             }
  235.   rsvd1        : byte;                        { reserved                  }
  236.   rsvd2        : byte;                        { reserved                  }
  237.   rsvd3        : byte;                        { reserved                  }
  238.   aka          : array [1..MAXAKAS] of naddress;
  239.                                               { the AKAs                  }
  240.   domains      : array [1..MAXAKAS] of dom;   { domain names & zones      }
  241.   prod         : array [1..10] of byte;       { Type 2+ product codes     }
  242.   rsvd4        : byte;                        { reserved                  }
  243.   rsvd5        : byte;                        { reserved                  }
  244.   rsvd6        : byte;                        { reserved                  }
  245.   netmail      : path_typ;                    { net mail subdirectory     }
  246.   netfile      : path_typ;                    { inbound files directory   }
  247.   in_pkt       : path_typ;                    { Dir for inbound PKTs      }
  248.   out_pkt      : path_typ;                    { Dir for outbound PKTs     }
  249.   outbound     : path_typ;                    { outbound directory        }
  250.   quickbbs     : path_typ;                    { QuickBBS system directory }
  251.   rsvd7        : path_typ;                    { reserved                  }
  252.   rsvd8        : path_typ;                    { reserved                  }
  253.   rsvd9        : path_typ;                    { reserved                  }
  254.   semaphor     : path_typ;                    { Semaphor directory        }
  255.   logfilename  : path_typ;                    { Log file name             }
  256.   alnk_help    : array [1..MAXFNAME] of char; { AreaLink help text        }
  257.   new_areas    : array [1..MAXFNAME] of char; { name of file for new areas}
  258.   pwd_exp_days : word;                        { days before pwd expired   }
  259.   max_pkt_size : word;                        { max size of pkt to create }
  260.   max_dupes    : word;                        { max dupes kept in dbase   }
  261.   log_level    : byte;                        { logging level             }
  262.   bitfield1    : byte;                        { has been changed from 1.10}
  263. {  rtnrecpt     : bit_0;                        True if to send rtn recpt }
  264. {  checkbad     : bit_1;                        True if to check badmsgs  }
  265. {  ARCmail06    : bit_2;                        ARCmail 0.6 compatibility }
  266. {  environment  : bit_3;                        FroDo or Binkley          }
  267. {  pkt_open     : bit_4;                        Keep PKT files open       }
  268. {  auto_add     : bit_5;                        Auto-add unknown areas    }
  269. {  multi_task   : bit_6;                        TRUE if multi-tasking     }
  270. {  forward_for  : bit_7;                        forward PKTs not for us   }
  271.   bitfield2    : byte;
  272. {  singleextract: bit_0;                        extract 1 bundle at a time}
  273. {  trunc_sent   : bit_1;                        1 = Trunc 0 = Delete      }
  274. {  keep_recpt   : bit_2;                        keep areafix message      }
  275. {  prodnames    : bit_3;                        use product names         }
  276. {  swap_ems     : bit_4;                        swap to EMS               }
  277. {  swap_ext     : bit_5;                        swap to extended memory   }
  278. {  newarea_passth: bit_6;                       set new areas to passth   }
  279. {  reserved     : bit_7;                        reserved                  }
  280.   bitfield3    : byte;
  281. {  direct_video : bit_0;                        use direct screen i/o     }
  282. {  forward_req  : bit_1;                        Execute forward link req. }
  283.   newarea_group: char;                        { new areas default group   }
  284.   dflt_origin  : origin_typ;                  { default origin line       }
  285.   before_toss  : path_typ;                    { call before proc. PKTs    }
  286.   last_run     : longint;                     { last run of IUTIL STAT    }
  287.   sem_timeout  : byte;                        { timeout for IMBUSY.NOW    }
  288.   via_line     : byte;                        { add Via Line to netmails  }
  289.   dupe_ring    : byte;                        { Check for possible d-rings}
  290.   no_import    : array [1..MAXNOIMPT] of array [1..38] of char;
  291.                                               { ignore when importing     }
  292.   packers      : array [1..MAXPACKERS] of packer_typ;
  293.                                               { Packer defintions         }
  294.   arcunpak     : packer_typ;                  { cmd to de-arc .ARC files  }
  295.   arjunpak     : packer_typ;                  { cmd to de-arc .ARJ files  }
  296.   pkpakunpak   : packer_typ;                  { cmd to de-arc .PKA files  }
  297.   pkzipunpak   : packer_typ;                  { cmd to de-arc .ZIP files  }
  298.   lharcunpak   : packer_typ;                  { cmd to de-arc .LZH files  }
  299.   zoounpak     : packer_typ;                  { cmd to de-arc .ZOO files  }
  300.   pakunpak     : packer_typ;                  { cmd to de-arc .PAK files  }
  301.   sqzunpak     : packer_typ;                  { cmd to de-arc .SQZ files  }
  302.   unkunpak     : packer_typ;                  { cmd to de-arc unknown files}
  303.   pack         : array [1..MAXPACK] of pack_struct;
  304.                                               { default PACK routing      }
  305.   fwd          : array [1..MAXFWDLINK] of fwd_link;
  306.                                               { forward link requests     }
  307.   unlink_req   : byte;                        { Unlink areas without dlink}
  308.   semaphor_net : array [1..MAXFNAME] of char; { Netmail rescan semaphor file}
  309.   maint_help   : array [1..MAXFNAME] of char; { Alnk Remote Maint. Helpfile}
  310.   pers_mail    : byte;                        { use personal mail feature }
  311.   keep_alnk_req: byte;                        { keep arealink request     }
  312.   max_arcmail_size : word;                    { max size of arcmail bundles}
  313.   max_msg_size : byte;                        { max size of netmail (split)}
  314.   filler       : array [1..126] of char;      { reserved                  }
  315. end;
  316.  
  317.  
  318. {-------------------------------------------------------------------------}
  319. {  IMAIL.AR Structure                                                     }
  320. {-------------------------------------------------------------------------}
  321.  
  322. TYPE
  323.  
  324. areas_record_type = record
  325.   aname         : areatag;                      { area name               }
  326.   comment       : array [1..61] of char;        { area comment            }
  327.   origin        : origin_typ;                   { origin line to use      }
  328.   group         : char;                         { area group              }
  329.   o_addr        : byte;                         { address for origin      }
  330.   use_akas      : array [1..MAXAKAS] of char;   { addresses for seen-bys  }
  331.   msg_base_type : byte;                         { message base type       }
  332.   brd           : byte;                         { board number            }
  333.   msg_path      : path_typ;                     { MSG directory           }
  334.   bitfield1     : byte;
  335. {  active        : bit_0;                         flag area active        }
  336. {  zone_gate     : bit_1;                         Zone-gate stripping     }
  337. {  tiny_seen     : bit_2;                         tiny seen-by flag       }
  338. {  secure        : bit_3;                         secure flag             }
  339. {  keep_seen     : bit_4;                         keep seen-by flag       }
  340. {  deleted       : bit_5;                         flag deleted area       }
  341. {  auto_added    : bit_6;                         flag auto-added record  }
  342. {  mandatory     : bit_7;                         area is mandatory       }
  343.   bitfield2     : byte;                         {                         }
  344. {  read_only     : bit_0;                         area is read only       }
  345. {  unlinked      : bit_1;                         area has been unlinked  }
  346. {  ulnk_req      : bit_2;                         perform unlinked requests?}
  347. {  hidden        : bit_3;                         area ist hidden         }
  348.   iutil_bits    : byte;                         { bits for IUTIL          }
  349.   user_bits     : byte;                         { 8-bit useravailable bits}
  350.   days          : byte;                         { days to keep messages   }
  351.   msgs          : word;                         { num messages to keep    }
  352.   t_stats       : im_stats;                     { TOSS stats              }
  353.   s_stats       : im_stats;                     { SCAN stats              }
  354.   d_stats       : im_stats;                     { dupe statistics         }
  355.   creation      : longint;                      { date/time of creation   }
  356.   update        : longint;                      { last update by STAT     }
  357.   marked        : longint;                      { used by IUTIL           }
  358.   filler        : array [1..10] of char;
  359.   export        : array [1..MAXEXPORT] of eaddress; { export list             }
  360. end;
  361. { Notes: The entries in 'o_addr' and 'use_akas' are indexes into the
  362.          list of AKAs in IMAIL.CF, minus 1. eg:
  363.               im_config.aka[o_addr-1]
  364.          A value of 0 means 'no address'.
  365. }
  366.  
  367. {-----------------------------------------------------------------------}
  368. {  IMAIL.ND Structure                                                   }
  369. {-----------------------------------------------------------------------}
  370.  
  371. TYPE
  372.  
  373. node_record_type = record
  374.   dstn          : naddress;                 { Node to pack for            }
  375.   sysop         : array [1..MAXNAME] of char;{ name of sysop               }
  376.   domain        : char;                     { index to domain             }
  377.   pwd           : array [1..MAXPWD] of char;{ AreaFix/Bndl password       }
  378.   status        : char;                     { Status of file attach msg   }
  379. { Packprogram was originally named "program" ! }
  380.   Packprogram   : char;                     { packer to use ("packers")   }
  381.   groups        : array [1..27] of char;    { groups node can request     }
  382.   capability    : word;                     { capability word for node    }
  383.   bitfield1     : byte;
  384. {  allow_remote  : bit_0;                     allow remote maint.         }
  385. {  direct        : bit_1;                     Mark ARCmail as direct      }
  386. {  auto_cap      : bit_2;                     auto-detect capability      }
  387. {  auto_added    : bit_3;                     record added by IMAIL       }
  388. {  newarea_add   : bit_4;                     auto add to new areas       }
  389. {  newarea_create: bit_5;                     create new areas            }
  390. {  Rescan_ok     : bit_6;                     allow node to rescan        }
  391. {  Notify        : bit_7;                     send notify messages        }
  392.   bitfield2     : byte;
  393. {  rsvd1         : bit_0;                                                 }
  394. {  rsvd2         : bit_1;                                                 }
  395. {  forward_req   : bit_2;                     send forward requests?      }
  396.   user_bits     : word;                     { 16 user-available bits      }
  397.   newarea_group : char;                     { group for autoadded area    }
  398.   pkt_password  : array [1..9] of char;     { password to include in PKTs }
  399.   last_pwd_change: longint;                 { time ALNK pwd last changed  }
  400.   filler        : array [1..20] of char;
  401. end;
  402.  
  403. {-----------------------------------------------------------------------}
  404. {  IMAIL.GR Structure                                                   }
  405. {-----------------------------------------------------------------------}
  406.  
  407. TYPE
  408.  
  409. group_record_type  = record
  410.   grp_desc      : array[1..27] of char;     { Group description           }
  411.   msg_base_type : byte;                     { message base type           }
  412.   msg_path      : path_typ;                 { MSG/Squish path             }
  413.   bitfield1     : byte;
  414. {  active       : bit_0;                      flag area active            }
  415. {  zone_gate    : bit_1;                      Zone-gate stripping         }
  416. {  tiny_seen    : bit_2;                      tiny seen-by flag           }
  417. {  secure       : bit_3;                      secure flag                 }
  418. {  keep_seen    : bit_4;                      keep seen-by flag           }
  419. {  mandatory    : bit_5;                      area is mandatory           }
  420. {  read_only    : bit_6;                      area is read only           }
  421. {  ulnk_req     : bit_7;                      perform unlinked requests?  }
  422.   bitfield2     : byte;
  423. {  hidden       : bit_0;                      area is hidden              }
  424.    days         : byte;                     { days to keep messages       }
  425.    msgs         : word;                     { num messages to keep        }
  426.    filler       : array[1..20] of char;     { reserved                    }
  427. end;
  428.  
  429.  
  430. { end of IMAIL-structures }
  431. {-----------------------------------------------------------------------}
  432.  
  433.