MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / doctorModuleExtension

Method doctorModuleExtension

src/common/os/darwin/mod_loader.cpp:75–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75bool ModuleLoader::doctorModuleExtension(Firebird::PathName& name, int& step)
76{
77 if (name.isEmpty())
78 return false;
79
80 switch (step++)
81 {
82 case 0: // Step 0: append missing extension
83 {
84 Firebird::PathName::size_type pos = name.rfind(".dylib");
85 if (pos != name.length() - 6)
86 {
87 name += ".dylib";
88 return true;
89 }
90 step++; // instead of break
91 }
92 case 1: // Step 1: insert missing prefix
93 {
94 Firebird::PathName::size_type pos = name.rfind('/');
95 pos = (pos == Firebird::PathName::npos) ? 0 : pos + 1;
96 if (name.find("lib", pos) != pos)
97 {
98 name.insert(pos, "lib");
99 return true;
100 }
101 }
102 }
103 return false;
104}
105
106#ifdef DEV_BUILD
107#define FB_RTLD_MODE RTLD_NOW

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.45
rfindMethod · 0.45
lengthMethod · 0.45
findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected