System.cpp File Reference
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <typeinfo>
#include "GaudiKernel/System.h"
#include <errno.h>
#include <string.h>
#include "sys/times.h"
#include "unistd.h"
#include "libgen.h"
#include <cstdio>
#include <cxxabi.h>
Go to the source code of this file.
Define Documentation
| #define __attribute__ |
( |
x |
|
) |
|
| #define SYSTEM_SYSTEM_CPP |
Function Documentation
Definition at line 300 of file System.cpp.
00300 {
00301 std::string result;
00302 int j = 0, k, i;
00303 if ( 't' == *name ) {
00304 goto Template;
00305 }
00306 for ( i = ::strtol(name, &name, 10); i > 0; i = ::strtol(name, &name, 10) ) {
00307 if ( j++ != 0 ) result.append("::",2);
00308 result.append(name, i);
00309 if ( *(name+=i) == 't' ) {
00310 result.append("::",2);
00311 Template:
00312 result.append(name, (i=::strtol(++name, &name, 10)));
00313 result.append("<");
00314 for (k = 0, i=::strtol(name+i, &name, 10); k < i; k++ ) {
00315 result += __typeName( ++name );
00316 if ( k+1 < i ) result += ",";
00317 }
00318 result.append(">");
00319 }
00320 }
00321 return result;
00322 }
Definition at line 324 of file System.cpp.
00324 {
00325 if ( *name == 'Q' ) {
00326 if ( *(++name) == '_' )
00327 ::strtol(++name, &name, 10);
00328 return __className(++name);
00329 }
00330 else if ( 't' == *name ) {
00331 return __className(name);
00332 }
00333 else {
00334 std::string result;
00335 char* ptr;
00336 long i = ::strtol(name, &ptr, 10);
00337 if ( i <= 0 ) {
00338 name = ptr;
00339 while ( *name != 0 && *name != 'Z' ) {
00340 if ( *name == 'U' ) {
00341 result += "unsigned ";
00342 name++;
00343 }
00344 switch( *name++ ) {
00345 case 'c': result += "char"; break;
00346 case 's': result += "short"; break;
00347 case 'i': result += "int"; break;
00348 case 'l': result += "long"; break;
00349 case 'f': result += "float"; break;
00350 case 'd': result += "double"; break;
00351 default: result += *(name-1);
00352 }
00353 }
00354 return result;
00355 }
00356 else {
00357 return __className(name);
00358 }
00359 }
00360 }
Definition at line 75 of file System.cpp.
00075 {
00076 #ifdef _WIN32
00077 void* mh = ::LoadLibrary( name.length() == 0 ? System::exeName().c_str() : name.c_str());
00078 *handle = mh;
00079 #else
00080 const char* path = name.c_str();
00081 #if defined(linux) || defined(__APPLE__)
00082 void *mh = ::dlopen(name.length() == 0 ? 0 : path, RTLD_LAZY | RTLD_GLOBAL);
00083 *handle = mh;
00084 #elif __hpux
00085 shl_t mh = ::shl_load(name.length() == 0 ? 0 : path, BIND_IMMEDIATE | BIND_VERBOSE, 0);
00086 HMODULE* mod = new HMODULE;
00087 if ( 0 != mh ) {
00088 if ( 0 != ::shl_gethandle_r(mh, &mod->dsc) ) {
00089 std::cout << "System::loadDynamicLib>" << ::strerror(getLastError()) << std::endl;
00090 }
00091 else {
00092 typedef void* (*___all)();
00093 ___all _alloc = (___all)malloc;
00094 mod->numSym = ::shl_getsymbols(mod->dsc.handle, TYPE_PROCEDURE, EXPORT_SYMBOLS, malloc, &mod->sym);
00095 *handle = mod;
00096 }
00097 }
00098 #endif
00099 #endif
00100 if ( 0 == *handle ) {
00101 return System::getLastError();
00102 }
00103 return 1;
00104 }
Definition at line 106 of file System.cpp.
00106 {
00107
00108 std::string dllName = name;
00109 long len = strlen(SHLIB_SUFFIX);
00110
00111
00112
00113 if ((dllName.length() != 0) &&
00114 ::strncasecmp(dllName.data()+dllName.length()-len, SHLIB_SUFFIX, len) != 0) {
00115 dllName += SHLIB_SUFFIX;
00116 }
00117
00118
00119 return doLoad(dllName, handle);
00120 }
Variable Documentation