42 #include "qplatformdefs.h" 47 #include <private/qfilesystementry_p.h> 52 # include <private/qcore_mac_p.h> 55 #if defined(QT_AOUT_UNDERSCORE) 59 #if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL) 60 #define QT_NO_DYNAMIC_LIBRARY 65 #if !defined(QT_HPUX_LD) && !defined(QT_NO_DYNAMIC_LIBRARY) 73 #if defined(QT_NO_DYNAMIC_LIBRARY) 74 const char *err =
"This platform does not support dynamic libraries.";
75 #elif !defined(QT_HPUX_LD) 76 const char *err = dlerror();
78 const char *err = strerror(
errno);
86 #if !defined(QT_NO_DYNAMIC_LIBRARY) 89 #if defined(Q_OS_SYMBIAN) 110 #if !defined(Q_OS_SYMBIAN) 113 #if defined(Q_OS_HPUX) 138 #elif defined(Q_OS_SYMBIAN) 160 #if defined(QT_HPUX_LD) 161 dlFlags = DYNAMIC_PATH | BIND_NONFATAL;
163 dlFlags |= BIND_IMMEDIATE;
165 dlFlags |= BIND_DEFERRED;
168 if (
loadHints & QLibrary::ResolveAllSymbolsHint) {
171 dlFlags |= RTLD_LAZY;
174 dlFlags |= RTLD_GLOBAL;
176 #if !defined(Q_OS_CYGWIN) 178 #if defined(Q_OS_MAC) 181 dlFlags |= RTLD_LOCAL;
184 #if defined(Q_OS_AIX) // Not sure if any other platform actually support this thing. 186 dlFlags |= RTLD_MEMBER;
208 for(
int prefix = 0; retry && !
pHnd && prefix < prefixes.
size(); prefix++) {
214 if (
loadHints & QLibrary::LoadArchiveMemberHint) {
218 lparen = attempt.
count();
219 attempt = path + prefixes.
at(prefix) + attempt.
insert(lparen, suffixes.
at(
suffix));
221 attempt = path + prefixes.
at(prefix) + name + suffixes.
at(
suffix);
223 #if defined(QT_HPUX_LD) 229 #if defined(Q_OS_SYMBIAN) 248 QCFType<CFURLRef> bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast<const UInt8*>(utf8Bundle.
data()), utf8Bundle.
length(),
true);
252 char executableFile[FILENAME_MAX];
253 CFURLGetFileSystemRepresentation(url,
true, reinterpret_cast<UInt8*>(executableFile), FILENAME_MAX);
259 #endif // QT_NO_DYNAMIC_LIBRARY 272 #if !defined(QT_NO_DYNAMIC_LIBRARY) 273 # if defined(QT_HPUX_LD) 274 if (shl_unload((shl_t)
pHnd)) {
289 return dlsym(handle, symbol);
295 #if defined(QT_AOUT_UNDERSCORE) 297 char* undrscr_symbol =
new char[strlen(symbol)+2];
298 undrscr_symbol[0] =
'_';
299 strcpy(undrscr_symbol+1, symbol);
300 void* address = dlsym(pHnd, undrscr_symbol);
301 delete [] undrscr_symbol;
302 #elif defined(QT_HPUX_LD) 304 if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
306 #elif defined (QT_NO_DYNAMIC_LIBRARY) 309 void* address = dlsym(pHnd, symbol);
322 #endif // QT_NO_LIBRARY static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
char * data()
Returns a pointer to the data stored in the byte array.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
The QByteArray class provides an array of bytes.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
Q_CORE_EXPORT void * qt_mac_resolve_sys(void *handle, const char *symbol)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
enum QLibraryPrivate::@42 pluginState
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
void * resolve_sys(const char *)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int length() const
Same as size().
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
void clear()
Clears the contents of the string and makes it empty.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
int size() const
Returns the number of items in the list.
QString completeBaseName() const
static QString qdlerror()
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
static QByteArray encodeName(const QString &fileName)
By default, this function converts fileName to the local 8-bit encoding determined by the user's loca...
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QLibrary::LoadHints loadHints
QString qualifiedFileName
QString & insert(int i, QChar c)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.