The following list of functions are the functions which can be defined inside of your mode which will be
called to do setup, and acquire various pieces of information from the mode.
voidinit(structmode*mode,structmap*config)
Defining this function is required. This function is called to setup your plugin and provide it
with several pointers which are described below.
structmode*mode - used to identify your mode, it is passed to a large number of the API
functions to identify your mode.
structmap*config - all of the config options that the user defined for your mode. Information on
how to access this can be found in wofi-map(3).
voidload(structmode*mode)
Defining this function is optional. This function is called before ALL others and provides your
mode pointer as early as possible.
structmode*mode - used to identify your mode, it is passed to a large number of the API
functions to identify your mode.
constchar**get_arg_names(void)
Defining this function is optional. This function is called to get an array of config options
which can be set by the user. All of these options have the name of your mode prefixed on the
front so if your array is for example {"opt1","opt2"} the config options defined will be mode-opt1=value and mode-opt2=value where mode is the name of the shared object.
size_tget_arg_count(void)
Defining this function is optional. This function is called to get the number of arguments
returned by get_arg_names(void).
voidexec(constchar*cmd)
Defining this function is required. This function is called when the user selects an entry.
constchar*cmd - The action registered to the selected entry. If your mode allows executing
searches directly then this will be the search contents if no matching entries exist.
structwidget*get_widget(void)
Defining this function is optional. This function is called to request the next widget to be
added. See wofi_create_widget() in wofi-api(3) on how to obtain a structwidget*. NULL should be
returned to denote no more widgets are available.
boolno_entry(void)
Defining this function is optional. This function is called to find out whether or not this mode
supports running searches without any matching entries. The default is false, if you wish to allow
your mode to take searches directly you must define this and return true.
wofi(3)