home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 411b.lha / dme_1.42 / src.LZH / src / icon.fix < prev    next >
Internet Message Format  |  1988-12-09  |  4KB

  1. From tlm@newton.physics.purdue.edu  Thu Dec  8 09:53:55 1988
  2. Received: by postgres.Berkeley.EDU (5.57/1.26)
  3.     id AA15642; Thu, 8 Dec 88 09:53:55 PST
  4. Received: by newton.physics.purdue.edu (5.54/2.2)
  5.     id AA19181; Thu, 8 Dec 88 12:52:30 EST
  6. From: tlm@newton.physics.purdue.edu (Timothy Lee Meisenheimer)
  7. Message-Id: <8812081752.AA19181@newton.physics.purdue.edu>
  8. To: dillon@postgres.Berkeley.EDU (Matt Dillon)
  9. Cc: tlm@newton.physics.purdue.edu
  10. Subject: Re: dme & programing objectively 
  11. In-Reply-To: Your message of Sun, 27 Nov 88 14:59:27 PST.
  12.              <8811272259.AA10886@postgres.Berkeley.EDU> 
  13. Date: Thu, 08 Dec 88 12:52:29 EST
  14.  
  15. Well, I'm a few days older and a little wiser. I finally figured out
  16. that DME looks for it's icon (dme.info) to get some tooltype arguments
  17. when it starts up. The original code barfed and exited when it couldn't
  18. find "dme.info" which is the first argument passed to it be the workbench.
  19. (Of course since BROWSER "does" the same thing as the WORKBENCH I had similar
  20. results) I just added some code to account for the case when there might
  21. not be a dme.info file around and it all works correctly. I've included
  22. a comparison from old to new code:
  23. (this is from main.c)
  24. ************** old code *************
  25.     if (mac == 0) {             /*  WORKBENCH STARTUP           */
  26.     long oldlock;
  27.  
  28.     Wdisable = 0;        /*  allow icon save        */
  29.     Wbs = (WBS *)mav;
  30.     if (!openlibs(ICON_LIB))
  31.         exiterr("unable to open icon library");
  32.     oldlock = CurrentDir(Wbs->sm_ArgList[0].wa_Lock);   /* Tool */
  33.     Do = GetDiskObject(Wbs->sm_ArgList[0].wa_Name);
  34.     CurrentDir(oldlock);
  35.     if (Do == NULL)
  36.         exiterr("unable to get disk object");
  37.     mac = 99;
  38.     }
  39.  
  40.     resethash();
  41.  
  42.     if (Do) {
  43.     ops(Do->do_ToolTypes, 1);
  44.     nf = Wbs->sm_NumArgs - 1;
  45.     Dirlock = Wbs->sm_ArgList[0].wa_Lock;
  46.     } else {
  47.     nf = ops(mav+1, 0);
  48.     }
  49.  
  50.     for (ni = 0, i = 1; i < mac; ++i) {
  51. ************** old code *************
  52. ************** new code *************
  53.     if (mac == 0) {             /*  WORKBENCH STARTUP           */
  54.     long oldlock;
  55.  
  56.     Wdisable = 0;        /*  allow icon save        */
  57.     Wbs = (WBS *)mav;
  58.     if (!openlibs(ICON_LIB))
  59.         exiterr("unable to open icon library");
  60.     Do = GetDiskObject(Wbs->sm_ArgList[0].wa_Name);
  61.     if(Do != NULL){
  62.         oldlock = CurrentDir(Wbs->sm_ArgList[0].wa_Lock);   /* Tool */
  63.         CurrentDir(oldlock);
  64.     }
  65.  
  66. /* let it be ok not to find dnet.info !!! */
  67. /*      if (Do == NULL)
  68.         exiterr("unable to get disk object"); */
  69.  
  70.     mac = 99;
  71.     }
  72.  
  73.     resethash();
  74.  
  75.     if (Do != NULL) {
  76.     ops(Do->do_ToolTypes, 1);
  77.     nf = Wbs->sm_NumArgs - 1;
  78.     Dirlock = Wbs->sm_ArgList[0].wa_Lock;
  79.  
  80.     /* check that it might still be a workbench startup */
  81.  
  82.     } else if(Wdisable == 0){
  83.     nf = Wbs->sm_NumArgs - 1;
  84.  
  85.     /* this is for CLI startup */
  86.  
  87.     } else {
  88.     nf = ops(mav+1, 0);
  89.     }
  90.  
  91.     for (ni = 0, i = 1; i < mac; ++i) {
  92. ************** new code *************
  93.  
  94. Anyway, wasn't much but it did force me to learn how the workbench
  95. startup stuff should go.
  96.  
  97. On a slightly different topic. I'd like to try to automate dnet a little
  98. more - have it dial up and transfer files automatically using Amicron. Would
  99. you suggest putting a scripting fascility in dnet itself - or put in
  100. some type of IPC port with which you could send and receive from
  101. the serial line (to dial out and login etc.) and maybe give a few informative
  102. things like the CLI # for dnet etc. Of course once dnet is up and running on
  103. both ends, one could just us the usual client and server program (or make
  104. new ones). I think the versatility of the latter would be preferable.
  105.  
  106. Guess I'm looking for enlightened comments, suggestions and "permission"
  107. to hack at your code.
  108.  
  109. tim.
  110.  
  111.