HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dl.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_BASE_TF_DL_H
8 #define PXR_BASE_TF_DL_H
9 
10 /// \file tf/dl.h
11 /// \ingroup group_tf_SystemsExt
12 /// Interface for opening code libraries.
13 
14 #include "pxr/pxr.h"
15 #include "pxr/base/tf/api.h"
16 #include "pxr/base/arch/library.h"
17 
18 #include <string>
19 
21 
22 /// \addtogroup group_tf_SystemsExt
23 ///@{
24 
25 /// Open a dynamic library and notify \c lib/tf that a new module has been
26 /// loaded.
27 ///
28 /// This is a wrapper around ArchLibraryOpen() in the sense that this function
29 /// calls \c ArchLibraryOpen(\p filename, \p flag) but it will additionally
30 /// load script bindings if scripting is initialized and loading is requested.
31 ///
32 /// If \p error is not \c NULL it will be set to a system reported error
33 /// if opening the library failed, otherwise it will be cleared.
34 ///
35 /// If you set TF_DLOPEN in the TF_DEBUG environment variable then debug
36 /// output will be reported on each invocation of this function.
37 ///
38 /// This returns an opaque handle to the opened library or \c NULL on
39 /// failure.
40 TF_API
41 void* TfDlopen(const std::string &filename,
42  int flag,
43  std::string *error = NULL,
44  bool loadScriptBindings = true);
45 
46 /// Close a dynamic library.
47 TF_API
48 int TfDlclose(void* handle);
49 
50 /// \private
51 TF_API
52 bool Tf_DlOpenIsActive();
53 /// \private
54 TF_API
55 bool Tf_DlCloseIsActive();
56 
57 ///@}
58 
60 
61 #endif
GT_API const UT_StringHolder filename
#define TF_API
Definition: api.h:23
< returns > If no error
Definition: snippets.dox:2
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
TF_API int TfDlclose(void *handle)
Close a dynamic library.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
TF_API void * TfDlopen(const std::string &filename, int flag, std::string *error=NULL, bool loadScriptBindings=true)