SetFarInfo

Far Manager

SetFarInfo

Called when a subplugin module is loaded and MultiArc passes a PluginStartupInfo structure pointer to the plugin. This function is optional and can be omitted.
void  WINAPI SetFarInfo(
  const struct PluginStartupInfo *Info
);

Parameters

Info
a pointer to a PluginStartupInfo structure

Return value

None.

Remarks

  1. Function is called only once immediately after LoadFormatModule function call, after which a subplugin knows about FAR Manager as much as MultiArc plugin itself (plus some additional info from MultiArc).
  2. Info pointer is valid only within the function scope (only inside the function) so the structure must be copied to subplugin's internal variable for further use:
    static struct PluginStartupInfo Info;
    ...
    void WINAPI _export SetStartupInfo(const struct PluginStartupInfo *Info)
    {
      ::Info=*Info;
      ...
    }
    
  3. If there're "standard functions" (from FarStandardFunctions structure) used in the plugin then PluginStartupInfo.FSF member must be saved to subplugin's local scope as well:
    static struct PluginStartupInfo Info;
    static struct FarStandardFunctions FSF;
    
    void  _export SetStartupInfo(struct PluginStartupInfo *psInfo)
    {
        Info=*psInfo;
        FSF=*psInfo->FSF;
        Info.FSF=&FSF; // correct the address in the local structure
        ...
    } 
See also: