See also

TSystem
Abstract base class defining a generic interface to the underlying
Operating System.
This is not an ABC in the strict sense of the (C++) word. For
every member function their is an implementation (often not more
than a call to AbstractMethod() which prints a warning saying
that the method should be overridden in a derived class), which
allows a simple partial implementation for new OS'es.

Process pending events (GUI, timers, sockets). Returns the result of
TROOT::IsInterrupted(). The interrupt flag (TROOT::SetInterrupt())
can be set during the handling of the events. This mechanism allows
macros running in tight calculating loops to be interrupted by some
GUI event (depending on the interval with which this method is
called). For example hitting ctrl-c in a canvas will set the
interrupt flag.

Expand a pathname getting rid of special shell characters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX. This is a protected function called
from the OS specific system classes, like TUnixSystem and TWinNTSystem.

Expand a pathname getting rid of special shell characaters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX.

Expand a pathname getting rid of special shell characaters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX. The user must delete returned string.

Load a shared library. Returns 0 on successful loading, 1 in
case lib was already loaded and -1 in case lib does not exist
or in case of error. When entry is specified the loaded lib is
search for this entry point (return -1 when entry does not exist,
0 otherwise). When the system flag is kTRUE, the library is consisdered
a permanent systen library that should not be unloaded during the
course of the session.

Return a space separated list of loaded shared libraries.
This list is of a format suitable for a linker, i.e it may contain
-Lpathname and/or -lNameOfLib.
Option can be any of:
S: shared libraries loaded at the start of the executable, because
they were specified on the link line.
D: shared libraries dynamically loaded after the start of the program.

This method compiles and loads a shared library containing
the code from the file "filename".
The possible options are:
k : keep the shared library after the session end.
It uses the directive fMakeSharedLibs to create a shared library.
If loading the shared library fails, it tries to output a list of missing
symbols by creating an executable (on some platforms like OSF, this does
not HAVE to be an executable) containing the script. It uses the
directive fMakeExe to do so.
For both directives, before passing them to TSystem::Exec, it expands the
variables $SourceFiles, $SharedLib, $LibName, $IncludePath, $LinkedLibs,
$ExeName and $ObjectFiles. See SetMakeSharedLib() for more information on
those variables.
This method is used to implement the following feature:
Synopsis:
The purpose of this addition is to allow the user to use an external
compiler to create a shared library from its C++ macro (scripts).
Currently in order to execute a script, a user has to type at the root
prompt
.X myfunc.C(arg1,arg2)
We allow him to type:
.X myfunc.C++(arg1,arg2)
or
.X myfunc.C+(arg1,arg2)
In which case an external compiler will be called to create a shared
library. This shared library will then be loaded and the function
myfunc will be called with the two arguments. With '++' the shared library
is deleted at the end of the session. With '+' the shared library is kept.
Of course the + and ++ notation will also be supported in similar way
for .x and .L.
Through the function TSystem::SetMakeSharedLib(), the user will be able to
indicate, with shell commands, how to build a shared library (a good
default will be provided). The most common change, namely where to find
header files, will be available through the function
TSystem::SetIncludePath().
A good default will be provided so that a typical user session should be at
most:
root[1] gSystem->SetIncludePath("-I$ROOTSYS/include
-I$HOME/mypackage/include");
root[2] .x myfunc.C++(10,20);
The user may sometimes try to compile a script before it has loaded all the
needed shared libraries. In this case we want to be helpfull and output a
list of the unresolved symbols. So if the loading of the created shared
library fails, we will try to build a executable that contains the
script. The linker should then output a list of missing symbols.
To support this we provide a TSystem::SetMakeExe() function, that sets the
directive telling how to create an executable. The loader will need
to be informed of all the libraries available. The information about
the libraries that has been loaded by .L and TSystem::Load() is accesible
to the script compiler. However, the information about
the libraries that have been selected at link time by the application
builder (like the root libraries for root.exe) are not available and need
to be explictly listed in fLinkedLibs (either by default or by a call to
TSystem::SetLinkedLibs()).
To simplify customization we could also add to the .rootrc support for the
variables
Unix.*.Root.IncludePath: -I$ROOTSYS/include
WinNT.*.Root.IncludePath: -I%ROOTSYS%/include
Unix.*.Root.LinkedLibs: -L$ROOTSYS/lib -lBase ....
WinNT.*.Root.LinkedLibs: %ROOTSYS%/lib/*.lib msvcrt.lib ....
And also support for MakeSharedLibs() and MakeExe().
(the ... have to be replaced by the actual values and are here only to
shorten this comment).

Directives has the same syntax as the argument of SetMakeSharedLib but is
used to create an executable. This creation is used as a means to output
a list of unresolved symbols, when loading a shared library has failed.
The required variable is $ExeName rather than $SharedLib, e.g.:
gSystem->SetMakeExe(
"g++ -Wall -fPIC -DR__GLIBC $IncludePath $SourceFiles
-o $ExeName $LinkedLibs -L/usr/X11R6/lib -lX11 -lm -ldl -rdynamic");

IncludePath should contain the list of compiler flags to indicate where
to find user defined header files. It is used to expand $IncludePath in
the directives given to SetMakeSharedLib() and SetMakeExe(), e.g.:
gSystem->SetInclude("-I$ROOTSYS/include -Imydirectory/include");
the default value of IncludePath on Unix is:
"-I$ROOTSYS/include "
and on Windows:
"/I%ROOTSYS%/include "

LinkedLibs should contain the library directory and list of libraries
needed to recreate the current executable. It is used to expand $LinkedLibs
in the directives given to SetMakeSharedLib() and SetMakeExe()
The default value on Unix is: root-config --glibs

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.