On Sat, May 9, 2009 at 5:44 AM, Rony G. Flatscher <rony.flatsc...@wu-wien.ac.at> wrote: > Given the following scenario: > > an interpreter instance is created with RexxCreateInterpreter(), loading a > native library "ABC" via the options argument, all loaded routines will be > visible from thereon to every program that gets called > using CallProgram() for some program "d.rex" which loads a library "DEF", > then ends > using CallProgram() for some program "g.rex" which loads a library "GHI", > then ends > using CallProgram() for some program "j.rex" which loads a library "JKL", > then continues to run and via native code there will be callbacks to ooRexx > that occur via another CallProgram() from native code > > Questions: > > in 3. above: would all public routines and public classes that got loaded in > 2. (e.g. via a "::requires DEF") be visible in 3. ?
Libraries are NOT the same as ooRexx files loaded via ::requires. They don't have the concept of "public_routines" and "public_classes" Libraries don't even define "classes", only the code backing methods that can be used in class definitions. A ::requires LIBRARY merely ensures that an external library is a vailable and is loaded befere the program starts executing. The routines in the library are GLOBAL, not PUBLIC, which is a concept that only applies to routines created using ::ROUTINE in another Rexx source package. > would the program in 4. see all public routines and public classes of the > previously loaded libraries DEF and GHI ? Same answer. This question has no meaning for libraries. > for a callback from native code to Rexx in 4. above, which public > routines/classes would be available to the callback, how would one be able > to use (actually to fetch a reference to) those available public > routines/classes? Guess what, same ansewr. > > Scenario: the only thing available to native code currently is a reference > to an ooRexx object that got stored in the native interface layer in an > earlier call from a running Rexx program. > It would be possible to fetch a reference to routine's package object and > store that with the ooRexx object and then on callbacks use that. Is this > advisable? Routine objects are just ooRexx objects, so the question of storing a reference of that object with another object is no different just because it happens to be a Routine object. If you can obtain the routine object instance, there are mechanisms that allow you to store it. The big question is what are you really trying to do here? This does not sound like an something that would make much sense. > > if this is possible at all: how could one determine from native code whether > a given library is loaded and if so, how could one get access to its > routines and classes? Again, this question has no meaning. There is no library object you can query, Libraries do not define classes. The routines are part of the global environmemt. If you need the library, just ensure the bloody thing is loaded and make the calls. If you wish to make the load dynamic, there are many mechanisms available to do this. If the library is already loaded, it will not be loaded as second time. > > ---rony > > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel