(v13) D_GET_FLAGS
This page applies to Harlequin v13.1r0 and later; and to Harlequin MultiRIP but not Harlequin Core
D_GET_FLAGS Selector
Parameter: devGetFlagsParam * flagsparam
The RIP calls this selector to find out how the plugin has set flags which define certain of its characteristics. These flags are defined in the header file gdevdefs.h
.
The parameter passed with the selector is described below.
typedef struct devGetFlagsParam { int32 flags;
} devGetFlagsParam;
Required flags should be ORed together and the result stored in the flags
field. If none are required,
flags
should be set explicitly to zero by the plugin.
Additional flags fields might be added to the structure in future versions of the plugin interface, but they will be initialized to zero so that plugins using the definition above will not be affected.
At present there is only one flag: PF_DONT_UNLOAD
.
PF_DONT_UNLOAD
The flag PF_DONT_UNLOAD
is defined as a manifest constant in gdevdefs.h
:
#define PF_DONT_UNLOAD 1
If this flag is set, the RIP will never attempt to unload the plugin once it is loaded. This defeats the repeated loading and unloading that might occur otherwise. (See (v13) D_INITIALISE .)
If a plugin is unloaded and loaded back in later, it is unlikely to occupy the same memory as before. Furthermore, if unloaded, no plugin state can be maintained. Any static data in the plugin would be relocated, and associated DMA hardware interrupt handlers and so on that may need to continue to operate after the plugin's main task is complete would no longer work.
Plugin writers using multiple threads should ensure that threads are killed when the plugin is unloaded, or that any shared data with the plugin is used only when the plugin is loaded.
Setting this flag avoids these effects, but at the expense of extra memory consumption in order to keep all such plugins loaded at once.