Инструменты пользователя

Инструменты сайта


en:autorun:documentation2x:fordevs

For developers

When loading library with LoadLibrary, Autorun is trying to find Autorun_PluginInit function, if this is found, calling it allow developer to define custom commands and variables. Function get the AutorunInterface type structure with some useful information and pointer to adapter function. For working with functions it's need to assign this pointer to global variable Adapter. After that the next functions become available:

function AddFunc(AName: PWideChar; AAddr: Pointer; AFlags: integer): integer;

Adds user function for using in the Autorun script.

function ParseNext(AParamStr: PWideChar; ABuffer: PWideChar; ABufSize: DWORD): integer;

Returns the following parameters from the given string using the Autorun parser. Also this parameter is deleting from source string. Freeing the developer from doing this work. Function return the parameter type (AU_PARSER_NAMEDPARARAM, AU_PARSER_REGULARPARAM). If no more parameters, returns AU_PARSER_NOMOREPARAMS.

function GetVar(AVarName: PWideChar; ABuffer: PWideChar; nBufferSize: DWORD): integer;

Write into buffer ABuffer value of variable with AVarName name. If variable does not exist, function return error code AU_RESULT_VARNOEXIST.

function SetVar(const AName, AValue: PWideChar; AFlags: integer): integer;

Set variable with name AName and value AValue. If AFlags is have AU_VAR_CONSTANT set, variable will be protected from changes. If this function trying to change constant, it's value will be preserved, and function return error code AU_RESULT_NOREDEFINECONST.

function SetVarMacro(const AName: PWideChar; AFuncAddr: Pointer): integer;

Set variable with name AName and the function address AFuncAddr. When variable reading, callback function executing and return value.

function ExpandVars(const AText: PWideChar; ABuffer: PWideChar; ABufSize: DWORD): integer;

Expanding environment and internal variables from given string AText to buffer ABuffer.

function ReportError(MsgID: integer; const AParam: PWideChar): integer; overload;

Show the standard error message (ID — in Autorun language file). If message require parameter, set it in AParam.

function ReportError(const AParam: PWideChar): integer; overload;

Show the non-standard error message

function CallCommand(const ACmdLine: PWideChar; AResult: PWideChar; AResultSize: DWORD): integer; 
function CallCommand(const ACmdLine: PWideChar): integer;

Call internal Autorun's command.

function GetAutorunValue(AValueType: integer; const AValueName: PWideChar; ABuffer: Pointer; nBufSize, AFlags: DWORD): integer; 

Gets various Autorun values that may be useful when writing plugins.

Look more in the header files, placed in the archive along with test plugin source.

en/autorun/documentation2x/fordevs.txt · Последнее изменение: 2020/05/12 14:44 — 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki