root/modules/script_api.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef SCRIPT_API_H
   2 #define SCRIPT_API_H
   3 
   4 #include "flt.h"
   5 
   6 // Return values from 'script_run'
   7 #define SCRIPT_RUN_ENDED        0
   8 #define SCRIPT_RUN_RUNNING      1
   9 #define SCRIPT_RUN_ERROR        -1
  10 
  11 enum {
  12     SCRIPT_SHOOT_HOOK_PRESHOOT=0,
  13     SCRIPT_SHOOT_HOOK_SHOOT,
  14     SCRIPT_SHOOT_HOOK_RAW,
  15     SCRIPT_NUM_SHOOT_HOOKS,
  16 };
  17 
  18 // Update version if changes are made to the module interface
  19 #define SCRIPT_API_VERSION      {3,0}
  20 
  21 // Module interface for script languages (Lua and uBasic)
  22 typedef struct
  23 {
  24     base_interface_t    base;
  25 
  26     int     (*script_start)( char const* script, int is_ptp ); // initialize and load script
  27     int     (*script_start_file)( char const* filename ); // initialize and load script from file
  28     int     (*script_run)( void );          // run script timeslice
  29     void    (*script_reset)(void);
  30     void    (*set_variable)(char *name, int value, int isBool, int isTable, int labelCount, const char **labels);
  31     void    (*set_as_ret)(int as_ret);      // save 'return' value from action stack code (e.g. motion detect, shoot)
  32     int     (*run_restore)( void );         // run the "restore" function at the end of a script
  33     void    (*shoot_hook)(int hook);        // run a hook in the shooting process, called from hooked task
  34 } libscriptapi_sym;
  35 
  36 extern libscriptapi_sym* libscriptapi;
  37 extern void module_set_script_lang( const char* script_file );
  38 
  39 #endif

/* [<][>][^][v][top][bottom][index][help] */