46#include "compiledata.h"
47#include "RConfigure.h"
113 Error(
"TSystem",
"only one instance of TSystem allowed");
275#ifdef R__SOLARIS_CC50
291#ifdef R__SOLARIS_CC50
368 catch (std::exception& exc) {
380 Warning(
"Run",
"instructed to abort");
387 catch (
const char *str) {
392 Warning(
"Run",
"handle uncaugth exception, terminating");
433 return gROOT->IsInterrupted();
514 if (t->
IsSync() == mode) {
528 if (to && to->
IsAsync() && timeout > 0) {
694 FILE *pipe =
OpenPipe(command,
"r");
696 SysError(
"GetFromPipe",
"cannot run command \"%s\"", command);
701 while (
line.Gets(pipe)) {
709 Error(
"GetFromPipe",
"command \"%s\" returned %d", command,
r);
775 while ((helper = (
TSystem*) next()))
789 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
790 if (
h->LoadPlugin() == -1)
794 }
else if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
795 if (
h->LoadPlugin() == -1)
797 helper = (
TSystem*)
h->ExecPlugin(0);
827 return (checkproto || checkdir);
889 return std::string();
905 return std::string();
945 if (
name[0] ==
'/' &&
name[1] ==
'\0')
948 if ((cp = (
char*)strrchr(
name,
'/')))
952 Error(
"BaseName",
"name = 0");
962 return dir[0] ==
'/';
988 while ( incPath.
Index(
" :") != -1 ) {
995 incPath.
Prepend(fileLocation+
":.:");
997 char *actual =
Which(incPath,realname);
1016 if (pathname && strchr(pathname,
'/')) {
1020 static char *buf = 0;
1021 int pathlen = strlen(pathname);
1022 if (pathlen > len) {
1025 buf =
new char [len+1];
1027 strcpy(buf, pathname);
1029 char *
r = buf+pathlen-1;
1031 while (
r>buf && *(
r)==
'/') { --
r; }
1033 while (
r>buf && *(
r)!=
'/') { --
r; }
1036 while (
r>buf && *(
r)==
'/') { --
r; }
1039 if (
r==buf && *(
r)!=
'/') {
1092 TTHREAD_TLS_ARRAY(
char, kBufSize, xname);
1110 char xname[kBufSize];
1125 int n, ier, iter, lx, ncopy;
1126 char *inp, *out, *
x, *t, *buff;
1127 const char *
b, *
c, *
e;
1129 buff =
new char[kBufSize * 4];
1131 iter = 0; xname[0] = 0; inp = buff + kBufSize; out = inp + kBufSize;
1132 inp[-1] =
' '; inp[0] = 0; out[-1] =
' ';
1133 c = fname + strspn(fname,
" \t\f\r");
1136 strlcat(inp,
c, kBufSize);
1139 iter++;
c = inp; ier = 0;
1143 if (
c[0] ==
'~' &&
c[1] ==
'/') {
1148 strlcpy(
x, p, kBufSize);
1155 }
else if (
c[0] ==
'~' &&
c[1] !=
'/') {
1156 n = strcspn(
c+1,
"/ ");
1157 assert((
n+1) < kBufSize &&
"This should have been prevented by the truncation 'strlcat(inp, c, kBufSize)'");
1159 (
void)strlcpy(buff,
c+1,
n+1);
1164 strlcpy(
x, p, kBufSize);
1174 for ( ;
c[0];
c++) {
1178 if (
c[0] ==
'.' &&
c[1] ==
'/' &&
c[-1] ==
' ') {
1180 strlcpy(buff, wd.c_str(), kBufSize);
1185 strlcpy(
x, p, kBufSize);
x += strlen(p);
c =
e-1;
continue;
1192 if (
c[1] ==
'(')
b++;
1193 if (
c[1] ==
'{')
b++;
1197 for (
e =
b; isalnum(
e[0]) ||
e[0] ==
'_';
e++) ;
1198 buff[0] = 0; strncat(buff,
b,
e-
b);
1201 for (t = buff; (t[0] = toupper(t[0])); t++) ;
1205 for (t = buff; (t[0] = tolower(t[0])); t++) ;
1208 if (!p && !strcmp(buff,
"cwd")) {
1210 strlcpy(buff, wd.c_str(), kBufSize);
1213 if (!p && !strcmp(buff,
"$")) {
1222 if (
c[1] &&
c[1]!=
'\\' &&
c[1]!=
';' &&
c[1]!=
'/')
1230 if (lp >= kBufSize) {
1232 strlcpy(
x, p, kBufSize);
1238 c = (
b==
c+1) ?
e-1 :
e;
1243 x[0] = 0; lx =
x - out;
1244 if (ier && iter < 3) { strlcpy(inp, out, kBufSize);
goto again; }
1245 ncopy = (lx >= kBufSize) ? kBufSize-1 : lx;
1246 xname[0] = 0; strncat(xname, out, ncopy);
1250 if (ier || ncopy != lx) {
1251 ::Error(
"TSystem::ExpandFileName",
"input: %s, output: %s", fname, xname);
1301 if (strlen(url.
GetHost()) > 0) {
1306 if (!strcmp(
a.GetHostName(),
b.GetHostName()) ||
1307 !strcmp(
a.GetHostAddress(),
b.GetHostAddress())) {
1311 if (strlen(url.
GetUser()) > 0) {
1394 int res =
GetPathInfo(path,
id, &lsize, flags, modtime);
1396 if (res == 0 && size) {
1398 Error(
"GetPathInfo",
"file %s > 2 GB, use GetPathInfo() with Long64_t size", path);
1540 FindFile(search, wfilString, mode);
1541 if (wfilString.
IsNull())
return 0;
1717 Error(
"ShowOutput",
"handle not specified");
1723 Error(
"ShowOutput",
"file '%s' cannot be read",
h->fFile.Data());
1729 if (!(
f = fopen(
h->fFile.Data(),
"r"))) {
1730 Error(
"ShowOutput",
"file '%s' cannot be open",
h->fFile.Data());
1735 off_t ltot = lseek(fileno(
f), (off_t) 0, SEEK_END);
1736 Int_t begin = (
h->fReadOffSet > 0 &&
h->fReadOffSet < ltot) ?
h->fReadOffSet : 0;
1737 lseek(fileno(
f), (off_t) begin, SEEK_SET);
1738 Int_t left = ltot - begin;
1741 const Int_t kMAXBUF = 16384;
1743 Int_t wanted = (left > kMAXBUF-1) ? kMAXBUF-1 : left;
1746 while ((len = read(fileno(
f), buf, wanted)) < 0 &&
1751 SysError(
"ShowOutput",
"error reading log file");
1757 fprintf(stderr,
"%s", buf);
1761 wanted = (left > kMAXBUF) ? kMAXBUF : left;
1763 }
while (len > 0 && left > 0);
1766 h->fReadOffSet = ltot;
1806 if (left == right)
return kTRUE;
1808 if (left==0 || right==0)
return kFALSE;
1810 if ( (strcmp(right,left)==0) ) {
1816 char leftname[_MAX_PATH];
1817 char rightname[_MAX_PATH];
1818 _fullpath( leftname, left, _MAX_PATH );
1819 _fullpath( rightname, right, _MAX_PATH );
1820 return ((stricmp(leftname, rightname)==0));
1822 struct stat rightBuf;
1823 struct stat leftBuf;
1824 return ( ( 0 == stat( left, & leftBuf ) )
1825 && ( 0 == stat( right, & rightBuf ) )
1826 && ( leftBuf.st_dev == rightBuf.st_dev )
1827 && ( leftBuf.st_ino == rightBuf.st_ino )
1828 && ( leftBuf.st_size == rightBuf.st_size )
1829 && ( leftBuf.st_mtime == rightBuf.st_mtime )
1859 if (idx == 0 || libs[idx-1] ==
'/' || libs[idx-1] ==
'\\') {
1862 if (!
l.EndsWith(
".") && libs[idx]==
'.')
1865 while (idx < len && isdigit(libs[idx])) {
1868 if (libs[idx] ==
'.') {
1872 while (idx < len && libs[idx] !=
'.') {
1873 if (libs[idx] ==
' ' || idx+1 == len) {
1880 if (
l[
l.Length()-1] ==
'.') {
1881 l.Remove(
l.Length()-1);
1883 if (
l.BeginsWith(
"lib")) {
1884 l.Replace(0, 3,
"-l");
1886 if ((idx == 0 || libs[idx-1] ==
' ') &&
1887 (libs[idx+
l.Length()] ==
' ' || libs[idx+
l.Length()] == 0)) {
1901 libmapfilename = path;
1902 idx = libmapfilename.
Last(
'.');
1904 libmapfilename.
Remove(idx);
1906 libmapfilename +=
".rootmap";
1908 if (
gDebug > 0)
Info(
"Load",
"loading %s", libmapfilename.
Data());
1910 deplibs =
gInterpreter->GetSharedLibDeps(moduleBasename);
1917 if (strcmp(module,deplib)==0) {
1921 Info(
"Load",
"loading dependent library %s for library %s",
1923 if ((ret =
Load(deplib,
"", system)) < 0) {
1933 const char *dirname =
DirName(path);
1947 if (ret < 0) ret = -1;
1949 Info(
"Load",
"loaded library %s, status %d", path, ret);
1952 Error(
"Load",
"version mismatch, %s = %d, ROOT = %d",
1953 path,
v,
gROOT->GetVersionInt());
1961 if (!entry || !entry[0] || ret < 0)
return ret;
1977 if (!mapfile || !mapfile->
GetTable())
return 0;
1979 std::set<std::string> loadedlibs;
1980 std::set<std::string> failedlibs;
1984 while ((rec = (
TEnvRec*) iEnvRec())) {
1990 if (failedlibs.find(lib.
Data()) != failedlibs.end()) {
2002 if (loadedlibs.find(lib.
Data()) == loadedlibs.end()) {
2006 if (res == 0) ++nlibs;
2007 loadedlibs.insert(lib.
Data());
2009 failedlibs.insert(lib.
Data());
2078 TRegexp separator(
"[^ \\t\\s]+");
2080 Ssiz_t start = 0, index = 0, end = 0;
2084 Printf(
"Loaded shared libraries");
2085 Printf(
"=======================");
2087 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2088 index = libs.
Index(separator, &end, start);
2090 s = libs(index, end);
2091 if (
s.BeginsWith(
"-")) {
2092 if (
s.BeginsWith(
"-l")) {
2104 Printf(
"-----------------------");
2105 Printf(
"%d libraries loaded", i);
2106 Printf(
"=======================");
2114 TTHREAD_TLS_DECL(
TString, gLastErrorString);
2115 return gLastErrorString;
2189 if (libs.
Length() == 0) {
2195 static TString lastAddMissing;
2196 if ( lastLinked != slinked ) {
2198 static TRegexp separator(
"[^ \\t\\s]+");
2199 lastLinked = slinked;
2200 lastAddMissing.
Clear();
2202 Ssiz_t start, index, end;
2203 start = index = end = 0;
2205 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2206 index = slinked.
Index(separator,&end,start);
2208 TString sub = slinked(index,end);
2209 if (sub[0]==
'-' && sub[1]==
'L') {
2224 }
else if (libs.
Length() != 0) {
2227 static TRegexp separator(
"[^ \\t\\s]+");
2228 Ssiz_t start, index, end;
2229 start = index = end = 0;
2231 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2232 index = slinked.
Index(separator,&end,start);
2234 TString sub = slinked(index,end);
2235 if (sub[0]!=
'-' && sub[1]!=
'L') {
2245 if (regexp && *regexp) {
2246 static TRegexp separator(
"[^ \\t\\s]+");
2249 Ssiz_t start, index, end;
2250 start = index = end = 0;
2252 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2253 index = libs.
Index(separator,&end,start);
2255 s = libs(index,end);
2256 if ((isRegexp &&
s.Index(user_re) !=
kNPOS) ||
2257 (!isRegexp &&
s.Index(regexp) !=
kNPOS)) {
2268#if defined(R__MACOSX)
2274 static TRegexp separator(
"[^ \\t\\s]+");
2275 static TRegexp dynload(
"/lib-dynload/");
2277 Ssiz_t start, index, end;
2278 start = index = end = 0;
2280 while ((start < libs2.
Length()) && (index !=
kNPOS)) {
2281 index = libs2.
Index(separator, &end, start);
2284 if (
s.Index(dynload) ==
kNPOS) {
2295#if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)
2300 static TRegexp separator(
"[^ \\t\\s]+");
2301 static TRegexp user_so(
"\\.so$");
2303 Ssiz_t start, index, end;
2304 start = index = end = 0;
2306 while ((start < libs2.
Length()) && (index !=
kNPOS)) {
2307 index = libs2.
Index(separator, &end, start);
2312 if (
s.Index(user_so) !=
kNPOS) {
2313 s.ReplaceAll(
".so",
".dylib");
2315 s.Replace( 0,
s.Last(
'/')+1, 0, 0);
2316 s.Replace( 0,
s.Last(
'\\')+1, 0, 0);
2546 target = tobedeleted;
2547 delete [] tobedeleted;
2552static TString R__Exec(
const char *cmd)
2563 while ((
x = fgetc(
f))!=EOF ) {
2564 if (
x==
'\n' ||
x==
'\r')
break;
2572static void R__FixLink(
TString &cmd)
2578 TString res = R__Exec(
"link 2>&1");
2580 if (res.
Contains(
"Microsoft (R) Incremental Linker"))
2584 res = R__Exec(
"cygpath . 2>&1");
2590 res = R__Exec(
"which cl.exe 2>&1|grep cl|sed 's,cl\\.exe$,link\\.exe,' 2>&1");
2592 res = R__Exec(
Form(
"cygpath -w '%s' 2>&1",res.
Data()));
2600#if defined(__CYGWIN__)
2602 if (path.
Length() > 2 && path[1]==
':') {
2621 const char * stderrfile =
"/dev/null";
2626 TString bakdepfilename = depfilename +
".bak";
2629 TString touch =
"echo # > "; touch +=
"\"" + depfilename +
"\"";
2631 TString touch =
"echo > "; touch +=
"\"" + depfilename +
"\"";
2633 TString builddep =
"rmkdepend";
2635 builddep +=
" \"-f";
2636 builddep += depfilename;
2640 if ( build_loc.
Length() > (len+1) ) {
2641 builddep +=
" \"-p";
2642 if (build_loc[len] ==
'/' || build_loc[len+1] !=
'\\' ) {
2652 builddep +=
" \"-p";
2656 builddep +=
" -Y -- ";
2658 builddep +=
" \"-I"+rootsysInclude+
"\" ";
2659 builddep += includes;
2660 builddep += defines;
2661 builddep +=
" -- \"";
2662 builddep += filename;
2667 if ( library.
Length() > (len+1) ) {
2668 if (library[len] ==
'/' || library[len+1] !=
'\\' ) {
2669 targetname = library.
Data() + len + 1;
2671 targetname = library.
Data() + len + 2;
2674 targetname = library;
2677 targetname = library;
2682 builddep +=
"\" > ";
2683 builddep += stderrfile;
2684 builddep +=
" 2>&1 ";
2689#if defined(R__HAS_CLING_DICTVERSION)
2691 char *clingdictversion =
gSystem->
Which(incPath,
"clingdictversion.h");
2692 if (clingdictversion) {
2695 delete [] clingdictversion;
2697 R__AddPath(adddictdep,rootsysInclude+
"/clingdictversion.h ");
2702 const char *dictHeaders[] = {
"RVersion.h",
"RConfig.h",
"TClass.h",
2703 "TDictAttributeMap.h",
"TInterpreter.h",
"TROOT.h",
"TBuffer.h",
2704 "TMemberInspector.h",
"TError.h",
"RtypesImp.h",
"TIsAProxy.h",
2705 "TFileMergeInfo.h",
"TCollectionProxyInfo.h"};
2707 for (
unsigned int h=0;
h <
sizeof(dictHeaders)/
sizeof(dictHeaders[0]); ++
h)
2712 delete [] rootVersion;
2714 R__AddPath(adddictdep,rootsysInclude +
"/" + dictHeaders[
h]);
2725 delete [] rootCling;
2728 adddictdep +=
" >> \""+depfilename+
"\"";
2730 TString addversiondep(
"echo ");
2731 addversiondep += libname + version_var_prefix +
" \"" +
ROOT_RELEASE +
"\" >> \""+depfilename+
"\"";
2740 if (depbuilt) depbuilt = !
gSystem->
Exec(builddep);
2741 if (depbuilt) depbuilt = !
gSystem->
Exec(adddictdep);
2742 if (depbuilt) depbuilt = !
gSystem->
Exec(addversiondep);
2745 ::Warning(
"ACLiC",
"Failed to generate the dependency file for %s",
2876 const char *library_specified,
2877 const char *build_dir,
2880 static const char *version_var_prefix =
"__ROOTBUILDVERSION=";
2891 keep = (strchr(opt,
'k')!=0);
2892 recompile = (strchr(opt,
'f')!=0);
2893 if (strchr(opt,
'O')!=0) {
2896 if (strchr(opt,
'g')!=0) {
2899 if (strchr(opt,
'c')!=0) {
2902 withInfo = strchr(opt,
's') == 0;
2903 verbose = strchr(opt,
'v') != 0;
2904 internalDebug = strchr(opt,
'd') != 0;
2907 TString rootbuild = ROOTBUILD;
2919 if (build_dir && strlen(build_dir)) build_loc = build_dir;
2920 if (build_loc ==
".") {
2933 incPath.
Append(fromConfig);
2936 auto posISysRoot = incPath.
Index(
" -isysroot \"");
2937 if (posISysRoot !=
kNPOS) {
2938 auto posISysRootEnd = incPath.
Index(
'"', posISysRoot + 12);
2939 if (posISysRootEnd !=
kNPOS) {
2942 incPath.
Insert(posISysRootEnd - 1,
"/usr/include/");
2943 incPath.
Replace(posISysRoot, 12,
":\"");
2946 while ( incPath.
Index(
" :") != -1 ) {
2953 TString expFileName(filename);
2956 TString library = expFileName;
2959 const char *whichlibrary =
Which(incPath,library);
2961 library = whichlibrary;
2962 delete [] whichlibrary;
2964 ::Error(
"ACLiC",
"The file %s can not be found in the include path: %s",filename,incPath.
Data());
2969 ::Error(
"ACLiC",
"The file %s can not be found.",filename);
2980 TString filename_fullpath = library;
2987 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
2988 file_dirname.
Prepend(library(0,2));
2990 TString file_location( file_dirname );
2991 incPath.
Prepend( file_location +
":" );
2995 extension.Replace( 0, dot_pos+1, 0 , 0);
2996 TString libname_noext = library;
2997 if (dot_pos>=0) libname_noext.
Remove( dot_pos );
3006 if (library_specified && strlen(library_specified) ) {
3008 libname =
BaseName( library_specified );
3009 library = library_specified;
3018 TString libname_ext ( libname );
3019 libname_ext +=
"." +
fSoExt;
3026 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
3027 lib_dirname.
Prepend(library(0,2));
3030 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"/.", 2) == 0 ) {
3033 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"\\.", 2) == 0 ) {
3036 TString lib_location( lib_dirname );
3039 if (build_loc.
Length()==0) {
3040 build_loc = lib_location;
3043 TRegexp disk_finder (
"[A-z]:");
3045 if (pos==0) library.
Remove(pos,3);
3046 pos = lib_location.
Index( disk_finder );
3047 if (pos==0) lib_location.
Remove(pos,3);
3056 TString build_loc_store( build_loc );
3057 if (!flatBuildDir) {
3062 mkdirFailed = (0 !=
mkdir(build_loc,
true));
3063 if (mkdirFailed && !canWriteBuild_loc) {
3066 build_loc = build_loc_store;
3068 }
else if (!mkdirFailed && dirmode!=0) {
3069 Chmod(build_loc,dirmode);
3081 ::Info(
"ACLiC",
"script has already been loaded in interpreted mode");
3082 ::Info(
"ACLiC",
"unloading %s and compiling it", filename);
3097 TRegexp rel_inc(
" -I[^\"/\\$%-][^:-]+");
3099 pos = rel_inc.
Index(includes,&len);
3101 TString sub = includes(pos,len);
3107 includes.
Replace(pos,len,sub);
3108 pos = rel_inc.
Index(includes,&len);
3113 TRegexp rel_inc(
" -I\"[^/\\$%-][^:-]+");
3115 pos = rel_inc.
Index(includes,&len);
3117 TString sub = includes(pos,len);
3121 includes.
Replace(pos,len,sub);
3122 pos = rel_inc.
Index(includes,&len);
3143 TRegexp rel_def(
"-D[^\\s\\t\\n\\r]*");
3145 pos = rel_def.
Index(cmd,&len);
3147 defines += cmd(pos,len);
3149 pos = rel_def.
Index(cmd,&len,pos+1);
3177 Long_t lib_time, file_time;
3181 (lib_time < file_time))) {
3191 depdir = emergency_loc;
3202 FILE * depfile = fopen(depfilename.
Data(),
"r");
3211 TString version_var = libname + version_var_prefix;
3214 char *
line =
new char[sz];
3220 Bool_t hasversion =
false;
3222 while ((
c = fgetc(depfile)) != EOF) {
3225 while ((
c = fgetc(depfile)) != EOF) {
3232 if (current &&
line[current-1]==
'=' && strncmp(version_var.
Data(),
line,current)==0) {
3238 }
else if (isspace(
c) && !nested) {
3240 if (
line[current-1]!=
':') {
3249 modified |= ( lib_time <= filetime );
3256 if (current==sz-1) {
3258 char *newline =
new char[sz];
3259 memcpy(newline,
line, current);
3263 if (
c==
'"') nested = !nested;
3272 recompile = modified;
3289 && (lib_time>load_time)) {
3294 if ( !recompile && reload ) {
3297 ::Info(
"ACLiC",
"%s has been modified and will be reloaded",
3320 ::Info(
"ACLiC",
"%s script has already been compiled and loaded",
3321 modified ?
"modified" :
"unmodified");
3328 ::Info(
"ACLiC",
"it will be regenerated and reloaded!");
3346 libmapfilename +=
".rootmap";
3347#if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) || defined(R__WIN32)
3352 Bool_t linkDepLibraries = !produceRootmap;
3354#if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5))
3356#elif defined(R__WIN32)
3361 produceRootmap = linkLibs & 0x2;
3362 linkDepLibraries = linkLibs & 0x1;
3366 bool useCxxModules =
3367#ifdef R__USE_CXXMODULES
3373 auto LoadLibrary = [useCxxModules, produceRootmap](
const TString& lib) {
3382 if (useCxxModules && !produceRootmap) {
3383 using namespace std;
3384 string deps =
gInterpreter->GetSharedLibDeps(lib,
true);
3385 istringstream iss(deps);
3386 vector<string> libs {istream_iterator<std::string>{iss}, istream_iterator<string>{}};
3388 for (
auto I = libs.begin() + 1,
E = libs.end();
I !=
E; ++
I)
3409 return LoadLibrary(library);
3414 if (!canWrite && recompile) {
3417 ::Warning(
"ACLiC",
"Could not create the directory: %s",
3420 ::Warning(
"ACLiC",
"%s is not writable!",
3423 if (emergency_loc == build_dir ) {
3424 ::Error(
"ACLiC",
"%s is the last resort location (i.e. temp location)",build_loc.
Data());
3427 ::Warning(
"ACLiC",
"Output will be written to %s",
3428 emergency_loc.
Data());
3429 return CompileMacro(expFileName, opt, library_specified, emergency_loc, dirmode);
3433 Info(
"ACLiC",
"creating shared library %s",library.
Data());
3439 TString dict = libname +
"_ACLiC_dict";
3443 static const int maxforbidden = 27;
3444 static const char *forbidden_chars[maxforbidden] =
3445 {
"+",
"-",
"*",
"/",
"&",
"%",
"|",
"^",
">",
"<",
3446 "=",
"~",
".",
"(",
")",
"[",
"]",
"!",
",",
"$",
3447 " ",
":",
"'",
"#",
"@",
"\\",
"\"" };
3448 for(
int ic = 0; ic < maxforbidden; ic++ ) {
3463 linkdef +=
"_ACLiC_linkdef.h";
3464 std::ofstream linkdefFile( linkdef, std::ios::out );
3465 linkdefFile <<
"// File Automatically generated by the ROOT Script Compiler "
3467 linkdefFile << std::endl;
3468 linkdefFile <<
"#ifdef __CINT__" << std::endl;
3469 linkdefFile << std::endl;
3470 linkdefFile <<
"#pragma link C++ nestedclasses;" << std::endl;
3471 linkdefFile <<
"#pragma link C++ nestedtypedefs;" << std::endl;
3472 linkdefFile << std::endl;
3476 const char * extensions[] = {
".h",
".hh",
".hpp",
".hxx",
".hPP",
".hXX" };
3479 for (i = 0; i < 6; i++ ) {
3483 extra_linkdef.
Append(extensions[i]);
3486 if (verboseLevel>4 && withInfo) {
3487 Info(
"ACLiC",
"including extra linkdef file: %s",
name);
3489 linkdefFile <<
"#include \"" <<
name <<
"\"" << std::endl;
3494 if (verboseLevel>5 && withInfo) {
3495 Info(
"ACLiC",
"looking for header in: %s",incPath.
Data());
3497 for (i = 0; i < 6; i++ ) {
3500 lookup.
Append(extensions[i]);
3507 linkdefFile <<
"#pragma link C++ defined_in \""<<filename_fullpath <<
"\";" << std::endl;
3508 linkdefFile << std::endl;
3509 linkdefFile <<
"#endif" << std::endl;
3510 linkdefFile.close();
3515 mapfile +=
"_ACLiC_map";
3516 TString mapfilein = mapfile +
".in";
3517 TString mapfileout = mapfile +
".out";
3520 if (!useCxxModules) {
3523 needLoadMap =
kTRUE;
3527 std::ofstream mapfileStream( mapfilein, std::ios::out );
3530 TString sname =
"system.rootmap";
3543 mapfileStream <<
file << std::endl;
3545 mapfileStream <<
file << std::endl;
3546 mapfileStream <<
name << std::endl;
3548 for (i = 0; i <
gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
3553 mapfileStream.close();
3558 rcling +=
" -v0 \"--lib-list-prefix=";
3560 rcling +=
"\" -f \"";
3563 if (produceRootmap && !useCxxModules) {
3564 rcling +=
" -rml " + libname +
" -rmf \"" + libmapfilename +
"\" ";
3565 rcling.
Append(
"-DR__ACLIC_ROOTMAP ");
3570 rcling.
Append(fromConfig);
3572 if (!extraFlags.
IsNull()) {
3575 rcling.
Append(extraFlags);
3581 if (useCxxModules && produceRootmap) {
3582 rcling +=
" -cxxmodule ";
3584 TString moduleName = libname +
"_ACLiC_dict";
3586 moduleName = moduleName.
Remove(0, 3);
3587 TString moduleMapName = moduleName +
".modulemap";
3588 TString moduleMapFullPath = build_loc +
"/" + moduleMapName;
3591 ::Info(
"ACLiC",
"File %s already exists!", moduleMapFullPath.
Data());
3595 std::ofstream moduleMapFile(moduleMapFullPath, std::ios::out);
3596 moduleMapFile <<
"module \"" << moduleName <<
"\" {" << std::endl;
3597 moduleMapFile <<
" header \"" << relative_path <<
"\"" << std::endl;
3598 moduleMapFile <<
" export *" << std::endl;
3599 moduleMapFile <<
" link \"" << libname_ext <<
"\"" << std::endl;
3600 moduleMapFile <<
"}" << std::endl;
3601 moduleMapFile.close();
3603 rcling.
Append(
" \"-fmodule-map-file=" + moduleMapFullPath +
"\" ");
3611 if (verboseLevel>3) {
3612 ::Info(
"ACLiC",
"creating the dictionary files");
3613 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", rcling.
Data());
3619 if (dictResult==139)
::Error(
"ACLiC",
"Dictionary generation failed with a core dump!");
3623 Bool_t result = !dictResult;
3631 std::ifstream liblist(mapfileout);
3633 while ( liblist >> libtoload ) {
3635 if (libtoload ==
"#") {
3637 std::string toskipcomment;
3638 std::getline(liblist,toskipcomment);
3641 if (libtoload != library && libtoload != libname && libtoload != libname_ext) {
3642 if (produceRootmap) {
3643 if (loadLib || linkDepLibraries ) {
3644 result =
gROOT->LoadClass(
"", libtoload) >= 0;
3650 if (!linkedlibs.
Contains(libtoload)) {
3652 depLibraries.
Append(
" ");
3654 depLibraries = depLibraries.
Strip();
3657 gROOT->LoadClass(
"", libtoload);
3660 unsigned char c = liblist.peek();
3661 if (
c==
'\n' ||
c==
'\r') {
3687 for (
auto tokenObj : *linkLibrariesNoQuotes.
Tokenize(
" ")) {
3688 singleLibrary = ((
TObjString*)tokenObj)->GetString();
3690 if (collectingSingleLibraryNameTokens) {
3691 librariesWithQuotes.
Chop();
3692 librariesWithQuotes +=
"\" \"" + singleLibrary +
"\"";
3693 collectingSingleLibraryNameTokens =
kFALSE;
3695 librariesWithQuotes +=
" \"" + singleLibrary +
"\"";
3698 if (collectingSingleLibraryNameTokens) {
3699 librariesWithQuotes += singleLibrary +
" ";
3701 collectingSingleLibraryNameTokens =
kTRUE;
3702 librariesWithQuotes +=
" \"" + singleLibrary +
" ";
3708 linkLibraries.
Prepend(linkLibrariesNoQuotes);
3710 linkLibraries.
Prepend(librariesWithQuotes);
3717 cmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3719 cmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3722 cmd.
ReplaceAll(
"$SharedLib",
"\"$SharedLib\"");
3724 if (linkDepLibraries) {
3725 if (produceRootmap) {
3749 fakeMain +=
"_ACLiC_main";
3751 std::ofstream fakeMainFile( fakeMain, std::ios::out );
3752 fakeMainFile <<
"// File Automatically generated by the ROOT Script Compiler "
3754 fakeMainFile <<
"int main(char*argc,char**argvv) {};" << std::endl;
3755 fakeMainFile.close();
3766 exec +=
"_ACLiC_exec";
3767 testcmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3769 testcmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3773 testcmd.
ReplaceAll(
"$LinkedLibs",linkLibraries);
3781 R__FixLink(testcmd);
3787 if (verboseLevel>3 && withInfo) {
3788 ::Info(
"ACLiC",
"compiling the dictionary and script files");
3789 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", cmd.
Data());
3792 if (compilationResult) {
3793 if (compilationResult==139)
::Error(
"ACLiC",
"Compilation failed with a core dump!");
3795 if (produceRootmap) {
3799 result = !compilationResult;
3814 if (verboseLevel>3 && withInfo)
::Info(
"ACLiC",
"loading the shared library");
3816 result = LoadLibrary(library);
3821 if (verboseLevel>3 && withInfo) {
3822 ::Info(
"ACLiC",
"testing for missing symbols:");
3823 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", testcmd.
Data());
3831 if (verboseLevel<=5 && !internalDebug) {
3841 if (verboseLevel>6) {
3900 if (!
gEnv)
return "";
3986 if (!
gEnv)
return "_linkdef";
4235 char *fname =
Strip(filename);
4237 filenameCopy = filenameCopy.
Strip();
4241 filenameCopy = filenameCopy.
Strip();
4246 int parenNestCount = 1;
4247 bool inString =
false;
4248 Ssiz_t posArgBegin = posArgEnd - 1;
4249 for (; parenNestCount && posArgBegin >= 0; --posArgBegin) {
4252 if (posArgBegin > 0 && filenameCopy[posArgBegin] ==
'\\' &&
4253 (posArgBegin == 1 || filenameCopy[posArgBegin - 1] !=
'\\')) {
4258 switch (filenameCopy[posArgBegin]) {
4267 case '"': inString = !inString;
break;
4270 if (parenNestCount || inString) {
4271 Error(
"SplitAclicMode",
"Cannot parse argument in %s", filename);
4273 arguments = filenameCopy(posArgBegin + 1, posArgEnd - 1);
4274 fname[posArgBegin + 1] = 0;
4282 s2 = strstr(fname,
">>");
4283 if (!s2) s2 = strstr(fname,
"2>");
4284 if (!s2) s2 = strchr(fname,
'>');
4285 s3 = strchr(fname,
'<');
4286 if (s2 && s3) s2 = s2<s3 ? s2 : s3;
4287 if (s3 && !s2) s2 = s3;
4296 while (s2 && *s2 ==
' ') s2--;
4306 int len = strlen(fname);
4309 if (strchr(
"kfgOcsdv-", fname[len - 1])) {
4310 mode += fname[len - 1];
4316 Bool_t compile = len && fname[len - 1] ==
'+';
4317 Bool_t remove = compile && len > 1 && fname[len - 2] ==
'+';
4323 fname[strlen(fname)-2] = 0;
4326 fname[strlen(fname)-1] = 0;
4346 while ((lib = (
TNamed*)next())) {
The file contains utilities which are foundational and could be used across the core component of ROO...
R__EXTERN TApplication * gApplication
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
char * Form(const char *fmt,...)
char * Strip(const char *str, char c=' ')
Strip leading and trailing c (blanks by default) from a string.
void Printf(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
static Int_t gLibraryVersionIdx
TVirtualMutex * gSystemMutex
void AssignAndDelete(TString &target, char *tobedeleted)
static void R__WriteDependencyFile(const TString &build_loc, const TString &depfilename, const TString &filename, const TString &library, const TString &libname, const TString &extension, const char *version_var_prefix, const TString &includes, const TString &defines, const TString &incPath)
static bool R__MatchFilename(const char *left, const char *right)
Figure out if left and right points to the same object in the file system.
static void R__AddPath(TString &target, const TString &path)
static Int_t * gLibraryVersion
static Int_t gLibraryVersionMax
typedef void((*Func_t)())
Bool_t R_ISREG(Int_t mode)
Bool_t R_ISDIR(Int_t mode)
#define R__LOCKGUARD2(mutex)
#define R__WRITE_LOCKGUARD(mutex)
#define R__READ_LOCKGUARD(mutex)
virtual void StopIdleing()
Called when system stops idleing.
virtual void StartIdleing()
Called when system starts idleing.
virtual TObject * Remove(TObject *obj)=0
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual void Delete(Option_t *option="")=0
Delete this object.
const char * GetValue() const
The TEnv class reads config files, by default named .rootrc.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
THashList * GetTable() const
This class represents an Internet Protocol (IP) address.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const
Collectable string class.
Mother of all ROOT objects.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
@ kInvalidObject
if object ctor succeeded but object should not be used
@ kMustCleanup
if object destructor must call RecursiveRemove()
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Iterator of ordered collection.
TObject * Next()
Return next object in collection.
TProcessEventTimer(Long_t delay)
Create async event processor timer. Delay is in milliseconds.
Bool_t ProcessEvents()
Process events if timer did time out.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
Regular expression class.
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
virtual void Add(TObject *obj)
virtual EStatus Handle(std::exception &exc)=0
static Int_t * ReAllocInt(Int_t *vp, size_t size, size_t oldsize)
Reallocate (i.e.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
TString & Insert(Ssiz_t pos, const char *s)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
void Clear()
Clear string without changing its capacity.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Abstract base class defining a generic interface to the underlying Operating System.
virtual void NotifyApplicationCreated()
Hook to tell TSystem that the TApplication object has been created.
virtual const char * GetBuildNode() const
Return the build node name.
virtual int Umask(Int_t mask)
Set the process file creation mode mask.
virtual int SendBuf(int sock, const void *buffer, int length)
Send a buffer headed by a length indicator.
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual void Unload(const char *module)
Unload a shared library.
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
virtual Bool_t ConsistentWith(const char *path, void *dirptr=0)
Check consistency of this helper with the one required by 'path' or 'dirptr'.
virtual int AnnounceUdpService(int port, int backlog)
Announce UDP service.
TSeqCollection * fFileHandler
virtual Int_t GetGid(const char *group=0)
Returns the group's id. If group = 0, returns current user's group.
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
TString & GetLastErrorString()
Return the thread local storage for the custom last error message.
virtual void AddLinkedLibs(const char *linkedLib)
Add linkedLib to already set linked libs.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
virtual void ResetSignal(ESignals sig, Bool_t reset=kTRUE)
If reset is true reset the signal handler for the specified signal to the default handler,...
virtual TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks.
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
virtual const char * GetLinkedLibs() const
Return the list of library linked to this executable.
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
virtual void Syslog(ELogLevel level, const char *mess)
Send mess to syslog daemon.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
virtual void SetAclicMode(EAclicMode mode)
AclicMode indicates whether the library should be built in debug mode or optimized.
static void ResetErrno()
Static function resetting system error number.
virtual UInt_t LoadAllLibraries()
Load all libraries known to ROOT via the rootmap system.
virtual void * GetDirPtr() const
virtual void SetObjExt(const char *objExt)
Set object files extension, should be either .o, .obj, etc.
virtual void SetLinkdefSuffix(const char *suffix)
The 'suffix' will be appended to the name of a script loaded by ACLiC and used to locate any eventual...
TSeqCollection * fHelpers
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * GetBuildDir() const
Return the path of the build directory.
virtual void Openlog(const char *name, Int_t options, ELogFacility facility)
Open connection to system log daemon.
static Int_t GetErrno()
Static function returning system error number.
virtual void AddIncludePath(const char *includePath)
Add includePath to the already set include path.
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual Int_t GetEffectiveGid()
Returns the effective group id.
virtual ~TSystem()
Delete the OS interface.
virtual void SetDisplay()
Set DISPLAY environment variable based on utmp entry. Only for UNIX.
virtual std::string GetHomeDirectory(const char *userName=0) const
Return the user's home directory.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void SetFlagsOpt(const char *)
FlagsOpt should contain the options to pass to the C++ compiler in order to compile the library in op...
void RemoveOnExit(TObject *obj)
Objects that should be deleted on exit of the OS interface.
TSeqCollection * fStdExceptionHandler
virtual char * GetServiceByPort(int port)
Get name of internet service.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual int GetPid()
Get process id.
virtual int RecvBuf(int sock, void *buffer, int length)
Receive a buffer headed by a length indicator.
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual Long_t NextTimeOut(Bool_t mode)
Time when next timer of mode (synchronous=kTRUE or asynchronous=kFALSE) will time-out (in ms).
virtual int SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual TStdExceptionHandler * RemoveStdExceptionHandler(TStdExceptionHandler *eh)
Remove an exception handler from list of exception handlers.
virtual const char * GetIncludePath()
Get the list of include path.
virtual int AcceptConnection(int sock)
Accept a connection.
virtual Int_t GetAclicProperties() const
Return the ACLiC properties field.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form:
TFdSet * fWritemask
Files that should be checked for read events.
TFdSet * fSignals
Files with writes waiting.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual UserGroup_t * GetGroupInfo(Int_t gid)
Returns all group info in the UserGroup_t structure.
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual const char * ExpandFileName(const char *fname)
Expand a pathname getting rid of special shell characters like ~.
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual int GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
virtual EAclicMode GetAclicMode() const
AclicMode indicates whether the library should be built in debug mode or optimized.
virtual const char * GetLinkedLibraries()
Get list of shared libraries loaded at the start of the executable.
virtual void SetIncludePath(const char *includePath)
IncludePath should contain the list of compiler flags to indicate where to find user defined header f...
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void ListSymbols(const char *module, const char *re="")
List symbols in a shared library.
virtual void DoBeep(Int_t=-1, Int_t=-1) const
virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
virtual Bool_t IsFileInIncludePath(const char *name, char **fullpath=0)
Return true if 'name' is a file that can be found in the ROOT include path or the current directory.
virtual void ListLibraries(const char *regexp="")
List all loaded shared libraries.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual void SetMakeSharedLib(const char *directives)
Directives should contain the description on how to compile and link a shared lib.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual void InnerLoop()
Inner event loop.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to another host.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.
virtual void Run()
System event loop.
virtual int GetSockOpt(int sock, int kind, int *val)
Get socket option.
virtual void ExitLoop()
Exit from event loop.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1)
Announce TCP/IP service.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
virtual int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
virtual Bool_t Init()
Initialize the OS interface.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
TFdSet * fWriteready
Files with reads waiting.
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual const char * GetDynamicPath()
Return the dynamic path (used to find shared libraries).
TSeqCollection * fSignalHandler
virtual const char * GetMakeExe() const
Return the command line use to make an executable.
virtual const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE)
Find a dynamic library using the system search paths.
virtual void SetFlagsDebug(const char *)
FlagsDebug should contain the options to pass to the C++ compiler in order to compile the library in ...
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
virtual void SetMakeExe(const char *directives)
Directives has the same syntax as the argument of SetMakeSharedLib but is used to create an executabl...
TFdSet * fReadready
Files that should be checked for write events.
TSeqCollection * fCompiled
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
TString fBuildCompilerVersion
virtual const char * GetFlagsDebug() const
Return the debug flags.
virtual const char * HostName()
Return the system's host name.
TSystem * FindHelper(const char *path, void *dirptr=0)
Create helper TSystem to handle file and directory operations that might be special for remote file a...
Int_t fNfd
Signals that were trapped.
virtual void Unsetenv(const char *name)
Unset environment variable.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual void AddDynamicPath(const char *pathname)
Add a new directory to the dynamic path.
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
TSeqCollection * fOnExitList
virtual const char * GetObjExt() const
Get the object file extension.
virtual int AnnounceUnixService(int port, int backlog)
Announce unix domain service.
virtual Int_t GetEffectiveUid()
Returns the effective user id.
virtual const char * GetLinkdefSuffix() const
Return the linkdef suffix chosen by the user for ACLiC.
virtual void SetDynamicPath(const char *pathname)
Set the dynamic path to a new value.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename".
virtual const char * WorkingDirectory()
Return working directory.
virtual void AddStdExceptionHandler(TStdExceptionHandler *eh)
Add an exception handler to list of system exception handlers.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
virtual int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
virtual Int_t SetFPEMask(Int_t mask=kDefaultMask)
Set which conditions trigger a floating point exception.
virtual const char * GetBuildCompiler() const
Return the build compiler.
virtual void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket connection.
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
void SetErrorStr(const char *errstr)
Set the system error string.
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual void SetSoExt(const char *soExt)
Set shared library extension, should be either .so, .sl, .a, .dll, etc.
virtual void Closelog()
Close connection to system log daemon.
virtual Int_t GetUid(const char *user=0)
Returns the user's id. If user = 0, returns current user's id.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
virtual const char * GetBuildArch() const
Return the build architecture.
virtual int Link(const char *from, const char *to)
Create a link from file1 to file2.
virtual void SigAlarmInterruptsSyscalls(Bool_t)
virtual void SetLinkedLibs(const char *linkedLibs)
LinkedLibs should contain the library directory and list of libraries needed to recreate the current ...
virtual std::string GetWorkingDirectory() const
Return working directory.
virtual void SetBuildDir(const char *build_dir, Bool_t isflat=kFALSE)
Set the location where ACLiC will create libraries and use as a scratch area.
virtual void Abort(int code=0)
Abort the application.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual const char * GetSoExt() const
Get the shared library extension.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual const char * GetError()
Return system error string.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
virtual Int_t GetFPEMask()
Return the bitmap of conditions that trigger a floating point exception.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual void StackTrace()
Print a stack trace.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
virtual const char * GetFlagsOpt() const
Return the optimization flags.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
Basic time type with millisecond precision.
Handles synchronous and a-synchronous timer events.
virtual void TurnOn()
Add the timer to the system timer list.
void Reset()
Reset the timer.
Bool_t IsInterruptingSyscalls() const
This class represents a WWW compatible URL.
const char * GetUser() const
const char * GetHost() const
const char * GetProtocol() const
TVersionCheck(int versionCode)
Register version of plugin library.
This class implements a mutex interface.
std::string GetCurrentDir()
std::string MakePathRelative(const std::string &path, const std::string &base, bool isBuildingROOT=false)
R__EXTERN TVirtualRWMutex * gCoreMutex
static constexpr double s
constexpr Double_t E()
Base of natural log: