home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d6xx / d658 / view.lha / View / DCBack / DCBack.DOC < prev    next >
Text File  |  1992-05-15  |  4KB  |  92 lines

  1.  
  2.                              DCBack.lib 1.2
  3.  
  4. ---> Auto detach,  OS2.0 style commandline-parsing startup code for DICE <---
  5.  
  6.                            KICKSTART  2.0 ONLY
  7.  
  8.                                    by
  9.                             Jan van den Baard
  10.  
  11.                              This program is
  12.                                 FREEWARE
  13.               and remains (c) Copyright 1991 Jaba Development
  14.                 except for the somewhat adjusted "wbmain.a"
  15.                       which is (c) Copyright 1990 by
  16.                              Matthew Dillon
  17.  
  18.   The author cannot be held liable for the  suitability or  accuracy of  this
  19. program.  Any  damage directly  or indirectly  caused by the use or misuse of
  20. this program is the sole responsibility of the user her/him self.
  21.  
  22.   DCBack.lib is a tiny link-library which alows you to write  auto-detachable
  23. programs with DICE.  I  wrote this  program  mainly for my  text reader  View
  24. but it can be used for all sorts of applications.  To  make your DICE program
  25. detachable you must define the following globals somewhere in your source:
  26.  
  27. _procname:      This should be a pointer to a 0-terminated string  which will
  28.                 be the name of the detached process.
  29.  
  30. _template:      This should be a pointer to a  0-terminated shell commandline
  31.                 template string.    Please  read  the  documentation  on  the
  32.                 ReadArgs() routine for more information about the syntax of a
  33.                 template string.     NOTE:  If  you  don't  need  commandline
  34.                 parsing just make this 0.
  35.  
  36. _exthelp:       This  should  be a  pointer  to  a  0-terminated string which
  37.                 should  contain  some  extended information about the command
  38.                 line. If you don't want this you should make this 0.
  39.  
  40. _stack:         This should be a 32-Bit integer which specifies the stacksize
  41.                 in bytes CreateProc must  allocate  for the  process.  If you
  42.                 specify 0 here a stack of 4096 bytes is used.
  43.  
  44. _priority:      This should be a 32-Bit integer which specifies the  priority
  45.                 of the created process.
  46.  
  47. _BackGroundIO:  Any value other than 0 will open a file  which allows  you to
  48.                 write to the shell window it was  called from.  Note  however
  49.                 that no input can be received  from this  shell window.  This
  50.                 will also disable  the  closing  of  the  shell  window  that
  51.                 the program was run from until the program terminates.
  52.  
  53.   The  startup  code  will  automatically  parse  the  commandline using  the
  54. ReadArgs() routine. The  startup  code  calls  the  same  entry  points  that
  55. the original DICE startup code does:
  56.  
  57.     Shell:         main( long argc, long *argv );
  58.     Workbench:     wbmain( wbmsg );
  59.  
  60.   As you can see the shell entry point is called with other arguments than it
  61. is with the standard DICE startup code. The arguments passed to main have the
  62. following contents:
  63.  
  64.     argc    :   The startup code counts the number of arguments it can expect
  65.                 by counting the commas in the template string and then adding
  66.                 one to the that amount. 'argc'  contains the  result of  that
  67.                 count.
  68.  
  69.     argv    :   When the  startup  code has  counted the  number of  expected
  70.                 arguments it allocates a long-word  array with 'argc'  slots.
  71.                 Then it calls ReadArgs() which will fill this array with  the
  72.                 result  of  the  parse. 'argv'  contains  a  pointer  to  the
  73.                 initialized argument array.
  74.  
  75.   For  the  workbench  the  startup  code  automatically  set's  the  current
  76. directory to the directory from which the program is started.
  77.  
  78.   The link-library comes in two versions. One called "dcback.lib" which  uses
  79. the standard DICE routine calling  conventions  and one called  "dcbackr.lib"
  80. which uses the registered routine calling conventions.  Please read  the DICE
  81. docs for more info about this.
  82.  
  83.   Bug reports,  suggestions,  postcards,  flames,  criticism,  contributions,
  84. ideas, gifts, multiscan monitors, etc., etc., etc......... to:
  85.  
  86.                                            Jan van den Baard
  87.                                            Bakkerstraat 176
  88.                                            3082 HE, Rotterdam
  89.                                            The Netherlands
  90.  
  91.                                            FIDO: 2:500/29 (Jan van.den.Baard)
  92.