/xbmc/visualizations/Goom/goom2k4-0/src/goomsl.h

http://github.com/xbmc/xbmc · C++ Header · 34 lines · 24 code · 10 blank · 0 comment · 0 complexity · 6386f23ebdaccc286067d226bc89ab71 MD5 · raw file

  1. #ifndef _GOOMSL_H
  2. #define _GOOMSL_H
  3. #include "goomsl_hash.h"
  4. typedef struct _GoomSL GoomSL;
  5. typedef void (*GoomSL_ExternalFunction)(GoomSL *gsl, GoomHash *global_vars, GoomHash *local_vars);
  6. GoomSL*gsl_new(void);
  7. void gsl_free(GoomSL *gss);
  8. char *gsl_init_buffer(const char *file_name);
  9. void gsl_append_file_to_buffer(const char *file_name, char **buffer);
  10. void gsl_compile (GoomSL *scanner, const char *script);
  11. void gsl_execute (GoomSL *scanner);
  12. int gsl_is_compiled (GoomSL *gss);
  13. void gsl_bind_function(GoomSL *gss, const char *fname, GoomSL_ExternalFunction func);
  14. int gsl_malloc (GoomSL *_this, int size);
  15. void *gsl_get_ptr (GoomSL *_this, int id);
  16. void gsl_free_ptr(GoomSL *_this, int id);
  17. GoomHash *gsl_globals(GoomSL *_this);
  18. #define GSL_LOCAL_PTR(gsl,local,name) gsl_get_ptr(gsl, *(int*)goom_hash_get(local,name)->ptr)
  19. #define GSL_LOCAL_INT(gsl,local,name) (*(int*)goom_hash_get(local,name)->ptr)
  20. #define GSL_LOCAL_FLOAT(gsl,local,name) (*(float*)goom_hash_get(local,name)->ptr)
  21. #define GSL_GLOBAL_PTR(gsl,name) gsl_get_ptr(gsl, *(int*)goom_hash_get(gsl_globals(gsl),name)->ptr)
  22. #define GSL_GLOBAL_INT(gsl,name) (*(int*)goom_hash_get(gsl_globals(gsl),name)->ptr)
  23. #define GSL_GLOBAL_FLOAT(gsl,name) (*(float*)goom_hash_get(gsl_globals(gsl),name)->ptr)
  24. #endif