Advertisement
Guest User

libtcc_bind.h

a guest
Jul 17th, 2013
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.88 KB | None | 0 0
  1. #pragma once
  2.  
  3. //
  4. #define TCC_ADD_API( X, Y )                 \
  5. {                               \
  6.     tcc_add_symbol( libtcc_getContext(), X, (void*) Y );    \
  7. }
  8.  
  9. //
  10. #define TCC_OUTPUT_MEMORY   0 /* output will be run in memory (default)     */
  11. #define TCC_OUTPUT_EXE      1 /* executable file                */
  12. #define TCC_OUTPUT_DLL      2 /* dynamic library                */
  13. #define TCC_OUTPUT_OBJ      3 /* object file                */
  14. #define TCC_OUTPUT_PREPROCESS   4 /* only preprocess (used internally)      */
  15.  
  16. //
  17. #define TCC_RELOCATE_AUTO ((void*)1)
  18.  
  19. //
  20. extern bool  libtcc_start     ( void );
  21. extern void  libtcc_stop      ( void );
  22. extern void *libtcc_getContext( void );
  23.  
  24. // tcc api
  25. extern void *(*tcc_new          )( void );
  26. extern void  (*tcc_delete       )( void *s );
  27. extern void  (*tcc_set_error_func   )( void *s, void *error_opaque, void (*error_func)(void *opaque, const char *msg) );
  28. extern int   (*tcc_add_symbol       )( void *s, const char *name, const void *val );
  29. extern int   (*tcc_add_file     )( void *s, const char *filename );
  30. extern int   (*tcc_compile_string   )( void *s, const char *buf );
  31. extern int   (*tcc_relocate     )( void *s, void *ptr );
  32. extern void *(*tcc_get_symbol       )( void *s, const char *name );
  33. extern void  (*tcc_set_lib_path     )( void *s, const char *path );
  34. extern void  (*tcc_set_output_type  )( void *s, int output_type );
  35. extern int   (*tcc_set_options      )( void *s, const char *str );
  36. extern int   (*tcc_add_include_path )( void *s, const char *pathname );
  37. extern int   (*tcc_add_sysinclude_path  )( void *s, const char *pathname );
  38. extern void  (*tcc_define_symbol    )( void *s, const char *sym, const char *value );
  39. extern void  (*tcc_undefine_symbol  )( void *s, const char *sym );
  40. extern int   (*tcc_add_library_path )( void *s, const char *pathname );
  41. extern int   (*tcc_add_library      )( void *s, const char *libraryname );
  42. extern int   (*tcc_output_file      )( void *s, const char *filename );
  43. extern int   (*tcc_run          )( void *s, int argc, char **argv );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement