home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / misc / rf911215.lha / flow.prn < prev    next >
Encoding:
Text File  |  1991-12-15  |  27.3 KB  |  654 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.      ¢1mNAME 
  8.           ¢0mflow - manage the outbound directory 
  9.  
  10.      ¢1mSYNOPSIS 
  11.  
  12.        ¢0mAllocation 
  13.  
  14.             ¢1mvoid FreeWorkNode¢0m(¢1msomework¢0m), ¢1mFloBase
  15.              ¢0m--                d0          a6
  16.               work_detail_node *somework;
  17.  
  18.             ¢1mvoid FreeDetail¢0m(¢1mdetail¢0m),     ¢1mFloBase
  19.              ¢0m--              d0            a6
  20.               work_detail *detail;
  21.  
  22.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mAllocDetail¢0m(),  ¢1mFloBase
  23.                 ¢0md0                         a6
  24.  
  25.        Enqueuing 
  26.  
  27.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mAddWork¢0m(¢1mdetail¢0m,¢1mfile¢0m,¢1mflag¢0m), ¢1mFloBase
  28.                  ¢0md0                    d0    d1    a0      a6
  29.               work_detail *detail;
  30.               char *file;
  31.               int flag;
  32.  
  33.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mAddWorkName¢0m(¢1mdetail¢0m,¢1mfile¢0m,¢1masfile¢0m,¢1mflag¢0m), ¢1mFloBase
  34.                  ¢0md0                         d0    d1    a0    a1      a6
  35.               work_detail *detail;
  36.               char *file;
  37.               char *asname;
  38.               int flag;
  39.  
  40.        Traversing 
  41.  
  42.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseOldWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  43.                  ¢0md0                                  d0       a6
  44.               work_detail *detail;
  45.  
  46.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseNewWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  47.                  ¢0md0                                  d0       a6
  48.               work_detail *detail;
  49.  
  50.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mFindWork¢0m(¢1mlastwork¢0m),           ¢1mFloBase
  51.                 ¢0md0                       d0                  a6
  52.               work_detail_node *lastwork;
  53.  
  54.             ¢1mvoid EndTraverseWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  55.              ¢0m--                    d0       a6
  56.               work_detail *detail;
  57.  
  58.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseSlowWork¢0m(¢1mdetail¢0m),¢1mFloBase
  59.                  ¢0md0                                  d0       a6
  60.               work_detail *detail;
  61.  
  62.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mNextSlowTraverse¢0m(¢1mdetail¢0m,¢1moldwork¢0m), ¢1mFloBase
  63.  
  64.  
  65. ¢0m     Sandelman Software               -1-                          Rev. 2.2
  66.  
  67.  
  68.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  69.  
  70.  
  71.                  d0                              d0     d1        a6
  72.               work_detail *detail;
  73.               work_detail_node *oldwork;
  74.  
  75.             ¢1mvoid EndTraverseSlowWork¢0m(¢1mdetail¢0m),  ¢1mFloBase ¢0m**¢1mOBSOLETE¢0m**
  76.              --                        d0                     a6
  77.               work_detail *detail;
  78.  
  79.             ¢1mvoid EndTraverseSlowWorkDetail¢0m(¢1mdetail¢0m,¢1moldwork¢0m), ¢1mFloBase
  80.              ¢0m--                             d0      d1        a6
  81.               work_detail *detail;
  82.               work_detail_node *oldwork;
  83.  
  84.        Queue rendezvous 
  85.  
  86.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mFindDetail¢0m(¢1maSite¢0m), ¢1mFloBase
  87.                  ¢0md0                  d0      a6
  88.               site *aSite;
  89.  
  90.  
  91.        Scanning outbound 
  92.  
  93.             ¢1mint ScanOutbound¢0m(¢1moutbound¢0m),    ¢1mFloBase
  94.              ¢0md0               d0             a6
  95.               char *outbound;
  96.  
  97.  
  98.             ¢1mvoid DumpOutbound¢0m(¢1moutbound¢0m),   ¢1mFloBase
  99.              ¢0m--               d0             a6
  100.               char *outbound;
  101.  
  102.  
  103.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mBeginTraverseOutbound¢0m(), ¢1mFloBase
  104.              ¢0md0                                     a6
  105.  
  106.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mFindOutbound¢0m(¢1mdetail¢0m),    ¢1mFloBase
  107.              ¢0md0                        d0           a6
  108.  
  109.             ¢1mvoid EndTraverseOutbound¢0m(),           ¢1mFloBase
  110.              ¢0m--                                     a6
  111.  
  112.  
  113.        Configuration 
  114.  
  115.             ¢1mvoid SetDefaultAddress¢0m(¢1msite¢0m),         ¢1mFloBase
  116.              ¢0m--                     d0              a6
  117.               site *site;
  118.  
  119.             ¢1msite ¢0m*¢1mGetDefaultAddress¢0m(),            ¢1mFloBase
  120.              ¢0md0                                     a6
  121.  
  122.             ¢1mvoid SetOutbound¢0m(¢1moutbounddir¢0m),        ¢1mFloBase
  123.              ¢0m--                d0                   a6
  124.               char *outbounddir;
  125.  
  126.             ¢1mchar ¢0m*¢1mGetOutbound¢0m(),                  ¢1mFloBase
  127.              ¢0md0                                     a6
  128.  
  129.  
  130.  
  131.      Sandelman Software               -2-                          Rev. 2.2
  132.  
  133.  
  134.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  135.  
  136.  
  137.        Miscelaneous 
  138.  
  139.             ¢1mint  DetailCount¢0m(¢1mdetail¢0m),             ¢1mFloBase
  140.              ¢0md0               d0                    a6
  141.               work_detail *detail;
  142.  
  143.             ¢1mint  DetaaxMinPri¢0m(¢1mdetail¢0m),            ¢1mFloBase
  144.              ¢0md0                d0                   a6
  145.               work_detail *detail;
  146.  
  147.             ¢1mvoid KillRequest¢0m(¢1mdetail¢0m),             ¢1mFloBase
  148.              ¢0m--                d0                   a6
  149.               work_detail *detail;
  150.  
  151.             ¢1mint  ChangeDetailPri¢0m(¢1mdetail¢0m,¢1mdetail¢0m_¢1mnode¢0m,¢1mpri¢0m)
  152.              d0                    d0     d1         a0
  153.               work_detail *detail;
  154.               work_detail_node *detail_node
  155.               int pri;
  156.  
  157.  
  158.  
  159.      ¢1mA Brief Overview 
  160.  
  161.                Flow¢0m.¢1mlibrary  ¢0m(known  as  ¢1mflo200¢0m.¢1mlibrary  ¢0min  revisions
  162.           before 4.0) maintains a queue of outbound files that need to
  163.           be sent to different remote sites.  Typically,  these  sites
  164.           are  named within Fidonet-like technology's definition of an
  165.           address: that of domain, zone,  net,  node  and  point,  but
  166.           there  is no structural limitation to keep flow.library from
  167.           being used for other addressing systems.  
  168.  
  169.  
  170.                In its library base, a list  header  is  kept  (with  a
  171.           semaphore to  mediate  access).  Members of this list are of
  172.           type ¢3mwork_detail ¢0mand hold the contents of  a  single  queue.
  173.           All  requests  for the queue structure for a particular site
  174.           return the same structure.  A second semaphore is exists  to
  175.           mediate  access  to the queue contents (hereafter called the
  176.           "work detail") 
  177.  
  178.                The actually list of files to be  sent  is  not  always
  179.           present  in  memory,  but  rather  is  kept  on  disk, to be
  180.           retrieved when access to that queue is desired.  During  the
  181.           initial  scanning phase, merely the ¢1mexistance ¢0mof an outbound
  182.           file (file names ending  in  .FLOW,  and  if  enabled,  also
  183.           Opus/Binkley  style .xLO files where x is one of F, H, C, or
  184.           D) is noted.  
  185.  
  186.                When the work detail's contents are actually  accessed,
  187.           the   fact  that  un-read  files  exist  is  noted  and  the
  188.           appropriate file(s) are opened and read in.  The queue files
  189.           are either deleted, or  if  the  library  is  compiled  with
  190.           suitable compiler flags, renamed to a harmless name to serve
  191.           as backup.  
  192.  
  193.                At  this  point,  the  work  detail is considered to be
  194.           dirty, and an up-to-date *.¢1mFLOW ¢0mdoes not exist as yet.  (The
  195.  
  196.  
  197.      Sandelman Software               -3-                          Rev. 2.2
  198.  
  199.  
  200.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  201.  
  202.  
  203.           previous .FLOW file may not be accurate, as things may  have
  204.           been  added  via the 2D .FLO files) After the queue has been
  205.           processed in some way, an eventual call is made to a routine
  206.           that attemps to update the disk version of any modified work
  207.           details.  A new .FLOW file is produced if there is something
  208.           to write out.  Regardless, the in-memory  version  continues
  209.           to exist until the library is expunged out of memory.  
  210.  
  211.                The  next  time  that  a  program  wants  to access the
  212.           outbound queue, it too asks to have  to  outbound  directory
  213.           scanned  --- but this time, only Opus/Binkley style 2D files
  214.           are noticed (if this is  currently  enabled,  more  on  this
  215.           later).   The  .FLOW  files are assumed to be either totally
  216.           resident in memory (in which  case  reading  them  in  again
  217.           would  just produce duplicate queue entries) or at least, to
  218.           already have a work detail header that points to them.  
  219.  
  220.                Because changes on the disk to .FLOW files are not paid
  221.           attention to past the first scan, all modifications  to  the
  222.           queue should be done through ¢1mflow¢0m.¢1mlibrary ¢0mand not by playing
  223.           with the  disk.  The format of the .FLOW files (while fairly
  224.           simple) is not defined.  
  225.  
  226.                However, there still  exists  lots  of  software  (e.g.
  227.           ConfMail,  oMMM,  FastPoint,  Paragon,  etc.),  and likely a
  228.           mailer or two that do not support flow.library,  and  expect
  229.           to be  able  to  produce  2D .?LO files.  Since ¢1mflow¢0m.¢1mlibrary
  230.           ¢0munderstands the 2D files, it has no problem managing to send
  231.           them (however, it must make certain  assumptions  about  the
  232.           zone  and  domain,  and  the point portion of the address is
  233.           assumed to be zero.  The zone  is  taken  from  the  default
  234.           address supplied to ¢1mflow¢0m.¢1mlibrary¢0m), but programs that wish to
  235.           also read them (old mailers, old packers that do not wish to
  236.           list  a  compressed bundle twice) must somehow be allowed to
  237.           see .?LO files.  
  238.  
  239.                In order to  allow  .?LO  files  to  exist,  unmolested
  240.           (their  contents  can  be  deduced from the appropriate work
  241.           detail), a flag exists within ¢1mflow¢0m.¢1mlibrary ¢0mto  cause  it  to
  242.           ignore .?LO  files.    Unfortunately,  ¢1mflow¢0m.¢1mlibrary ¢0msupports
  243.           many options (numeric  priorities,  rather  than  antiquated
  244.           notions  of  'Crash  Mail'  versus  'Direct  Mail'), and the
  245.           ability to send a given file  under  a  second  name,  (This
  246.           allows  Welmat to make no special provisions for .OUT files,
  247.           or UUCP's remote execution packets (X.*) files.    They  are
  248.           simply files sent with a given name.) as well as having mail
  249.           for  a  point,  not all of the entries can be translated, so
  250.           only those entries which  fit  are  changed  by  the  ¢1munflow
  251.           ¢0mprogram.  
  252.  
  253.      ¢1mTwo Queues 
  254.  
  255.                ¢0mOne  problem  with  lists and the like is that programs
  256.           need to be  able  to  traverse  them  safely,  at  different
  257.           speeds.   A  mailer  may  take fifteen minutes to completely
  258.           traverse the list, but one must still be  able  to  add  and
  259.           delete entries  from  the list.  The author doesn't claim to
  260.           have thought of every single case, there are certainly  some
  261.  
  262.  
  263.      Sandelman Software               -4-                          Rev. 2.2
  264.  
  265.  
  266.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  267.  
  268.  
  269.           esoteric cases that haven't been dealt with, but in order to
  270.           provide the most safety, two methods of traversing the queue
  271.           exist: the fast way, and the slow way.  
  272.  
  273.        The Fast Way 
  274.  
  275.                The  fast  way  simply  locks  the  whole queue for the
  276.           duration of the search, the traversee effectively  owns  the
  277.           list, and  all other traversees will wait.  Traversal of the
  278.           lists this way is assumed to be a very fast search, anything
  279.           that wants to deal with each entry  extensively  should  not
  280.           use it.  
  281.  
  282.        The Slow Way 
  283.  
  284.                The  slower  way  assumes that something is going to be
  285.           done with each entry (such as sending the file).    It  does
  286.           not  lock  the  list for the duration of the traversal, only
  287.           while moving from one entry to the next.  
  288.  
  289.                The current position in the queue is kept by  returning
  290.           the  first  entry on the ¢3mnew ¢0mlist, and moving it to the tail
  291.           of the ¢3mold ¢0mlist when the traversee  moves  on  to  the  next
  292.           entry.  
  293.  
  294.                During  processing,  the entry is left on the ¢3mnew ¢0mlist,
  295.           but the ¢1mstatus ¢0mflag is changed to mark this entry  as  being
  296.           ¢3min-transit.   ¢0mWhen processing of this entry is finished, the
  297.           ¢1mstatus ¢0mflag should be set to reflect what  has  happened  to
  298.           the  entry,  that  is,  was  it  sent, was it refused (why),
  299.           etc...  Should the entry still be set to ¢3min-transit ¢0mit  will
  300.           be reset to ¢3mnot-sent.  
  301.  
  302.                ¢0mAfter  each  traversee finishes the list (and there may
  303.           be more than one program traversing the list),  any  entries
  304.           on  the ¢3mold ¢0mlist that are not of type ¢3msent ¢0mare moved back to
  305.           the ¢3mnew ¢0mlist.  
  306.  
  307.  
  308.      ¢1mDetail documentation 
  309.  
  310.        ¢0mAllocation 
  311.  
  312.             ¢1mvoid FreeWorkNode¢0m(¢1msomework¢0m), ¢1mFloBase
  313.              ¢0m--                d0          a6
  314.               work_detail_node *somework;
  315.  
  316.  
  317.                Frees up a  queue  entry,  getting  its  size  from  an
  318.           internal field.    Should  be  rarely called, as most of the
  319.           management is done internally.    Returns  nothing  usefull.
  320.           The argument may be NULL, in which case, nothing is done.  
  321.  
  322.  
  323.             ¢1mvoid FreeDetail¢0m(¢1mdetail¢0m),     ¢1mFloBase
  324.              ¢0m--              d0            a6
  325.               work_detail *detail;
  326.  
  327.  
  328.  
  329.      Sandelman Software               -5-                          Rev. 2.2
  330.  
  331.  
  332.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  333.  
  334.  
  335.                Attempts to  free up a ¢1mwork¢0m_¢1mdetail ¢0mstructure.  While it
  336.           does not  return  anything  usefull,  it  may  not  actually
  337.           succeed  in freeing the memory --- this not of importance to
  338.           the caller though.  This  routine  lowers  the  current  use
  339.           count  by one (doing appropriate locking) and then, provided
  340.           there are no more users, frees the memory used  by  the  new
  341.           and old queues by calling ¢1mFreeWorkNode ¢0mfor each.  
  342.  
  343.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mAllocDetail¢0m(),  ¢1mFloBase
  344.                 ¢0md0                         a6
  345.  
  346.                Allocates and initialises a ¢1mwork¢0m_¢1mdetail ¢0mstructure.  The
  347.           use   count   is   set  to  zero,  and  the  semaphores  are
  348.           initialized.  The structure is not placed on  ¢1mflow¢0m.¢1mlibrary¢0m'¢1ms
  349.           ¢0mlist.    This  routine  can  be  used  to  allocate  private
  350.           ¢1mwork¢0m_¢1mdetail ¢0mstructures.  
  351.  
  352.        Enqueuing 
  353.  
  354.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mAddWork¢0m(¢1mdetail¢0m,¢1mfile¢0m,¢1mflag¢0m), ¢1mFloBase
  355.                  ¢0md0                    d0    a0    d1      a6
  356.               work_detail *detail;
  357.               char *file;
  358.               int flag;
  359.  
  360.                Adds a ¢1mfile ¢0mname to queue ¢1mdetail ¢0mwith given flag.   The
  361.           flag  controls  what is to be done with the file after it is
  362.           sent.  The file's remote name is  set  to  NULL,  indicating
  363.           that the remote name should be produced via some relation to
  364.           the local file name (usually just the basename).  The ¢1mdetail
  365.           ¢0mwill  be  faulted into memory if it has not been accessed as
  366.           yet.  The memory for the filename is allocated at the end of
  367.           the ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0mand the total length is  recorded,  but
  368.           access  should  be through the pointer, as the structure may
  369.           grow in size.  
  370.  
  371.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mAddWorkName¢0m(¢1mdetail¢0m,¢1mfile¢0m,¢1masfile¢0m,¢1mflag¢0m), ¢1mFloBase
  372.                  ¢0md0                         d0    d1    a0    a1      a6
  373.               work_detail *detail;
  374.               char *file;
  375.               char *asname;
  376.               int flag;
  377.  
  378.                Adds a ¢1mfile ¢0mname to queue ¢1mdetail ¢0mwith given flag.   The
  379.           flag  controls  what is to be done with the file after it is
  380.           sent.  The file's remote name is set to ¢1masfile¢0m.  The  ¢1mdetail
  381.           ¢0mwill  be  faulted into memory if it has not been accessed as
  382.           yet.  The memory for the local filename and remote  filename
  383.           is  allocated  at  the  end  of the ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0mand the
  384.           total length is recorded, but access should be  through  the
  385.           pointers, as the structure may grow in size.  
  386.  
  387.        Traversing 
  388.  
  389.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseOldWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  390.                  ¢0md0                                  d0       a6
  391.               work_detail *detail;
  392.  
  393.  
  394.  
  395.      Sandelman Software               -6-                          Rev. 2.2
  396.  
  397.  
  398.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  399.  
  400.  
  401.                Start  traversing  the  old  list part queue of ¢1mdetail¢0m.
  402.           The first entry is returned.  A NULL indicates that the list
  403.           is empty.  The queue is locked.  
  404.  
  405.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseNewWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  406.                  ¢0md0                                  d0       a6
  407.               work_detail *detail;
  408.  
  409.                Start traversing the new list  part  queue  of  ¢1mdetail¢0m.
  410.           The first entry is returned.  A NULL indicates that the list
  411.           is empty.   The  queue  is  locked.    If  the  queue is not
  412.           (entirely) in memory, this routine will cause the disk files
  413.           to be read.    Only  AmigaDOS  Processes  should  call  this
  414.           routine.  
  415.  
  416.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mFindWork¢0m(¢1mlastwork¢0m),           ¢1mFloBase
  417.                 ¢0md0                       d0                  a6
  418.               work_detail_node *lastwork;
  419.  
  420.                Find  the  next  queue member in the list that ¢1mlastwork
  421.           ¢0mwas on.  The queue  is  assumed  to  already  be  locked  by
  422.           ¢1mBeginTraverseNewWork ¢0mor  ¢1mBeginTraverseOldWork¢0m.  If there are
  423.           no more members in this queue,  then  this  routine  returns
  424.           NULL.  
  425.  
  426.             ¢1mvoid EndTraverseWork¢0m(¢1mdetail¢0m), ¢1mFloBase
  427.              ¢0m--                    d0       a6
  428.               work_detail *detail;
  429.  
  430.                Terminates  access  to the given queue by unlocking the
  431.           semaphore     locked     by     ¢1mBeginTraverseNewWork      ¢0mor
  432.           ¢1mBeginTraverseOldWork¢0m.  
  433.  
  434.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mBeginTraverseSlowWork¢0m(¢1mdetail¢0m),¢1mFloBase
  435.                  ¢0md0                                  d0       a6
  436.               work_detail *detail;
  437.  
  438.                Starts   access   the   the  ¢1mdetail  ¢0mthrough  the  ¢3mslow
  439.           ¢0mmechanism.  This routine attempts to find an  entry  in  the
  440.           ¢3mnew ¢0mqueue which is not currently being sent, and marks it as
  441.           being sent  and returns it.  NULL is returned if there is no
  442.           such entry.  This  routines  calls  ¢1mBeginTraverseNewWork  ¢0min
  443.           order  to  examine  the  queue, and therefore can cause disk
  444.           I/O.  
  445.  
  446.                In order to prevent the queue and  entries  from  being
  447.           freed, the use count is incremented.  
  448.  
  449.             ¢1mwork¢0m_¢1mdetail¢0m_¢1mnode ¢0m*¢1mNextSlowTraverse¢0m(¢1mdetail¢0m,¢1moldwork¢0m), ¢1mFloBase
  450.                  ¢0md0                              d0     d1        a6
  451.               work_detail *detail;
  452.               work_detail_node *oldwork;
  453.  
  454.                Removes ¢1moldwork ¢0mfrom its queue and places it on the ¢3mold
  455.           ¢0mqueue of  ¢1mdetail¢0m.  If the status is still ¢3min-transit ¢0mthen it
  456.           is changed to be ¢3mnot-sent.  ¢0mThe next entry in the ¢3mnew  ¢0mqueue
  457.           is   found   returned   by   calling   ¢1mBeginTraverseSlowWork
  458.           ¢0minternally.  
  459.  
  460.  
  461.      Sandelman Software               -7-                          Rev. 2.2
  462.  
  463.  
  464.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  465.  
  466.  
  467.             ¢1mvoid EndTraverseSlowWork¢0m(¢1mdetail¢0m),               ¢1mFloBase
  468.              ¢0m--                        d0                     a6
  469.               work_detail *detail;
  470.  
  471.                OBSOLETE: it terminates access to the queue when  there
  472.           are   NO   outstanding  in-transit  entries,  such  as  when
  473.           ¢1mNextSlowTraverse ¢0mreturns NULL because the end of  the  queue
  474.           has been reached.  
  475.  
  476.                This        function       is       equivalent       to
  477.           ¢1mEndTraverseSlowWorkDetail¢0m(¢1mdetail¢0m,N   and   exists   for
  478.           backward compatibility.  
  479.  
  480.             ¢1mvoid EndTraverseSlowWorkDetail¢0m(¢1mdetail¢0m,¢1moldwork¢0m), ¢1mFloBase
  481.              ¢0m--                             d0      d1        a6
  482.               work_detail *detail;
  483.               work_detail_node *oldwork;
  484.  
  485.                Terminates  slow access to ¢1mdetail ¢0mand replaces the work
  486.           entry ¢1moldwork¢0m.  
  487.  
  488.                This function replaces  ¢1mEndTraverseSlowWork  ¢0mfor  cases
  489.           where  the  traversee  may  need  to  stop traversing before
  490.           reaching the end of the queue.    This  routine  is  new  to
  491.           version  2.20  of  ¢1mflow¢0m.¢1mlibrary ¢0mWithout it, entries could be
  492.           left stranded as being  perpectually  ¢3min-transit  ¢0mand  would
  493.           never be  processed.    As  an interim fix, the I/O routines
  494.           will NOT output a queue entry that is marked  as  ¢3min-transit
  495.           ¢0mbut will force the file to say ¢3mnot-sent ¢0minstead.  
  496.  
  497.                The use count of this queue is decremented.  
  498.  
  499.        Queue rendezvous 
  500.  
  501.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mFindDetail¢0m(¢1maSite¢0m), ¢1mFloBase
  502.                  ¢0md0                  d0      a6
  503.               site *aSite;
  504.  
  505.                Searches  for  a  ¢1mwork¢0m_¢1mdetail  ¢0mon  ¢1mflow¢0m.¢1mlibrary¢0m'¢1ms  ¢0mmain
  506.           outbound list that matches the information given  by  ¢1maSite¢0m.
  507.           If the entry is NOT found, then a new one is allocated using
  508.           ¢1mAllocDetail ¢0mand  it  is added to the outbound list.  The use
  509.           count is set to one (1) to prevent it from being freed.  
  510.  
  511.        Scanning outbound 
  512.  
  513.             ¢1mint ScanOutbound¢0m(¢1moutbound¢0m),    ¢1mFloBase
  514.              ¢0md0               d0             a6
  515.               char *outbound;
  516.  
  517.                Causes  ¢1mflow¢0m.¢1mlibrary  ¢0mto  scan   the   given   outbound
  518.           directory.   If  ¢1moutbound ¢0mis NULL, then the default outbound
  519.           directory is used.  If the passed string is NOT the same  as
  520.           the  default outbound directory, then the default is updated
  521.           to be this value.  
  522.  
  523.                The number of files found is returned.  
  524.  
  525.  
  526.  
  527.      Sandelman Software               -8-                          Rev. 2.2
  528.  
  529.  
  530.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  531.  
  532.  
  533.             ¢1mvoid DumpOutbound¢0m(¢1moutbound¢0m),   ¢1mFloBase
  534.              ¢0m--               d0             a6
  535.               char *outbound;
  536.  
  537.                Searches the outbound list to find  details  that  need
  538.           their  disk  counterparts  updated (indicated by the a dirty
  539.           flag).  If necessary, the detail is written to disk, and the
  540.           dirty flag reset.  An attempt is made  to  free  the  memory
  541.           used with ¢1mFreeDetail¢0m.  This currently fails, as more garbage
  542.           collection has done been implemented yet.  
  543.  
  544.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mBeginTraverseOutbound¢0m(), ¢1mFloBase
  545.              ¢0md0                                     a6
  546.  
  547.                Gives  access to the outbound list to a client program.
  548.           Returns the first detail found, or NULL if there  are  none.
  549.           The  ¢1mFloBase ¢0mis locked during this time which prevents other
  550.           from  searching  this  list,  but  does  not  prevent  those
  551.           traversing a  detail  from  continuing.  IN order to prevent
  552.           deadlock, this routine should never be called while  one  or
  553.           more detail is currently locked on your behalf.  
  554.  
  555.             ¢1mwork¢0m_¢1mdetail ¢0m*¢1mFindOutbound¢0m(¢1mdetail¢0m),    ¢1mFloBase
  556.              ¢0md0                        d0           a6
  557.  
  558.                Steps to  the next entry in the outbound list.  Returns
  559.           NULL at the end.  
  560.  
  561.             ¢1mvoid EndTraverseOutbound¢0m(),           ¢1mFloBase
  562.              ¢0m--                                     a6
  563.  
  564.                Unlocks ¢1mFloBase ¢0mat the end of a traversal.  
  565.  
  566.        Configuration 
  567.  
  568.             ¢1mvoid SetDefaultAddress¢0m(¢1maSite¢0m),         ¢1mFloBase
  569.              ¢0m--                     d0              a6
  570.               site *aSite;
  571.  
  572.                Sets ¢1mflow¢0m.¢1mlibrary¢0m'¢1ms ¢0midea of its address to  the  values
  573.           found in  ¢1maSite¢0m.   The only value of great interest to it is
  574.           the  default  zone  number  that  should  be  added  to   2D
  575.           addresses.  
  576.  
  577.                The  site structure is copied into the ¢1mFloBase¢0m, and the
  578.           domain name string is duplicated if necessary.  
  579.  
  580.             ¢1msite ¢0m*¢1mGetDefaultAddress¢0m(),            ¢1mFloBase
  581.              ¢0md0                                     a6
  582.  
  583.                Returns  a  pointer  to   the   stored   default   site
  584.           structure.  
  585.  
  586.             ¢1mvoid SetOutbound¢0m(¢1moutbounddir¢0m),        ¢1mFloBase
  587.              ¢0m--                d0                   a6
  588.               char *outbounddir;
  589.  
  590.  
  591.  
  592.  
  593.      Sandelman Software               -9-                          Rev. 2.2
  594.  
  595.  
  596.      FLOW(3)               Welmat Programmers Manual                FLOW(3)
  597.  
  598.  
  599.                Sets ¢1mflow¢0m.¢1mlibrary ¢0mdefault outbound directory.  
  600.  
  601.             ¢1mchar ¢0m*¢1mGetOutbound¢0m(),                  ¢1mFloBase
  602.              ¢0md0                                     a6
  603.  
  604.                Returns   ¢1mflow¢0m.¢1mlibrary¢0m'¢1ms   ¢0midea  of  what  the  current
  605.           outbound directory is.  
  606.  
  607.        Miscelaneous 
  608.  
  609.             ¢1mint  DetailCount¢0m(¢1mdetail¢0m),             ¢1mFloBase
  610.              ¢0md0               d0                    a6
  611.               work_detail *detail;
  612.  
  613.                Counts the number of entries in the detail.  As a  side
  614.           effect, it determines what the lowest value of ¢1mdt¢0m_¢1mminCost ¢0mis
  615.           and  sets  a  flag  indicating  that  the  stored  value  is
  616.           correct.  
  617.  
  618.             ¢1mvoid KillRequest¢0m(¢1mdetail¢0m),             ¢1mFloBase
  619.              ¢0m--                d0                   a6
  620.               work_detail *detail;
  621.  
  622.                Removes any entries of type ¢3mDT_REQUEST ¢0mfrom the queue.  
  623.  
  624.             ¢1mint  ChangeDetailPri¢0m(¢1mdetail¢0m,¢1mdetail¢0m_¢1mnode¢0m,¢1mpri¢0m)
  625.              d0                    d0     a0         d1
  626.               work_detail *detail;
  627.               work_detail_node *detail_node
  628.               int pri;
  629.  
  630.                Changes  the  minimum  cost field before this file will
  631.           (in theory) be sent.  Direct manipulation of the cost  field
  632.           is  not  recommended,  as  the  entry  really  needs  to  be
  633.           de-queued and then requeued  in  order  to  keep  the  order
  634.           correct.   However, since this is the very operation that is
  635.           happening during a  slow  traversal,  this  routine  may  be
  636.           skipped.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.      Sandelman Software               -10-                         Rev. 2.2
  653.  
  654.