NCBI C++ ToolKit
ncbidll.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CORELIB___NCBIDLL__HPP
2 #define CORELIB___NCBIDLL__HPP
3 
4 /* $Id: ncbidll.hpp 83621 2018-09-05 17:25:51Z ivanov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Denis Vakatov, Vladimir Ivanov, Anatoliy Kuznetsov
30  *
31  *
32  */
33 
34 /// @file ncbidll.hpp
35 /// Define class Dll and for Portable DLL handling.
36 
37 
38 #include <corelib/ncbistd.hpp>
39 #include <corelib/ncbicfg.h>
40 #include <corelib/ncbifile.hpp>
41 
42 
44 
45 /** @addtogroup Dll
46  *
47  * @{
48  */
49 
50 
51 // Forward declaration of struct containing OS-specific DLL handle.
52 struct SDllHandle;
53 
54 
55 #ifndef NCBI_PLUGIN_SUFFIX
56 # ifdef NCBI_OS_MSWIN
57 # define NCBI_PLUGIN_PREFIX ""
58 # define NCBI_PLUGIN_MIN_SUFFIX ".dll"
59 # elif defined(NCBI_OS_DARWIN) && !defined(NCBI_USE_BUNDLES)
60 # define NCBI_PLUGIN_PREFIX "lib"
61 # define NCBI_PLUGIN_MIN_SUFFIX ".dylib"
62 # else
63 # define NCBI_PLUGIN_PREFIX "lib"
64 # define NCBI_PLUGIN_MIN_SUFFIX ".so"
65 # endif
66 # if defined(NCBI_DLL_BUILD) || defined(NCBI_OS_MSWIN)
67 # define NCBI_PLUGIN_SUFFIX NCBI_PLUGIN_MIN_SUFFIX
68 # else
69 # define NCBI_PLUGIN_SUFFIX "-dll" NCBI_PLUGIN_MIN_SUFFIX
70 # endif
71 #endif
72 
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CDll --
77 ///
78 /// Define class for portable Dll handling.
79 ///
80 /// The DLL name is considered the basename if it does not contain embedded
81 /// '/', '\', or ':' symbols. Also, in this case, if the DLL name does not
82 /// start with NCBI_PLUGIN_PREFIX and contain NCBI_PLUGIN_MIN_SUFFIX (and if
83 /// eExactName flag not passed to the constructor), then it will be
84 /// automatically transformed according to the following rule:
85 /// <name> ---> NCBI_PLUGIN_PREFIX + <name> + NCBI_PLUGIN_SUFFIX
86 ///
87 /// If the DLL is specified by its basename, then it will be searched
88 /// (after the transformation described above) in the following locations:
89 ///
90 /// UNIX:
91 /// 1) the directories that are listed in the LD_LIBRARY_PATH environment
92 /// variable (analyzed once at the process startup);
93 /// 2) the directory from which the application loaded;
94 /// 3) hard-coded (e.g. with `ldconfig' on Linux) paths.
95 ///
96 /// MS Windows:
97 /// 1) the directory from which the application is loaded;
98 /// 2) the current directory;
99 /// 3) the Windows system directory;
100 /// 4) the Windows directory;
101 /// 5) the directories that are listed in the PATH environment variable.
102 ///
103 /// NOTE: All methods of this class except the destructor throw exception
104 /// CCoreException::eDll on error.
105 
106 class CDll
107 {
108 public:
109  /// General flags.
110  ///
111  /// Default flag in each group have priority above non-default,
112  /// if they are used together.
113  enum EFlags {
114  /// When to load DLL
115  fLoadNow = (1<<1), ///< Load DLL immediately in the constructor
116  fLoadLater = (1<<2), ///< Load DLL later, using method Load()
117  /// Whether to unload DLL in the destructor
118  fAutoUnload = (1<<3), ///< Unload DLL in the destructor
119  fNoAutoUnload = (1<<4), ///< Unload DLL later, using method Unload()
120  /// Whether to transform the DLL basename
121  fBaseName = (1<<5), ///< Treat the name as DLL basename
122  fExactName = (1<<6), ///< Use the name "as is"
123  /// Specify how to load symbols from DLL.
124  /// UNIX specific (see 'man dlopen'), ignored on all other platforms.
125  fGlobal = (1<<7), ///< Load as RTLD_GLOBAL
126  fLocal = (1<<8), ///< Load as RTLD_LOCAL
127  /// Default flags
129  };
130  typedef unsigned int TFlags; ///< Binary OR of "EFlags"
131 
132  //
133  // Enums, retained for backward compatibility
134  //
135 
136  /// When to load DLL.
137  enum ELoad {
140  };
141 
142  /// Whether to unload DLL in the destructor.
143  enum EAutoUnload {
146  };
147 
148  /// Whether to transform the DLL basename.
149  ///
150  /// Transformation is done according to the following:
151  /// <name> ---> NCBI_PLUGIN_PREFIX + <name> + NCBI_PLUGIN_SUFFIX
152  enum EBasename {
155  };
156 
157  /// Constructor.
158  ///
159  /// @param name
160  /// Can be either DLL basename or an absolute file path.
161  /// @param flags
162  /// Define how to load/unload DLL and interpret passed name.
163  /// @sa
164  /// Basename discussion in CDll header, EFlags
166  CDll(const string& name, TFlags flags);
167 
168  /// Constructor (for backward compatibility).
169  ///
170  /// @param name
171  /// Can be either DLL basename or an absolute file path.
172  /// @param when_to_load
173  /// Choice to load now or later using Load().
174  /// @param auto_unload
175  /// Choice to unload DLL in destructor.
176  /// @param treat_as
177  /// Choice to transform the DLL base name.
178  /// @sa
179  /// Basename discussion in CDll header,
180  /// ELoad, EAutoUnload, EBasename definition.
182  CDll(const string& name,
183  ELoad when_to_load = eLoadNow,
184  EAutoUnload auto_unload = eNoAutoUnload,
185  EBasename treate_as = eBasename);
186 
187  /// Constructor.
188  ///
189  /// The absolute file path to the DLL will be formed using the "path"
190  /// and "name" parameters in the following way:
191  /// - UNIX: <path>/PFX<name>SFX ; <path>/<name> if "name" is not basename
192  /// - MS-Win: <path>\PFX<name>SFX ; <path><name> if "name" is not basename
193  /// where PFX is NCBI_PLUGIN_PREFIX and SFX is NCBI_PLUGIN_SUFFIX.
194  ///
195  /// @param path
196  /// Path to DLL.
197  /// @param name
198  /// Name of DLL.
199  /// @param flags
200  /// Define how to load/unload DLL and interpret passed name.
201  /// @sa
202  /// Basename discussion in CDll header, EFlags
204  CDll(const string& path, const string& name, TFlags flags);
205 
206  /// Constructor (for backward compatibility).
207  ///
208  /// The absolute file path to the DLL will be formed using the "path"
209  /// and "name" parameters in the following way:
210  /// - UNIX: <path>/PFX<name>SFX ; <path>/<name> if "name" is not basename
211  /// - MS-Win: <path>\PFX<name>SFX ; <path><name> if "name" is not basename
212  /// where PFX is NCBI_PLUGIN_PREFIX and SFX is NCBI_PLUGIN_SUFFIX.
213  ///
214  /// @param path
215  /// Path to DLL.
216  /// @param name
217  /// Name of DLL.
218  /// @param when_to_load
219  /// Choice to load now or later using Load().
220  /// @param auto_load
221  /// Choice to unload DLL in destructor.
222  /// @param treat_as
223  /// Choice to transform the DLL base name.
224  /// @sa
225  /// Basename discussion in CDll header,
226  /// ELoad, EAutoUnload, EBasename definition.
228  CDll(const string& path, const string& name,
229  ELoad when_to_load = eLoadNow,
230  EAutoUnload auto_unload = eNoAutoUnload,
231  EBasename treate_as = eBasename);
232 
233  /// Destructor.
234  ///
235  /// Unload DLL if constructor was passed "eAutoUnload".
236  /// Destructor does not throw any exceptions.
237  NCBI_XNCBI_EXPORT ~CDll(void);
238 
239  /// Load DLL.
240  ///
241  /// Load the DLL using the name specified in the constructor's DLL "name".
242  /// If Load() is called more than once without calling Unload() in between,
243  /// then it will do nothing.
244  ///
245  /// @note If the DLL links against the core "xncbi" library, loading it may
246  /// result in reinvoking static initializers, with potential consequences
247  /// ranging from having to retune diagnostic settings to crashing at exit.
248  /// This problem could theoretically also affect other libraries linked
249  /// from both sides, but they haven't been an issue in practice. It can
250  /// help for both the program and the DLL to link "xncbi" dynamically, but
251  /// in some configurations that change still isn't entirely sufficient. As
252  /// such, on affected platforms, the C++ Toolkit's build system arranges to
253  /// filter "xncbi" out of the relevant makefile settings unless
254  /// specifically directed otherwise via KEEP_CORELIB = yes (which can be
255  /// useful when building plugins for third-party applications such as
256  /// scripting languages).
257  NCBI_XNCBI_EXPORT void Load(void);
258 
259  /// Unload DLL.
260  ///
261  /// Do nothing and do not generate errors if the DLL is not loaded.
262  NCBI_XNCBI_EXPORT void Unload(void);
263 
264  /// Get DLLs entry point (function).
265  ///
266  /// Get the entry point (a function) with name "name" in the DLL and
267  /// return the entry point's address on success, or return NULL on error.
268  /// If the DLL is not loaded yet, then this method will call Load(),
269  /// which can result in throwing an exception if Load() fails.
270  /// @sa
271  /// GetEntryPoint_Data
272  template <class TFunc>
273  TFunc GetEntryPoint_Func(const string& name, TFunc* func)
274  {
275  TEntryPoint ptr = GetEntryPoint(name);
276  if ( func ) {
277  *func = (TFunc)(void*)ptr.func;
278  }
279  return (TFunc)(void*)ptr.func;
280  }
281 
282  /// Get DLLs entry point (data).
283  ///
284  /// Get the entry point (a data) with name "name" in the DLL and
285  /// return the entry point's address on success, or return NULL on error.
286  /// If the DLL is not loaded yet, then this method will call Load(),
287  /// which can result in throwing an exception if Load() fails.
288  /// @sa
289  /// GetEntryPoint_Func
290  template <class TData>
291  TData GetEntryPoint_Data(const string& name, TData* data)
292  {
293  TEntryPoint ptr = GetEntryPoint(name);
294  if ( data ) {
295  *data = static_cast<TData> (ptr.data);
296  }
297  return static_cast<TData> (ptr.data);
298  }
299 
300  /// Fake, uncallable function pointer
301  typedef void (*FEntryPoint)(char**** Do_Not_Call_This);
302 
303  /// Entry point -- pointer to either a function or a data
304  union TEntryPoint {
305  FEntryPoint func; ///< Do not call this func without type cast!
306  void* data;
307  };
308 
309  /// Helper find method for getting a DLLs entry point.
310  ///
311  /// Get the entry point (e.g. a function) with name "name" in the DLL.
312  /// @param name
313  /// Name of DLL.
314  /// @param pointer_size
315  /// Size of pointer.
316  /// @return
317  /// The entry point's address on success, or return NULL on error.
318  /// @sa
319  /// GetEntryPoint_Func, GetEntryPoint_Data
321  TEntryPoint GetEntryPoint(const string& name);
322 
323  /// Get the name of the DLL file
325  const string& GetName() const { return m_Name; }
326 
327 private:
328  /// Helper method to throw exception with system-specific error message.
329  NCBI_NORETURN
330  void x_ThrowException(const string& what);
331 
332  /// Helper method to initialize object.
333  ///
334  /// Called from constructor.
335  /// @param path
336  /// Path to DLL.
337  /// @param name
338  /// Name of DLL.
339  /// @param when_to_load
340  /// Choice to load now or later using Load().
341  /// @param auto_load
342  /// Choice to unload DLL in destructor.
343  /// @param treat_as
344  /// Choice to transform the DLL base name.
345  /// @sa
346  /// EFlags
347  void x_Init(const string& path, const string& name, TFlags flags);
348 
349 protected:
350  /// Private copy constructor to prohibit copy.
351  CDll(const CDll&);
352 
353  /// Private assignment operator to prohibit assignment.
354  CDll& operator= (const CDll&);
355 
356 private:
357  string m_Name; ///< DLL name
358  SDllHandle* m_Handle; ///< DLL handle
359  TFlags m_Flags; ///< Flags
360 };
361 
362 
363 
364 /////////////////////////////////////////////////////////////////////////////
365 ///
366 /// Class for entry point resolution when there are several DLL candidates.
367 ///
368 /// If Dll resolver finds DLL with the specified entry point it is
369 /// stored in the internal list (provided by GetResolvedEntries method).
370 /// All DLL libraries are unloaded upon resolver's destruction.
371 ///
373 {
374 public:
375 
376  /// DLL entry point name -> function pair
378  {
379  string name; ///< Entry point name
380  CDll::TEntryPoint entry_point; ///< DLL entry point
381 
382  SNamedEntryPoint(const string& x_name, CDll::TEntryPoint x_entry_point)
383  : name(x_name)
384  {
385  entry_point.data = x_entry_point.data;
386  }
387  };
388 
389  /// DLL resolution descriptor.
390  /// Storage only. DLLs will be unloaded in the ~CDLLRelolver(), and memory freed.
392  {
393  CDll* dll; ///< Loaded DLL instance
394  vector<SNamedEntryPoint> entry_points; ///< list of DLL entry points
395 
396  SResolvedEntry(CDll* dll_ptr = 0)
397  : dll(dll_ptr)
398  {}
399  };
400 
401  /// Container, keeps list of all resolved entry points.
402  typedef vector<SResolvedEntry> TEntries;
403 
404 
405  /// Constructor.
406  ///
407  /// @param entry_point_name
408  /// Name of the DLL entry point.
409  /// @param unload
410  /// Whether to unload loaded DLLs in the destructor
411  NCBI_XNCBI_EXPORT CDllResolver(const string& entry_point_name,
413 
414  /// Constructor.
415  ///
416  /// @param entry_point_names
417  /// List of alternative DLL entry points.
418  /// @param unload
419  /// Whether to unload loaded DLLs in the destructor
420  NCBI_XNCBI_EXPORT CDllResolver(const vector<string>& entry_point_names,
422 
423  /// Destructor.
425 
426  /// Try to load DLL from the specified file and resolve the entry point.
427  ///
428  /// If DLL resolution successfully loaded entry point is registered in the
429  /// internal list of resolved entries.
430  ///
431  /// @param file_name
432  /// Name of the DLL file. Can be full name with path of the base name.
433  /// @param driver_name
434  /// Name of the driver (substitute for ${driver} macro)
435  /// @return
436  /// TRUE if DLL is successfully loaded and entry point resolved.
437  /// @sa
438  /// GetResolvedEntries
440  bool TryCandidate(const string& file_name,
441  const string& driver_name = kEmptyStr);
442 
443  /// Try to resolve file candidates.
444  ///
445  /// @param candidates
446  /// Container with file names to try.
447  /// @param driver_name
448  /// Driver name
449  /// @sa
450  /// GetResolvedEntries
451  template<class TClass>
452  void Try(const TClass& candidates, const string& driver_name = kEmptyStr)
453  {
454  typename TClass::const_iterator it = candidates.begin();
455  typename TClass::const_iterator it_end = candidates.end();
456  for (; it != it_end; ++it) {
457  TryCandidate(*it, driver_name);
458  }
459  }
460 
461  /// Various (usually system-dependent) standard paths to look for DLLs in.
462  /// The fProgramPath flag works only inside CNcbiApplication framework.
463  /// @sa
464  /// x_AddExtraDllPath, FindCandidates
466  fNoExtraDllPath = 0, //< Do not add
467  fProgramPath = 1 << 0, //< Path to executable file
468  fToolkitDllPath = 1 << 1, //< Toolkit paths
469  fSystemDllPath = 1 << 2, //< System paths
471  };
472 
473  typedef int TExtraDllPath; //< bitwise OR of "EExtraDllPath"
474 
475  /// Try to resolve all files matching the specified masks in the
476  /// specified directories.
477  ///
478  /// @param paths
479  /// Container with directory names.
480  /// @param masks
481  /// Container with file candidate masks.
482  /// @param extra_path
483  /// Extra "standard" paths to search the DLLs in
484  /// @sa
485  /// GetResolvedEntries, x_AddExtraDllPath
486  template<class TClass1, class TClass2>
487  void FindCandidates(const TClass1& paths, const TClass2& masks,
488  TExtraDllPath extra_path = fDefaultDllPath,
489  const string& driver_name = kEmptyStr)
490  {
491  // search in the explicitly specified paths
492  vector<string> x_path(paths);
493  // search in "standard" paths, if any specified by 'extra_path' flag
494  x_AddExtraDllPath(x_path, extra_path);
495  // remove duplicate dirs
496  vector<string> x_path_unique;
497  x_path_unique.reserve(x_path.size());
498 #if defined(NCBI_OS_MSWIN)
499  NStr::ECase use_case = NStr::eNocase;
500 #else
501  NStr::ECase use_case = NStr::eCase;
502 #endif
503  ITERATE(vector<string>, it, x_path) {
504  bool found = false;
505  ITERATE(vector<string>, i, x_path_unique) {
506  if ( NStr::Compare(*i, *it, use_case) == 0 ) {
507  found = true;
508  break;
509  }
510  }
511  if ( !found ) {
512  x_path_unique.push_back(CDir::DeleteTrailingPathSeparator(*it));
513  }
514  }
515 
516  // find files
517  vector<string> candidates;
518  FindFiles(candidates,
519  x_path_unique.begin(), x_path_unique.end(),
520  masks.begin(), masks.end(),
521  fFF_File);
522  // try to resolve entry points in the found DLLs
523  Try(candidates, driver_name);
524  }
525 
526  /// Get all resolved entry points.
528  const TEntries& GetResolvedEntries() const
529  {
530  return m_ResolvedEntries;
531  }
532 
533  /// Get all resolved entry points.
536  {
537  return m_ResolvedEntries;
538  }
539 
540  /// Unload all resolved DLLs.
541  NCBI_XNCBI_EXPORT void Unload();
542 
543 private:
546 
547  /// Get the DLL search paths related to the given standard path group
548  ///
549  /// @param paths
550  /// Container to add the requested DLL search paths to.
551  /// @param which
552  /// Which "standard" paths to add.
553  /// @sa
554  /// FindCandidates
556  void x_AddExtraDllPath(vector<string>& paths, TExtraDllPath which);
557 
558 protected:
559  vector<string> m_EntryPoinNames; ///< Candidate entry points
562 };
563 
564 /* @} */
565 
566 
568 
569 #endif /* CORELIB___NCBIDLL__HPP */
CAliasTypeInfoFunctions TFunc
Definition: aliasinfo.cpp:59
Class for entry point resolution when there are several DLL candidates.
Definition: ncbidll.hpp:373
CDll –.
Definition: ncbidll.hpp:107
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
const char * file_name[]
char data[12]
Definition: iconv.c:80
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
const string & GetName() const
Get the name of the DLL file.
Definition: ncbidll.hpp:325
SDllHandle * m_Handle
DLL handle.
Definition: ncbidll.hpp:358
EFlags
General flags.
Definition: ncbidll.hpp:113
FEntryPoint func
Do not call this func without type cast!
Definition: ncbidll.hpp:305
TFlags m_Flags
Flags.
Definition: ncbidll.hpp:359
const TEntries & GetResolvedEntries() const
Get all resolved entry points.
Definition: ncbidll.hpp:528
void(* FEntryPoint)(char ****Do_Not_Call_This)
Fake, uncallable function pointer.
Definition: ncbidll.hpp:301
EBasename
Whether to transform the DLL basename.
Definition: ncbidll.hpp:152
void Load(void)
Load DLL.
Definition: ncbidll.cpp:158
void x_Init(const string &path, const string &name, TFlags flags)
Helper method to initialize object.
Definition: ncbidll.cpp:124
bool TryCandidate(const string &file_name, const string &driver_name=kEmptyStr)
Try to load DLL from the specified file and resolve the entry point.
Definition: ncbidll.cpp:290
int TExtraDllPath
Definition: ncbidll.hpp:473
vector< SResolvedEntry > TEntries
Container, keeps list of all resolved entry points.
Definition: ncbidll.hpp:402
vector< SNamedEntryPoint > entry_points
list of DLL entry points
Definition: ncbidll.hpp:394
CDllResolver(const string &entry_point_name, CDll::EAutoUnload unload=CDll::eAutoUnload)
Constructor.
Definition: ncbidll.cpp:271
EAutoUnload
Whether to unload DLL in the destructor.
Definition: ncbidll.hpp:143
string m_Name
DLL name.
Definition: ncbidll.hpp:357
~CDll(void)
Destructor.
Definition: ncbidll.cpp:110
CDll::EAutoUnload m_AutoUnloadDll
Definition: ncbidll.hpp:561
ELoad
When to load DLL.
Definition: ncbidll.hpp:137
SResolvedEntry(CDll *dll_ptr=0)
Definition: ncbidll.hpp:396
void Try(const TClass &candidates, const string &driver_name=kEmptyStr)
Try to resolve file candidates.
Definition: ncbidll.hpp:452
void Unload()
Unload all resolved DLLs.
Definition: ncbidll.cpp:435
CDllResolver & operator=(const CDllResolver &)
TFunc GetEntryPoint_Func(const string &name, TFunc *func)
Get DLLs entry point (function).
Definition: ncbidll.hpp:273
CDll(const CDll &)
Private copy constructor to prohibit copy.
unsigned int TFlags
Binary OR of "EFlags".
Definition: ncbidll.hpp:130
TEntryPoint GetEntryPoint(const string &name)
Helper find method for getting a DLLs entry point.
Definition: ncbidll.cpp:212
void Unload(void)
Unload DLL.
Definition: ncbidll.cpp:186
SNamedEntryPoint(const string &x_name, CDll::TEntryPoint x_entry_point)
Definition: ncbidll.hpp:382
~CDllResolver()
Destructor.
Definition: ncbidll.cpp:285
TEntries & GetResolvedEntries()
Get all resolved entry points.
Definition: ncbidll.hpp:535
vector< string > m_EntryPoinNames
Candidate entry points.
Definition: ncbidll.hpp:559
CDll(const string &name, TFlags flags)
Constructor.
Definition: ncbidll.cpp:85
CDll::TEntryPoint entry_point
DLL entry point.
Definition: ncbidll.hpp:380
void x_ThrowException(const string &what)
Helper method to throw exception with system-specific error message.
Definition: ncbidll.cpp:244
TData GetEntryPoint_Data(const string &name, TData *data)
Get DLLs entry point (data).
Definition: ncbidll.hpp:291
EExtraDllPath
Various (usually system-dependent) standard paths to look for DLLs in.
Definition: ncbidll.hpp:465
TEntries m_ResolvedEntries
Definition: ncbidll.hpp:560
void FindCandidates(const TClass1 &paths, const TClass2 &masks, TExtraDllPath extra_path=fDefaultDllPath, const string &driver_name=kEmptyStr)
Try to resolve all files matching the specified masks in the specified directories.
Definition: ncbidll.hpp:487
CDll & operator=(const CDll &)
Private assignment operator to prohibit assignment.
CDll * dll
Loaded DLL instance.
Definition: ncbidll.hpp:393
string name
Entry point name.
Definition: ncbidll.hpp:379
void x_AddExtraDllPath(vector< string > &paths, TExtraDllPath which)
Get the DLL search paths related to the given standard path group.
Definition: ncbidll.cpp:360
CDllResolver(const CDllResolver &)
@ fLoadNow
When to load DLL.
Definition: ncbidll.hpp:115
@ fAutoUnload
Whether to unload DLL in the destructor.
Definition: ncbidll.hpp:118
@ fBaseName
Whether to transform the DLL basename.
Definition: ncbidll.hpp:121
@ fLocal
Load as RTLD_LOCAL.
Definition: ncbidll.hpp:126
@ fLoadLater
Load DLL later, using method Load()
Definition: ncbidll.hpp:116
@ fExactName
Use the name "as is".
Definition: ncbidll.hpp:122
@ fGlobal
Specify how to load symbols from DLL.
Definition: ncbidll.hpp:125
@ fDefault
Default flags.
Definition: ncbidll.hpp:128
@ fNoAutoUnload
Unload DLL later, using method Unload()
Definition: ncbidll.hpp:119
@ eExactName
Definition: ncbidll.hpp:154
@ eBasename
Definition: ncbidll.hpp:153
@ eAutoUnload
Definition: ncbidll.hpp:144
@ eNoAutoUnload
Definition: ncbidll.hpp:145
@ eLoadNow
Definition: ncbidll.hpp:138
@ eLoadLater
Definition: ncbidll.hpp:139
static string DeleteTrailingPathSeparator(const string &path)
Delete trailing path separator, if any.
Definition: ncbifile.cpp:465
void FindFiles(TPathIterator path_begin, TPathIterator path_end, const vector< string > &masks, TFindFunc &find_func, TFindFiles flags=fFF_Default)
Generic algorithm for file search.
Definition: ncbifile.hpp:3145
@ fFF_File
find files
Definition: ncbifile.hpp:3008
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
Definition: ncbistr.hpp:5297
ECase
Which type of string comparison.
Definition: ncbistr.hpp:1204
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
@ eCase
Case sensitive compare.
Definition: ncbistr.hpp:1205
#define NCBI_XNCBI_EXPORT
Definition: ncbi_export.h:1283
int i
Defines access to miscellaneous global configuration settings.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
DLL entry point name -> function pair.
Definition: ncbidll.hpp:378
DLL resolution descriptor.
Definition: ncbidll.hpp:392
Entry point – pointer to either a function or a data.
Definition: ncbidll.hpp:304
Modified on Wed Apr 24 14:18:32 2024 by modify_doxy.py rev. 669887