// @(#)root/base:$Id$
// Author: Fons Rademakers   15/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TSystem
#define ROOT_TSystem


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TSystem                                                              //
//                                                                      //
// Abstract base class defining a generic interface to the underlying   //
// Operating System.                                                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef __CINT__
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#ifndef WIN32
#include <unistd.h>
#endif
#endif

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TInetAddress
#include "TInetAddress.h"
#endif
#ifndef ROOT_TTimer
#include "TTimer.h"
#endif
#ifndef ROOT_ThreadLocalStorage
#include "ThreadLocalStorage.h"
#endif

class TSeqCollection;
class TFdSet;
class TVirtualMutex;

enum EAccessMode {
   kFileExists        = 0,
   kExecutePermission = 1,
   kWritePermission   = 2,
   kReadPermission    = 4
};

enum ELogOption {
   kLogPid            = 0x01,
   kLogCons           = 0x02
};

enum ELogLevel {
   kLogEmerg          = 0,
   kLogAlert          = 1,
   kLogCrit           = 2,
   kLogErr            = 3,
   kLogWarning        = 4,
   kLogNotice         = 5,
   kLogInfo           = 6,
   kLogDebug          = 7
};

enum ELogFacility {
   kLogLocal0,
   kLogLocal1,
   kLogLocal2,
   kLogLocal3,
   kLogLocal4,
   kLogLocal5,
   kLogLocal6,
   kLogLocal7
};

enum EFpeMask {
   kNoneMask         = 0x00,
   kInvalid          = 0x01,  // Invalid argument
   kDivByZero        = 0x02,  // Division by zero
   kOverflow         = 0x04,  // Overflow
   kUnderflow        = 0x08,  // Underflow
   kInexact          = 0x10,  // Inexact
   kDefaultMask      = 0x07,
   kAllMask          = 0x1F
};

enum EFileModeMask {
   kS_IFMT   = 0170000,   // bitmask for the file type bitfields
   kS_IFSOCK = 0140000,   // socket
   kS_IFLNK  = 0120000,   // symbolic link
   kS_IFOFF  = 0110000,   // offline file
   kS_IFREG  = 0100000,   // regular file
   kS_IFBLK  = 0060000,   // block device
   kS_IFDIR  = 0040000,   // directory
   kS_IFCHR  = 0020000,   // character device
   kS_IFIFO  = 0010000,   // fifo
   kS_ISUID  = 0004000,   // set UID bit
   kS_ISGID  = 0002000,   // set GID bit
   kS_ISVTX  = 0001000,   // sticky bit
   kS_IRWXU  = 00700,     // mask for file owner permissions
   kS_IRUSR  = 00400,     // owner has read permission
   kS_IWUSR  = 00200,     // owner has write permission
   kS_IXUSR  = 00100,     // owner has execute permission
   kS_IRWXG  = 00070,     // mask for group permissions
   kS_IRGRP  = 00040,     // group has read permission
   kS_IWGRP  = 00020,     // group has write permission
   kS_IXGRP  = 00010,     // group has execute permission
   kS_IRWXO  = 00007,     // mask for permissions for others (not in group)
   kS_IROTH  = 00004,     // others have read permission
   kS_IWOTH  = 00002,     // others have write permisson
   kS_IXOTH  = 00001      // others have execute permission
};

inline Bool_t R_ISDIR(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFDIR); }
inline Bool_t R_ISCHR(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFCHR); }
inline Bool_t R_ISBLK(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFBLK); }
inline Bool_t R_ISREG(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFREG); }
inline Bool_t R_ISLNK(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFLNK); }
inline Bool_t R_ISFIFO(Int_t mode) { return ((mode & kS_IFMT) == kS_IFIFO); }
inline Bool_t R_ISSOCK(Int_t mode) { return ((mode & kS_IFMT) == kS_IFSOCK); }
inline Bool_t R_ISOFF(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFOFF); }

struct FileStat_t {
   Long_t   fDev;          // device id
   Long_t   fIno;          // inode
   Int_t    fMode;         // protection (combination of EFileModeMask bits)
   Int_t    fUid;          // user id of owner
   Int_t    fGid;          // group id of owner
   Long64_t fSize;         // total size in bytes
   Long_t   fMtime;        // modification date
   Bool_t   fIsLink;       // symbolic link
   TString  fUrl;          // end point url of file
   FileStat_t() : fDev(0), fIno(0), fMode(0), fUid(0), fGid(0), fSize(0),
                  fMtime(0), fIsLink(kFALSE), fUrl("") { }
};

struct UserGroup_t {
   Int_t    fUid;          // user id
   Int_t    fGid;          // group id
   TString  fUser;         // user name
   TString  fGroup;        // group name
   TString  fPasswd;       // password
   TString  fRealName;     // user full name
   TString  fShell;        // user preferred shell
   UserGroup_t() : fUid(0), fGid(0), fUser(), fGroup(), fPasswd(),
                   fRealName (), fShell() { }
};

struct SysInfo_t {
   TString   fOS;          // OS
   TString   fModel;       // computer model
   TString   fCpuType;     // type of cpu
   Int_t     fCpus;        // number of cpus
   Int_t     fCpuSpeed;    // cpu speed in MHz
   Int_t     fBusSpeed;    // bus speed in MHz
   Int_t     fL2Cache;     // level 2 cache size in KB
   Int_t     fPhysRam;     // physical RAM in MB
   SysInfo_t() : fOS(), fModel(), fCpuType(), fCpus(0), fCpuSpeed(0),
                 fBusSpeed(0), fL2Cache(0), fPhysRam(0) { }
   virtual ~SysInfo_t() { }
   ClassDef(SysInfo_t, 1); // System information - OS, CPU, RAM.
};

struct CpuInfo_t {
   Float_t   fLoad1m;      // cpu load average over 1 m
   Float_t   fLoad5m;      // cpu load average over 5 m
   Float_t   fLoad15m;     // cpu load average over 15 m
   Float_t   fUser;        // cpu user load in percentage
   Float_t   fSys;         // cpu sys load in percentage
   Float_t   fTotal;       // cpu user+sys load in percentage
   Float_t   fIdle;        // cpu idle percentage
   CpuInfo_t() : fLoad1m(0), fLoad5m(0), fLoad15m(0),
                 fUser(0), fSys(0), fTotal(0), fIdle(0) { }
   virtual ~CpuInfo_t() { }
   ClassDef(CpuInfo_t, 1); // CPU load information.
};

struct MemInfo_t {
   Int_t     fMemTotal;    // total RAM in MB
   Int_t     fMemUsed;     // used RAM in MB
   Int_t     fMemFree;     // free RAM in MB
   Int_t     fSwapTotal;   // total swap in MB
   Int_t     fSwapUsed;    // used swap in MB
   Int_t     fSwapFree;    // free swap in MB
   MemInfo_t() : fMemTotal(0), fMemUsed(0), fMemFree(0),
                 fSwapTotal(0), fSwapUsed(0), fSwapFree(0) { }
   virtual ~MemInfo_t() { }
   ClassDef(MemInfo_t, 1); // Memory utilization information.
};

struct ProcInfo_t {
   Float_t   fCpuUser;     // user time used by this process in seconds
   Float_t   fCpuSys;      // system time used by this process in seconds
   Long_t    fMemResident; // resident memory used by this process in KB
   Long_t    fMemVirtual;  // virtual memory used by this process in KB
   ProcInfo_t() : fCpuUser(0), fCpuSys(0), fMemResident(0),
                  fMemVirtual(0) { }
   virtual ~ProcInfo_t() { }
   ClassDef(ProcInfo_t, 1);// System resource usage of given process.
};

struct RedirectHandle_t {
   TString   fFile;        // File where the output was redirected
   TString   fStdOutTty;   // tty associated with stdout, if any (e.g. from ttyname(...))
   TString   fStdErrTty;   // tty associated with stderr, if any (e.g. from ttyname(...))
   Int_t     fStdOutDup;   // Duplicated descriptor for stdout
   Int_t     fStdErrDup;   // Duplicated descriptor for stderr
   Int_t     fReadOffSet;  // Offset where to start reading the file (used by ShowOutput(...))
   RedirectHandle_t(const char *n = 0) : fFile(n), fStdOutTty(), fStdErrTty(), fStdOutDup(-1),
                                         fStdErrDup(-1), fReadOffSet(-1) { }
   void Reset() { fFile = ""; fStdOutTty = ""; fStdErrTty = "";
                  fStdOutDup = -1; fStdErrDup = -1; fReadOffSet = -1; }
};

#ifdef __CINT__
typedef void *Func_t;
#else
typedef void ((*Func_t)());
#endif

R__EXTERN const char  *gRootDir;
R__EXTERN const char  *gProgName;
R__EXTERN const char  *gProgPath;
R__EXTERN TVirtualMutex *gSystemMutex;


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// Asynchronous timer used for processing pending GUI and timer events  //
// every delay ms. Call in a tight computing loop                       //
// TProcessEventTimer::ProcessEvent(). If the timer did timeout this    //
// call will process the pending events and return kTRUE if the         //
// TROOT::IsInterrupted() flag is set (can be done by hitting key in    //
// canvas or selecting canvas menu item View/Interrupt.                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
class TProcessEventTimer : public TTimer {
public:
   TProcessEventTimer(Long_t delay);
   Bool_t Notify() { return kTRUE; }
   Bool_t ProcessEvents();
   ClassDef(TProcessEventTimer,0)  // Process pending events at fixed time intervals
};


class TSystem : public TNamed {

public:
   enum EAclicMode { kDefault, kDebug, kOpt };
   enum EAclicProperties {
      kFlatBuildDir = BIT(0)           // If set and a BuildDir is selected, then do not created subdirectories
   };

protected:
   TFdSet          *fReadmask;         //!Files that should be checked for read events
   TFdSet          *fWritemask;        //!Files that should be checked for write events
   TFdSet          *fReadready;        //!Files with reads waiting
   TFdSet          *fWriteready;       //!Files with writes waiting
   TFdSet          *fSignals;          //!Signals that were trapped
   Int_t            fNfd;              //Number of fd's in masks
   Int_t            fMaxrfd;           //Largest fd in read mask
   Int_t            fMaxwfd;           //Largest fd in write mask
   Int_t            fSigcnt;           //Number of pending signals
   TString          fWdpath;           //Working directory
   TString          fHostname;         //Hostname
   Bool_t           fInsideNotify;     //Used by DispatchTimers()
   Int_t            fBeepFreq;         //Used by Beep()
   Int_t            fBeepDuration;     //Used by Beep()

   Bool_t           fInControl;        //True if in eventloop
   Bool_t           fDone;             //True if eventloop should be finished
   Int_t            fLevel;            //Level of nested eventloops

   TSeqCollection  *fTimers;           //List of timers
   TSeqCollection  *fSignalHandler;    //List of signal handlers
   TSeqCollection  *fFileHandler;      //List of file handlers
   TSeqCollection  *fStdExceptionHandler; //List of std::exception handlers
   TSeqCollection  *fOnExitList;       //List of items to be cleaned-up on exit

   TString          fListLibs;         //List shared libraries, cache used by GetLibraries

   TString          fBuildArch;        //Architecure for which ROOT was built (passed to ./configure)
   TString          fBuildCompiler;    // Compiler used to build this ROOT
   TString          fBuildCompilerVersion; //Compiler version used to build this ROOT
   TString          fBuildNode;        //Detailed information where ROOT was built
   TString          fBuildDir;         //Location where to build ACLiC shared library and use as scratch area.
   TString          fFlagsDebug;       //Flags for debug compilation
   TString          fFlagsOpt;         //Flags for optimized compilation
   TString          fListPaths;        //List of all include (fIncludePath + interpreter include path). Cache used by GetIncludePath
   TString          fIncludePath;      //Used to expand $IncludePath in the directives given to SetMakeSharedLib and SetMakeExe
   TString          fLinkedLibs;       //Used to expand $LinkedLibs in the directives given to SetMakeSharedLib and SetMakeExe
   TString          fSoExt;            //Extension of shared library (.so, .sl, .a, .dll, etc.)
   TString          fObjExt;           //Extension of object files (.o, .obj, etc.)
   EAclicMode       fAclicMode;        //Whether the compilation should be done debug or opt
   TString          fMakeSharedLib;    //Directive used to build a shared library
   TString          fMakeExe;          //Directive used to build an executable
   TString          fLinkdefSuffix;    //Default suffix for linkdef files to be used by ACLiC (see EACLiCProperties)
   Int_t            fAclicProperties;  //Various boolean flag for change ACLiC's behavior.
   TSeqCollection  *fCompiled;         //List of shared libs from compiled macros to be deleted
   TSeqCollection  *fHelpers;          //List of helper classes for alternative file/directory access

   TString &GetLastErrorString();             //Last system error message (thread local).
   const TString &GetLastErrorString() const; //Last system error message (thread local).

   TSystem               *FindHelper(const char *path, void *dirptr = 0);
   virtual Bool_t         ConsistentWith(const char *path, void *dirptr = 0);
   virtual const char    *ExpandFileName(const char *fname);
   virtual void           SigAlarmInterruptsSyscalls(Bool_t) { }
   virtual const char    *GetLinkedLibraries();
   virtual void           DoBeep(Int_t /*freq*/=-1, Int_t /*duration*/=-1) const { printf("\a"); fflush(stdout); }

   static const char *StripOffProto(const char *path, const char *proto) {
      return !strncmp(path, proto, strlen(proto)) ? path + strlen(proto) : path;
   }

private:
   TSystem(const TSystem&);              // not implemented
   TSystem& operator=(const TSystem&);   // not implemented

public:
   TSystem(const char *name = "Generic", const char *title = "Generic System");
   virtual ~TSystem();

   //---- Misc
   virtual Bool_t          Init();
   virtual void            SetProgname(const char *name);
   virtual void            SetDisplay();
   void                    SetErrorStr(const char *errstr);
   const char             *GetErrorStr() const { return GetLastErrorString(); }
   virtual const char     *GetError();
   void                    RemoveOnExit(TObject *obj);
   virtual const char     *HostName();
   virtual void            NotifyApplicationCreated();

   static Int_t            GetErrno();
   static void             ResetErrno();
   void                    Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE);
   void                    GetBeepDefaults(Int_t &freq, Int_t &duration) const { freq = fBeepFreq; duration = fBeepDuration; }

   //---- EventLoop
   virtual void            Run();
   virtual Bool_t          ProcessEvents();
   virtual void            DispatchOneEvent(Bool_t pendingOnly = kFALSE);
   virtual void            ExitLoop();
   Bool_t                  InControl() const { return fInControl; }
   virtual void            InnerLoop();
   virtual Int_t           Select(TList *active, Long_t timeout);
   virtual Int_t           Select(TFileHandler *fh, Long_t timeout);

   //---- Handling of system events
   virtual void            AddSignalHandler(TSignalHandler *sh);
   virtual TSignalHandler *RemoveSignalHandler(TSignalHandler *sh);
   virtual void            ResetSignal(ESignals sig, Bool_t reset = kTRUE);
   virtual void            ResetSignals();
   virtual void            IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE);
   virtual void            IgnoreInterrupt(Bool_t ignore = kTRUE);
   virtual TSeqCollection *GetListOfSignalHandlers() const { return fSignalHandler; }
   virtual void            AddFileHandler(TFileHandler *fh);
   virtual TFileHandler   *RemoveFileHandler(TFileHandler *fh);
   virtual TSeqCollection *GetListOfFileHandlers() const { return fFileHandler; }
   virtual void            AddStdExceptionHandler(TStdExceptionHandler *eh);
   virtual TStdExceptionHandler *RemoveStdExceptionHandler(TStdExceptionHandler *eh);
   virtual TSeqCollection *GetListOfStdExceptionHandlers() const { return fStdExceptionHandler; }

   //---- Floating Point Exceptions Control
   virtual Int_t           GetFPEMask();
   virtual Int_t           SetFPEMask(Int_t mask = kDefaultMask);

   //---- Time & Date
   virtual TTime           Now();
   virtual TSeqCollection *GetListOfTimers() const { return fTimers; }
   virtual void            AddTimer(TTimer *t);
   virtual TTimer         *RemoveTimer(TTimer *t);
   virtual void            ResetTimer(TTimer *) { }
   virtual Long_t          NextTimeOut(Bool_t mode);
   virtual void            Sleep(UInt_t milliSec);

   //---- Processes
   virtual Int_t           Exec(const char *shellcmd);
   virtual FILE           *OpenPipe(const char *command, const char *mode);
   virtual int             ClosePipe(FILE *pipe);
   virtual TString         GetFromPipe(const char *command);
   virtual void            Exit(int code, Bool_t mode = kTRUE);
   virtual void            Abort(int code = 0);
   virtual int             GetPid();
   virtual void            StackTrace();

   //---- Directories
   virtual int             MakeDirectory(const char *name);
   virtual void           *OpenDirectory(const char *name);
   virtual void            FreeDirectory(void *dirp);
   virtual const char     *GetDirEntry(void *dirp);
   virtual void           *GetDirPtr() const { return 0; }
   virtual Bool_t          ChangeDirectory(const char *path);
   virtual const char     *WorkingDirectory();
   virtual const char     *HomeDirectory(const char *userName = 0);
   virtual int             mkdir(const char *name, Bool_t recursive = kFALSE);
   Bool_t                  cd(const char *path) { return ChangeDirectory(path); }
   const char             *pwd() { return WorkingDirectory(); }
   virtual const char     *TempDirectory() const;
   virtual FILE           *TempFileName(TString &base, const char *dir = 0);

   //---- Paths & Files
   virtual const char     *BaseName(const char *pathname);
   virtual const char     *DirName(const char *pathname);
   virtual char           *ConcatFileName(const char *dir, const char *name);
   virtual Bool_t          IsAbsoluteFileName(const char *dir);
   virtual Bool_t          IsFileInIncludePath(const char *name, char **fullpath = 0);
   virtual const char     *PrependPathName(const char *dir, TString& name);
   virtual Bool_t          ExpandPathName(TString &path);
   virtual char           *ExpandPathName(const char *path);
   virtual Bool_t          AccessPathName(const char *path, EAccessMode mode = kFileExists);
   virtual Bool_t          IsPathLocal(const char *path);
   virtual int             CopyFile(const char *from, const char *to, Bool_t overwrite = kFALSE);
   virtual int             Rename(const char *from, const char *to);
   virtual int             Link(const char *from, const char *to);
   virtual int             Symlink(const char *from, const char *to);
   virtual int             Unlink(const char *name);
   int                     GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
   int                     GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
   virtual int             GetPathInfo(const char *path, FileStat_t &buf);
   virtual int             GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree);
   virtual int             Chmod(const char *file, UInt_t mode);
   virtual int             Umask(Int_t mask);
   virtual int             Utime(const char *file, Long_t modtime, Long_t actime);
   virtual const char     *UnixPathName(const char *unixpathname);
   virtual const char     *FindFile(const char *search, TString& file, EAccessMode mode = kFileExists);
   virtual char           *Which(const char *search, const char *file, EAccessMode mode = kFileExists);
   virtual TList          *GetVolumes(Option_t *) const { return 0; }

   //---- Users & Groups
   virtual Int_t           GetUid(const char *user = 0);
   virtual Int_t           GetGid(const char *group = 0);
   virtual Int_t           GetEffectiveUid();
   virtual Int_t           GetEffectiveGid();
   virtual UserGroup_t    *GetUserInfo(Int_t uid);
   virtual UserGroup_t    *GetUserInfo(const char *user = 0);
   virtual UserGroup_t    *GetGroupInfo(Int_t gid);
   virtual UserGroup_t    *GetGroupInfo(const char *group = 0);

   //---- Environment Manipulation
   virtual void            Setenv(const char *name, const char *value);
   virtual void            Unsetenv(const char *name);
   virtual const char     *Getenv(const char *env);

   //---- System Logging
   virtual void            Openlog(const char *name, Int_t options, ELogFacility facility);
   virtual void            Syslog(ELogLevel level, const char *mess);
   virtual void            Closelog();

   //---- Standard Output redirection
   virtual Int_t           RedirectOutput(const char *name, const char *mode = "a", RedirectHandle_t *h = 0);
   virtual void            ShowOutput(RedirectHandle_t *h);

   //---- Dynamic Loading
   virtual void            AddDynamicPath(const char *pathname);
   virtual const char     *GetDynamicPath();
   virtual void            SetDynamicPath(const char *pathname);
   char                   *DynamicPathName(const char *lib, Bool_t quiet = kFALSE);
   virtual const char     *FindDynamicLibrary(TString& lib, Bool_t quiet = kFALSE);
   virtual Func_t          DynFindSymbol(const char *module, const char *entry);
   virtual int             Load(const char *module, const char *entry = "", Bool_t system = kFALSE);
   virtual void            Unload(const char *module);
   virtual void            ListSymbols(const char *module, const char *re = "");
   virtual void            ListLibraries(const char *regexp = "");
   virtual const char     *GetLibraries(const char *regexp = "",
                                        const char *option = "",
                                        Bool_t isRegexp = kTRUE);

   //---- RPC
   virtual TInetAddress    GetHostByName(const char *server);
   virtual TInetAddress    GetPeerName(int sock);
   virtual TInetAddress    GetSockName(int sock);
   virtual int             GetServiceByName(const char *service);
   virtual char           *GetServiceByPort(int port);
   virtual int             OpenConnection(const char *server, int port, int tcpwindowsize = -1, const char *protocol = "tcp");
   virtual int             AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1);
   virtual int             AnnounceUdpService(int port, int backlog);
   virtual int             AnnounceUnixService(int port, int backlog);
   virtual int             AnnounceUnixService(const char *sockpath, int backlog);
   virtual int             AcceptConnection(int sock);
   virtual void            CloseConnection(int sock, Bool_t force = kFALSE);
   virtual int             RecvRaw(int sock, void *buffer, int length, int flag);
   virtual int             SendRaw(int sock, const void *buffer, int length, int flag);
   virtual int             RecvBuf(int sock, void *buffer, int length);
   virtual int             SendBuf(int sock, const void *buffer, int length);
   virtual int             SetSockOpt(int sock, int kind, int val);
   virtual int             GetSockOpt(int sock, int kind, int *val);

   //---- System, CPU and Memory info
   virtual int             GetSysInfo(SysInfo_t *info) const;
   virtual int             GetCpuInfo(CpuInfo_t *info, Int_t sampleTime = 1000) const;
   virtual int             GetMemInfo(MemInfo_t *info) const;
   virtual int             GetProcInfo(ProcInfo_t *info) const;

   //---- ACLiC (Automatic Compiler of Shared Library for CINT)
   virtual void            AddIncludePath(const char *includePath);
   virtual void            AddLinkedLibs(const char *linkedLib);
   virtual int             CompileMacro(const char *filename, Option_t *opt="", const char* library_name = "", const char* build_dir = "", UInt_t dirmode = 0);
   virtual Int_t           GetAclicProperties() const;
   virtual const char     *GetBuildArch() const;
   virtual const char     *GetBuildCompiler() const;
   virtual const char     *GetBuildCompilerVersion() const;
   virtual const char     *GetBuildNode() const;
   virtual const char     *GetBuildDir() const;
   virtual const char     *GetFlagsDebug() const;
   virtual const char     *GetFlagsOpt() const;
   virtual const char     *GetIncludePath();
   virtual const char     *GetLinkedLibs() const;
   virtual const char     *GetLinkdefSuffix() const;
   virtual EAclicMode      GetAclicMode() const;
   virtual const char     *GetMakeExe() const;
   virtual const char     *GetMakeSharedLib() const;
   virtual const char     *GetSoExt() const;
   virtual const char     *GetObjExt() const;
   virtual void            SetBuildDir(const char* build_dir, Bool_t isflat = kFALSE);
   virtual void            SetFlagsDebug(const char *);
   virtual void            SetFlagsOpt(const char *);
   virtual void            SetIncludePath(const char *includePath);
   virtual void            SetMakeExe(const char *directives);
   virtual void            SetAclicMode(EAclicMode mode);
   virtual void            SetMakeSharedLib(const char *directives);
   virtual void            SetLinkedLibs(const char *linkedLibs);
   virtual void            SetLinkdefSuffix(const char *suffix);
   virtual void            SetSoExt(const char *soExt);
   virtual void            SetObjExt(const char *objExt);
   virtual TString         SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const;
   virtual void            CleanCompiledMacros();

   ClassDef(TSystem,0)  //ABC defining a generic interface to the OS
};

R__EXTERN TSystem *gSystem;
R__EXTERN TFileHandler *gXDisplay;  // Display server (X11) input event handler


#endif
 TSystem.h:1
 TSystem.h:2
 TSystem.h:3
 TSystem.h:4
 TSystem.h:5
 TSystem.h:6
 TSystem.h:7
 TSystem.h:8
 TSystem.h:9
 TSystem.h:10
 TSystem.h:11
 TSystem.h:12
 TSystem.h:13
 TSystem.h:14
 TSystem.h:15
 TSystem.h:16
 TSystem.h:17
 TSystem.h:18
 TSystem.h:19
 TSystem.h:20
 TSystem.h:21
 TSystem.h:22
 TSystem.h:23
 TSystem.h:24
 TSystem.h:25
 TSystem.h:26
 TSystem.h:27
 TSystem.h:28
 TSystem.h:29
 TSystem.h:30
 TSystem.h:31
 TSystem.h:32
 TSystem.h:33
 TSystem.h:34
 TSystem.h:35
 TSystem.h:36
 TSystem.h:37
 TSystem.h:38
 TSystem.h:39
 TSystem.h:40
 TSystem.h:41
 TSystem.h:42
 TSystem.h:43
 TSystem.h:44
 TSystem.h:45
 TSystem.h:46
 TSystem.h:47
 TSystem.h:48
 TSystem.h:49
 TSystem.h:50
 TSystem.h:51
 TSystem.h:52
 TSystem.h:53
 TSystem.h:54
 TSystem.h:55
 TSystem.h:56
 TSystem.h:57
 TSystem.h:58
 TSystem.h:59
 TSystem.h:60
 TSystem.h:61
 TSystem.h:62
 TSystem.h:63
 TSystem.h:64
 TSystem.h:65
 TSystem.h:66
 TSystem.h:67
 TSystem.h:68
 TSystem.h:69
 TSystem.h:70
 TSystem.h:71
 TSystem.h:72
 TSystem.h:73
 TSystem.h:74
 TSystem.h:75
 TSystem.h:76
 TSystem.h:77
 TSystem.h:78
 TSystem.h:79
 TSystem.h:80
 TSystem.h:81
 TSystem.h:82
 TSystem.h:83
 TSystem.h:84
 TSystem.h:85
 TSystem.h:86
 TSystem.h:87
 TSystem.h:88
 TSystem.h:89
 TSystem.h:90
 TSystem.h:91
 TSystem.h:92
 TSystem.h:93
 TSystem.h:94
 TSystem.h:95
 TSystem.h:96
 TSystem.h:97
 TSystem.h:98
 TSystem.h:99
 TSystem.h:100
 TSystem.h:101
 TSystem.h:102
 TSystem.h:103
 TSystem.h:104
 TSystem.h:105
 TSystem.h:106
 TSystem.h:107
 TSystem.h:108
 TSystem.h:109
 TSystem.h:110
 TSystem.h:111
 TSystem.h:112
 TSystem.h:113
 TSystem.h:114
 TSystem.h:115
 TSystem.h:116
 TSystem.h:117
 TSystem.h:118
 TSystem.h:119
 TSystem.h:120
 TSystem.h:121
 TSystem.h:122
 TSystem.h:123
 TSystem.h:124
 TSystem.h:125
 TSystem.h:126
 TSystem.h:127
 TSystem.h:128
 TSystem.h:129
 TSystem.h:130
 TSystem.h:131
 TSystem.h:132
 TSystem.h:133
 TSystem.h:134
 TSystem.h:135
 TSystem.h:136
 TSystem.h:137
 TSystem.h:138
 TSystem.h:139
 TSystem.h:140
 TSystem.h:141
 TSystem.h:142
 TSystem.h:143
 TSystem.h:144
 TSystem.h:145
 TSystem.h:146
 TSystem.h:147
 TSystem.h:148
 TSystem.h:149
 TSystem.h:150
 TSystem.h:151
 TSystem.h:152
 TSystem.h:153
 TSystem.h:154
 TSystem.h:155
 TSystem.h:156
 TSystem.h:157
 TSystem.h:158
 TSystem.h:159
 TSystem.h:160
 TSystem.h:161
 TSystem.h:162
 TSystem.h:163
 TSystem.h:164
 TSystem.h:165
 TSystem.h:166
 TSystem.h:167
 TSystem.h:168
 TSystem.h:169
 TSystem.h:170
 TSystem.h:171
 TSystem.h:172
 TSystem.h:173
 TSystem.h:174
 TSystem.h:175
 TSystem.h:176
 TSystem.h:177
 TSystem.h:178
 TSystem.h:179
 TSystem.h:180
 TSystem.h:181
 TSystem.h:182
 TSystem.h:183
 TSystem.h:184
 TSystem.h:185
 TSystem.h:186
 TSystem.h:187
 TSystem.h:188
 TSystem.h:189
 TSystem.h:190
 TSystem.h:191
 TSystem.h:192
 TSystem.h:193
 TSystem.h:194
 TSystem.h:195
 TSystem.h:196
 TSystem.h:197
 TSystem.h:198
 TSystem.h:199
 TSystem.h:200
 TSystem.h:201
 TSystem.h:202
 TSystem.h:203
 TSystem.h:204
 TSystem.h:205
 TSystem.h:206
 TSystem.h:207
 TSystem.h:208
 TSystem.h:209
 TSystem.h:210
 TSystem.h:211
 TSystem.h:212
 TSystem.h:213
 TSystem.h:214
 TSystem.h:215
 TSystem.h:216
 TSystem.h:217
 TSystem.h:218
 TSystem.h:219
 TSystem.h:220
 TSystem.h:221
 TSystem.h:222
 TSystem.h:223
 TSystem.h:224
 TSystem.h:225
 TSystem.h:226
 TSystem.h:227
 TSystem.h:228
 TSystem.h:229
 TSystem.h:230
 TSystem.h:231
 TSystem.h:232
 TSystem.h:233
 TSystem.h:234
 TSystem.h:235
 TSystem.h:236
 TSystem.h:237
 TSystem.h:238
 TSystem.h:239
 TSystem.h:240
 TSystem.h:241
 TSystem.h:242
 TSystem.h:243
 TSystem.h:244
 TSystem.h:245
 TSystem.h:246
 TSystem.h:247
 TSystem.h:248
 TSystem.h:249
 TSystem.h:250
 TSystem.h:251
 TSystem.h:252
 TSystem.h:253
 TSystem.h:254
 TSystem.h:255
 TSystem.h:256
 TSystem.h:257
 TSystem.h:258
 TSystem.h:259
 TSystem.h:260
 TSystem.h:261
 TSystem.h:262
 TSystem.h:263
 TSystem.h:264
 TSystem.h:265
 TSystem.h:266
 TSystem.h:267
 TSystem.h:268
 TSystem.h:269
 TSystem.h:270
 TSystem.h:271
 TSystem.h:272
 TSystem.h:273
 TSystem.h:274
 TSystem.h:275
 TSystem.h:276
 TSystem.h:277
 TSystem.h:278
 TSystem.h:279
 TSystem.h:280
 TSystem.h:281
 TSystem.h:282
 TSystem.h:283
 TSystem.h:284
 TSystem.h:285
 TSystem.h:286
 TSystem.h:287
 TSystem.h:288
 TSystem.h:289
 TSystem.h:290
 TSystem.h:291
 TSystem.h:292
 TSystem.h:293
 TSystem.h:294
 TSystem.h:295
 TSystem.h:296
 TSystem.h:297
 TSystem.h:298
 TSystem.h:299
 TSystem.h:300
 TSystem.h:301
 TSystem.h:302
 TSystem.h:303
 TSystem.h:304
 TSystem.h:305
 TSystem.h:306
 TSystem.h:307
 TSystem.h:308
 TSystem.h:309
 TSystem.h:310
 TSystem.h:311
 TSystem.h:312
 TSystem.h:313
 TSystem.h:314
 TSystem.h:315
 TSystem.h:316
 TSystem.h:317
 TSystem.h:318
 TSystem.h:319
 TSystem.h:320
 TSystem.h:321
 TSystem.h:322
 TSystem.h:323
 TSystem.h:324
 TSystem.h:325
 TSystem.h:326
 TSystem.h:327
 TSystem.h:328
 TSystem.h:329
 TSystem.h:330
 TSystem.h:331
 TSystem.h:332
 TSystem.h:333
 TSystem.h:334
 TSystem.h:335
 TSystem.h:336
 TSystem.h:337
 TSystem.h:338
 TSystem.h:339
 TSystem.h:340
 TSystem.h:341
 TSystem.h:342
 TSystem.h:343
 TSystem.h:344
 TSystem.h:345
 TSystem.h:346
 TSystem.h:347
 TSystem.h:348
 TSystem.h:349
 TSystem.h:350
 TSystem.h:351
 TSystem.h:352
 TSystem.h:353
 TSystem.h:354
 TSystem.h:355
 TSystem.h:356
 TSystem.h:357
 TSystem.h:358
 TSystem.h:359
 TSystem.h:360
 TSystem.h:361
 TSystem.h:362
 TSystem.h:363
 TSystem.h:364
 TSystem.h:365
 TSystem.h:366
 TSystem.h:367
 TSystem.h:368
 TSystem.h:369
 TSystem.h:370
 TSystem.h:371
 TSystem.h:372
 TSystem.h:373
 TSystem.h:374
 TSystem.h:375
 TSystem.h:376
 TSystem.h:377
 TSystem.h:378
 TSystem.h:379
 TSystem.h:380
 TSystem.h:381
 TSystem.h:382
 TSystem.h:383
 TSystem.h:384
 TSystem.h:385
 TSystem.h:386
 TSystem.h:387
 TSystem.h:388
 TSystem.h:389
 TSystem.h:390
 TSystem.h:391
 TSystem.h:392
 TSystem.h:393
 TSystem.h:394
 TSystem.h:395
 TSystem.h:396
 TSystem.h:397
 TSystem.h:398
 TSystem.h:399
 TSystem.h:400
 TSystem.h:401
 TSystem.h:402
 TSystem.h:403
 TSystem.h:404
 TSystem.h:405
 TSystem.h:406
 TSystem.h:407
 TSystem.h:408
 TSystem.h:409
 TSystem.h:410
 TSystem.h:411
 TSystem.h:412
 TSystem.h:413
 TSystem.h:414
 TSystem.h:415
 TSystem.h:416
 TSystem.h:417
 TSystem.h:418
 TSystem.h:419
 TSystem.h:420
 TSystem.h:421
 TSystem.h:422
 TSystem.h:423
 TSystem.h:424
 TSystem.h:425
 TSystem.h:426
 TSystem.h:427
 TSystem.h:428
 TSystem.h:429
 TSystem.h:430
 TSystem.h:431
 TSystem.h:432
 TSystem.h:433
 TSystem.h:434
 TSystem.h:435
 TSystem.h:436
 TSystem.h:437
 TSystem.h:438
 TSystem.h:439
 TSystem.h:440
 TSystem.h:441
 TSystem.h:442
 TSystem.h:443
 TSystem.h:444
 TSystem.h:445
 TSystem.h:446
 TSystem.h:447
 TSystem.h:448
 TSystem.h:449
 TSystem.h:450
 TSystem.h:451
 TSystem.h:452
 TSystem.h:453
 TSystem.h:454
 TSystem.h:455
 TSystem.h:456
 TSystem.h:457
 TSystem.h:458
 TSystem.h:459
 TSystem.h:460
 TSystem.h:461
 TSystem.h:462
 TSystem.h:463
 TSystem.h:464
 TSystem.h:465
 TSystem.h:466
 TSystem.h:467
 TSystem.h:468
 TSystem.h:469
 TSystem.h:470
 TSystem.h:471
 TSystem.h:472
 TSystem.h:473
 TSystem.h:474
 TSystem.h:475
 TSystem.h:476
 TSystem.h:477
 TSystem.h:478
 TSystem.h:479
 TSystem.h:480
 TSystem.h:481
 TSystem.h:482
 TSystem.h:483
 TSystem.h:484
 TSystem.h:485
 TSystem.h:486
 TSystem.h:487
 TSystem.h:488
 TSystem.h:489
 TSystem.h:490
 TSystem.h:491
 TSystem.h:492
 TSystem.h:493
 TSystem.h:494
 TSystem.h:495
 TSystem.h:496
 TSystem.h:497
 TSystem.h:498
 TSystem.h:499
 TSystem.h:500
 TSystem.h:501
 TSystem.h:502
 TSystem.h:503
 TSystem.h:504
 TSystem.h:505
 TSystem.h:506
 TSystem.h:507
 TSystem.h:508
 TSystem.h:509
 TSystem.h:510
 TSystem.h:511
 TSystem.h:512
 TSystem.h:513
 TSystem.h:514
 TSystem.h:515
 TSystem.h:516
 TSystem.h:517
 TSystem.h:518
 TSystem.h:519
 TSystem.h:520
 TSystem.h:521
 TSystem.h:522
 TSystem.h:523
 TSystem.h:524
 TSystem.h:525
 TSystem.h:526
 TSystem.h:527
 TSystem.h:528
 TSystem.h:529
 TSystem.h:530
 TSystem.h:531
 TSystem.h:532
 TSystem.h:533
 TSystem.h:534
 TSystem.h:535
 TSystem.h:536
 TSystem.h:537
 TSystem.h:538
 TSystem.h:539
 TSystem.h:540
 TSystem.h:541
 TSystem.h:542
 TSystem.h:543
 TSystem.h:544
 TSystem.h:545
 TSystem.h:546
 TSystem.h:547
 TSystem.h:548
 TSystem.h:549