[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XCMDs & RTLs



I wonder whether anyone can advise me on a couple of programming points:
 
First, assuming there are two different XCMDs, both of which require an 
identical utility routine, is there any way of avoiding duplication of 
that routine, other than making it into a separate XFCN and using it via 
an 'evaluate()' callback?
 
Secondly, is there any way to persuade two related XCMDs which require 
certain possibly static data to 'cohabit' in the same code-resource, 
other than by adding an extra parameter indicating which 'method' to 
employ? In a similar vein, is it possible to refer to data held (again 
possibly as a static) in one XCMD from another XCMD?
 
Third, does anybody know anything about the implementation of runtime 
libraries (filetype $B4)? Specifically, how does one persuade the linker 
and/or loader to use runtime-library routines automatically, without 
getting involved with making LoadSeg calls? The GS/OS reference manual 
^suggests^ that they should be linkable in exactly the same way as
ordinary libraries, but I wouldn't be surprised to learn that this may 
only apply to the APW linker, not the Orca linker.
 
It's always irritated me to know that many of my programs are very 
much larger than really necessary, simply because many of them tend 
to include the same routines. RTLs would solve the problem completely 
- the Unmentionable System has DLLs, we ought to be able to use our 
RTLs, which strike me as much the same thing!
 
It also occurs to me that the solution to the last question might 
well be the perfect answer to the first two. Any comments/ideas/
suggestions?