2014-07-21 19:39:24 +00:00
|
|
|
#ifndef __SCRIPT_DIALOG_H__
|
|
|
|
#define __SCRIPT_DIALOG_H__
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure holds the arguments for the script_switcher.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2014-11-25 07:27:08 +00:00
|
|
|
/** Prompt to display. */
|
2014-07-21 19:39:24 +00:00
|
|
|
char *name;
|
2014-11-25 07:27:08 +00:00
|
|
|
/** The script */
|
2014-07-21 19:39:24 +00:00
|
|
|
char *script_path;
|
|
|
|
} ScriptOptions;
|
|
|
|
|
2014-11-25 07:27:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param input Pointer to the user-input string.
|
|
|
|
* @param data Custom data pointer for callback.
|
|
|
|
*
|
|
|
|
* Run the script dialog
|
|
|
|
*
|
|
|
|
* @returns SwitcherMode selected by user.
|
|
|
|
*/
|
2014-07-21 19:39:24 +00:00
|
|
|
SwitcherMode script_switcher_dialog ( char **input, void *data );
|
|
|
|
|
|
|
|
/**
|
2014-11-25 07:27:08 +00:00
|
|
|
* @param str The input string to parse
|
|
|
|
*
|
2014-07-21 19:39:24 +00:00
|
|
|
* Parse an argument string into the right ScriptOptions data object.
|
|
|
|
* This is off format: <Name>:<Script>
|
2014-11-25 07:27:08 +00:00
|
|
|
*
|
|
|
|
* @returns NULL when it fails, a newly allocated ScriptOptions when successful.
|
2014-07-21 19:39:24 +00:00
|
|
|
*/
|
|
|
|
ScriptOptions *script_switcher_parse_setup ( const char *str );
|
|
|
|
|
|
|
|
/**
|
2014-11-25 07:27:08 +00:00
|
|
|
* @param sw Handle to the ScriptOption
|
|
|
|
*
|
2014-07-21 19:39:24 +00:00
|
|
|
* Free the ScriptOptions block.
|
|
|
|
*/
|
2015-02-04 08:37:34 +00:00
|
|
|
void script_switcher_free_options ( void *data );
|
2014-07-21 19:39:24 +00:00
|
|
|
#endif
|