#include <_ibpp.h>
Definition at line 393 of file _ibpp.h.
| ibpp_internals::GDS::GDS | ( | ) | [inline] |
Definition at line 463 of file _ibpp.h.
References mGDSVersion, and mReady.
00464 { 00465 mReady = false; 00466 mGDSVersion = 0; 00467 #ifdef IBPP_WINDOWS 00468 mHandle = 0; 00469 #endif 00470 };
| GDS * GDS::Call | ( | ) |
Definition at line 99 of file _ibpp.cpp.
References _, mGDSVersion, mReady, and NULL.
Referenced by ibpp_internals::ServiceImpl::AddUser(), ibpp_internals::StatementImpl::AffectedRows(), IBPP::ArrayFactory(), IBPP::BlobFactory(), ibpp_internals::EventsImpl::Cancel(), ibpp_internals::BlobImpl::Cancel(), ibpp_internals::StatementImpl::Close(), ibpp_internals::BlobImpl::Close(), ibpp_internals::TransactionImpl::Commit(), ibpp_internals::TransactionImpl::CommitRetain(), ibpp_internals::ServiceImpl::Connect(), ibpp_internals::DatabaseImpl::Connect(), ibpp_internals::DatabaseImpl::Counts(), ibpp_internals::DatabaseImpl::Create(), ibpp_internals::BlobImpl::Create(), ibpp_internals::StatementImpl::CursorExecute(), ibpp_internals::StatementImpl::CursorFree(), IBPP::DatabaseFactory(), ibpp_internals::ArrayImpl::Describe(), ibpp_internals::ServiceImpl::Disconnect(), ibpp_internals::DatabaseImpl::Disconnect(), ibpp_internals::DatabaseImpl::Drop(), ibpp_internals::IBS::ErrorMessage(), IBPP::EventsFactory(), ibpp_internals::StatementImpl::Execute(), ibpp_internals::StatementImpl::ExecuteImmediate(), ibpp_internals::StatementImpl::Fetch(), ibpp_internals::RB::FindToken(), IBPP::GDSVersion(), ibpp_internals::EventBufferIterator< It >::get_count(), ibpp_internals::RB::GetBool(), ibpp_internals::RB::GetCountValue(), ibpp_internals::RB::GetString(), ibpp_internals::ServiceImpl::GetUser(), ibpp_internals::ServiceImpl::GetUsers(), ibpp_internals::RB::GetValue(), ibpp_internals::ServiceImpl::GetVersion(), ibpp_internals::DatabaseImpl::Info(), ibpp_internals::BlobImpl::Info(), ibpp_internals::DPB::Insert(), ibpp_internals::SPB::InsertQuad(), ibpp_internals::SPB::InsertString(), ibpp_internals::BlobImpl::Load(), ibpp_internals::ServiceImpl::ModifyUser(), ibpp_internals::BlobImpl::Open(), ibpp_internals::StatementImpl::Plan(), ibpp_internals::StatementImpl::Prepare(), ibpp_internals::EventsImpl::Queue(), ibpp_internals::BlobImpl::Read(), ibpp_internals::ArrayImpl::ReadTo(), ibpp_internals::ServiceImpl::RemoveUser(), ibpp_internals::ServiceImpl::Repair(), ibpp_internals::ServiceImpl::Restart(), ibpp_internals::TransactionImpl::Rollback(), ibpp_internals::TransactionImpl::RollbackRetain(), ibpp_internals::BlobImpl::Save(), IBPP::ServiceFactory(), ibpp_internals::ServiceImpl::SetPageBuffers(), ibpp_internals::ServiceImpl::SetReadOnly(), ibpp_internals::ServiceImpl::SetReserveSpace(), ibpp_internals::ServiceImpl::SetSweepInterval(), ibpp_internals::ServiceImpl::SetSyncWrite(), ibpp_internals::ServiceImpl::Shutdown(), ibpp_internals::IBS::SqlCode(), ibpp_internals::TransactionImpl::Start(), ibpp_internals::ServiceImpl::StartBackup(), ibpp_internals::ServiceImpl::StartRestore(), IBPP::StatementFactory(), ibpp_internals::DatabaseImpl::Statistics(), ibpp_internals::ServiceImpl::Sweep(), IBPP::TransactionFactory(), ibpp_internals::ServiceImpl::Wait(), ibpp_internals::ServiceImpl::WaitMsg(), ibpp_internals::BlobImpl::Write(), and ibpp_internals::ArrayImpl::WriteFrom().
00100 { 00101 // Let's load the CLIENT library, if it is not already loaded. 00102 // The load is guaranteed to be done only once per application. 00103 00104 if (! mReady) 00105 { 00106 #ifdef IBPP_WINDOWS 00107 00108 // Let's load the FBCLIENT.DLL or GDS32.DLL, we will never release it. 00109 // Windows will do that for us when the executable will terminate. 00110 00111 char fbdll[MAX_PATH]; 00112 HKEY hkey_instances; 00113 00114 // Try to load FBCLIENT.DLL from each of the additional optional paths 00115 // that may have been specified through ClientLibSearchPaths(). 00116 // We also want to actually update the environment PATH so that it references 00117 // the specific path from where we attempt the load. This is useful because 00118 // it directs the system to attempt finding dependencies (like the C/C++ 00119 // runtime libraries) from the same location where FBCLIENT is found. 00120 00121 mHandle = 0; 00122 00123 std::string SysPath(getenv("PATH")); 00124 std::string::size_type pos = 0; 00125 while (pos < mSearchPaths.size()) 00126 { 00127 std::string::size_type newpos = mSearchPaths.find(';', pos); 00128 00129 std::string path; 00130 if (newpos == std::string::npos) path = mSearchPaths.substr(pos); 00131 else path = mSearchPaths.substr(pos, newpos-pos); 00132 00133 if (path.size() >= 1) 00134 { 00135 if (path[path.size()-1] != '\\') path += '\\'; 00136 00137 AppPath.assign("PATH="); 00138 AppPath.append(path).append(";").append(SysPath); 00139 putenv(AppPath.c_str()); 00140 00141 path.append("fbclient.dll"); 00142 mHandle = LoadLibrary(path.c_str()); 00143 if (mHandle != 0 || newpos == std::string::npos) break; 00144 } 00145 pos = newpos + 1; 00146 } 00147 00148 if (mHandle == 0) 00149 { 00150 // Try to load FBCLIENT.DLL from the current application location. This 00151 // is a usefull step for applications using the embedded version of FB 00152 // or a local copy (for whatever reasons) of the dll. 00153 00154 if (! AppPath.empty()) 00155 { 00156 // Restores the original system path 00157 AppPath.assign("PATH="); 00158 AppPath.append(SysPath); 00159 putenv(AppPath.c_str()); 00160 } 00161 00162 int len = GetModuleFileName(NULL, fbdll, sizeof(fbdll)); 00163 if (len != 0) 00164 { 00165 // Get to the last '\' (this one precedes the filename part). 00166 // There is always one after a success call to GetModuleFileName(). 00167 char* p = fbdll + len; 00168 do {--p;} while (*p != '\\'); 00169 *p = '\0'; 00170 lstrcat(fbdll, "\\fbembed.dll");// Local copy could be named fbembed.dll 00171 mHandle = LoadLibrary(fbdll); 00172 if (mHandle == 0) 00173 { 00174 *p = '\0'; 00175 lstrcat(fbdll, "\\fbclient.dll"); // Or possibly renamed fbclient.dll 00176 mHandle = LoadLibrary(fbdll); 00177 } 00178 } 00179 } 00180 00181 if (mHandle == 0) 00182 { 00183 // Try to locate FBCLIENT.DLL through the optional FB registry key. 00184 00185 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_KEY_ROOT_INSTANCES, 0, 00186 KEY_READ, &hkey_instances) == ERROR_SUCCESS) 00187 { 00188 DWORD keytype; 00189 DWORD buflen = sizeof(fbdll); 00190 if (RegQueryValueEx(hkey_instances, FB_DEFAULT_INSTANCE, 0, 00191 &keytype, reinterpret_cast<UCHAR*>(fbdll), 00192 &buflen) == ERROR_SUCCESS && keytype == REG_SZ) 00193 { 00194 lstrcat(fbdll, "bin\\fbclient.dll"); 00195 mHandle = LoadLibrary(fbdll); 00196 } 00197 RegCloseKey(hkey_instances); 00198 } 00199 } 00200 00201 if (mHandle == 0) 00202 { 00203 // Let's try from the PATH and System directories 00204 mHandle = LoadLibrary("fbclient.dll"); 00205 if (mHandle == 0) 00206 { 00207 // Not found. Last try : attemps loading gds32.dll from PATH and 00208 // System directories 00209 mHandle = LoadLibrary("gds32.dll"); 00210 if (mHandle == 0) 00211 throw LogicExceptionImpl("GDS::Call()", 00212 _("Can't find or load FBCLIENT.DLL or GDS32.DLL")); 00213 } 00214 } 00215 #endif 00216 00217 mGDSVersion = 60; 00218 00219 // Get the entry points that we need 00220 00221 #ifdef IBPP_WINDOWS 00222 #define IB_ENTRYPOINT(X) \ 00223 if ((m_##X = (proto_##X*)GetProcAddress(mHandle, "isc_"#X)) == 0) \ 00224 throw LogicExceptionImpl("GDS:gds()", _("Entry-point isc_"#X" not found")) 00225 #endif 00226 #ifdef IBPP_UNIX 00227 /* TODO : perform a late-bind on unix --- not so important, well I think (OM) */ 00228 #define IB_ENTRYPOINT(X) m_##X = (proto_##X*)isc_##X 00229 #endif 00230 00231 IB_ENTRYPOINT(create_database); 00232 IB_ENTRYPOINT(attach_database); 00233 IB_ENTRYPOINT(detach_database); 00234 IB_ENTRYPOINT(drop_database); 00235 IB_ENTRYPOINT(database_info); 00236 IB_ENTRYPOINT(open_blob2); 00237 IB_ENTRYPOINT(create_blob2); 00238 IB_ENTRYPOINT(close_blob); 00239 IB_ENTRYPOINT(cancel_blob); 00240 IB_ENTRYPOINT(get_segment); 00241 IB_ENTRYPOINT(put_segment); 00242 IB_ENTRYPOINT(blob_info); 00243 IB_ENTRYPOINT(array_lookup_bounds); 00244 IB_ENTRYPOINT(array_get_slice); 00245 IB_ENTRYPOINT(array_put_slice); 00246 IB_ENTRYPOINT(vax_integer); 00247 IB_ENTRYPOINT(sqlcode); 00248 IB_ENTRYPOINT(sql_interprete); 00249 IB_ENTRYPOINT(interprete); 00250 IB_ENTRYPOINT(que_events); 00251 IB_ENTRYPOINT(cancel_events); 00252 IB_ENTRYPOINT(start_multiple); 00253 IB_ENTRYPOINT(commit_transaction); 00254 IB_ENTRYPOINT(commit_retaining); 00255 IB_ENTRYPOINT(rollback_transaction); 00256 IB_ENTRYPOINT(rollback_retaining); 00257 IB_ENTRYPOINT(dsql_execute_immediate); 00258 IB_ENTRYPOINT(dsql_allocate_statement); 00259 IB_ENTRYPOINT(dsql_describe); 00260 IB_ENTRYPOINT(dsql_describe_bind); 00261 IB_ENTRYPOINT(dsql_prepare); 00262 IB_ENTRYPOINT(dsql_execute); 00263 IB_ENTRYPOINT(dsql_execute2); 00264 IB_ENTRYPOINT(dsql_fetch); 00265 IB_ENTRYPOINT(dsql_free_statement); 00266 IB_ENTRYPOINT(dsql_set_cursor_name); 00267 IB_ENTRYPOINT(dsql_sql_info); 00268 00269 IB_ENTRYPOINT(service_attach); 00270 IB_ENTRYPOINT(service_detach); 00271 IB_ENTRYPOINT(service_start); 00272 IB_ENTRYPOINT(service_query); 00273 00274 mReady = true; 00275 } 00276 00277 return this; 00278 }
Definition at line 415 of file _ibpp.h.
Referenced by ibpp_internals::BlobImpl::Close(), ibpp_internals::BlobImpl::Load(), and ibpp_internals::BlobImpl::Save().
Definition at line 432 of file _ibpp.h.
Referenced by ibpp_internals::TransactionImpl::CommitRetain().
Definition at line 414 of file _ibpp.h.
Referenced by ibpp_internals::BlobImpl::Create(), and ibpp_internals::BlobImpl::Save().
Definition at line 411 of file _ibpp.h.
Referenced by ibpp_internals::DatabaseImpl::Connect(), ibpp_internals::DatabaseImpl::Counts(), ibpp_internals::DatabaseImpl::Info(), and ibpp_internals::DatabaseImpl::Statistics().
Definition at line 409 of file _ibpp.h.
Referenced by ibpp_internals::DatabaseImpl::Connect(), and ibpp_internals::DatabaseImpl::Disconnect().
Definition at line 439 of file _ibpp.h.
Referenced by ibpp_internals::StatementImpl::CursorExecute(), and ibpp_internals::StatementImpl::Execute().
Definition at line 412 of file _ibpp.h.
Referenced by ibpp_internals::DatabaseImpl::Create(), and ibpp_internals::StatementImpl::ExecuteImmediate().
Definition at line 442 of file _ibpp.h.
Referenced by ibpp_internals::StatementImpl::Close(), and ibpp_internals::StatementImpl::CursorFree().
Definition at line 443 of file _ibpp.h.
Referenced by ibpp_internals::StatementImpl::CursorExecute().
Definition at line 444 of file _ibpp.h.
Referenced by ibpp_internals::StatementImpl::AffectedRows(), ibpp_internals::StatementImpl::Plan(), and ibpp_internals::StatementImpl::Prepare().
Definition at line 417 of file _ibpp.h.
Referenced by ibpp_internals::BlobImpl::Load(), and ibpp_internals::BlobImpl::Read().
Definition at line 413 of file _ibpp.h.
Referenced by ibpp_internals::BlobImpl::Load(), and ibpp_internals::BlobImpl::Open().
Definition at line 418 of file _ibpp.h.
Referenced by ibpp_internals::BlobImpl::Save(), and ibpp_internals::BlobImpl::Write().
Definition at line 434 of file _ibpp.h.
Referenced by ibpp_internals::TransactionImpl::RollbackRetain().
Definition at line 454 of file _ibpp.h.
Referenced by ibpp_internals::ServiceImpl::GetUser(), ibpp_internals::ServiceImpl::GetUsers(), ibpp_internals::ServiceImpl::GetVersion(), ibpp_internals::ServiceImpl::Wait(), and ibpp_internals::ServiceImpl::WaitMsg().
Definition at line 453 of file _ibpp.h.
Referenced by ibpp_internals::ServiceImpl::AddUser(), ibpp_internals::ServiceImpl::GetUser(), ibpp_internals::ServiceImpl::GetUsers(), ibpp_internals::ServiceImpl::ModifyUser(), ibpp_internals::ServiceImpl::RemoveUser(), ibpp_internals::ServiceImpl::Repair(), ibpp_internals::ServiceImpl::Restart(), ibpp_internals::ServiceImpl::SetPageBuffers(), ibpp_internals::ServiceImpl::SetReadOnly(), ibpp_internals::ServiceImpl::SetReserveSpace(), ibpp_internals::ServiceImpl::SetSweepInterval(), ibpp_internals::ServiceImpl::SetSyncWrite(), ibpp_internals::ServiceImpl::Shutdown(), ibpp_internals::ServiceImpl::StartBackup(), ibpp_internals::ServiceImpl::StartRestore(), and ibpp_internals::ServiceImpl::Sweep().
Definition at line 425 of file _ibpp.h.
Referenced by ibpp_internals::IBS::ErrorMessage(), and ibpp_internals::IBS::SqlCode().
Definition at line 424 of file _ibpp.h.
Referenced by ibpp_internals::RB::FindToken(), ibpp_internals::EventBufferIterator< It >::get_count(), ibpp_internals::RB::GetBool(), ibpp_internals::RB::GetCountValue(), ibpp_internals::RB::GetString(), ibpp_internals::ServiceImpl::GetUser(), ibpp_internals::ServiceImpl::GetUsers(), ibpp_internals::RB::GetValue(), ibpp_internals::DPB::Insert(), ibpp_internals::SPB::InsertQuad(), and ibpp_internals::SPB::InsertString().
Definition at line 397 of file _ibpp.h.
Referenced by ibpp_internals::ServiceImpl::AddUser(), Call(), ibpp_internals::ServiceImpl::Connect(), ibpp_internals::DatabaseImpl::Connect(), ibpp_internals::ServiceImpl::Disconnect(), GDS(), IBPP::GDSVersion(), ibpp_internals::ServiceImpl::GetUser(), ibpp_internals::ServiceImpl::GetUsers(), ibpp_internals::ServiceImpl::GetVersion(), ibpp_internals::ServiceImpl::ModifyUser(), ibpp_internals::ServiceImpl::RemoveUser(), ibpp_internals::ServiceImpl::Repair(), ibpp_internals::ServiceImpl::Restart(), ibpp_internals::ServiceImpl::SetPageBuffers(), ibpp_internals::ServiceImpl::SetReadOnly(), ibpp_internals::ServiceImpl::SetReserveSpace(), ibpp_internals::ServiceImpl::SetSweepInterval(), ibpp_internals::ServiceImpl::SetSyncWrite(), ibpp_internals::ServiceImpl::Shutdown(), ibpp_internals::ServiceImpl::StartBackup(), ibpp_internals::ServiceImpl::StartRestore(), ibpp_internals::ServiceImpl::Sweep(), ibpp_internals::ServiceImpl::Wait(), and ibpp_internals::ServiceImpl::WaitMsg().
1.5.3