Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.0 KiB

  1. /* -----------------------------------------------------------------------------
  2. * SWIG API. Portion that goes into the runtime
  3. * ----------------------------------------------------------------------------- */
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* -----------------------------------------------------------------------------
  8. * Constant declarations
  9. * ----------------------------------------------------------------------------- */
  10. /* Constant Types */
  11. #define SWIG_TCL_POINTER 4
  12. #define SWIG_TCL_BINARY 5
  13. /* Constant information structure */
  14. typedef struct swig_const_info {
  15. int type;
  16. char *name;
  17. long lvalue;
  18. double dvalue;
  19. void *pvalue;
  20. swig_type_info **ptype;
  21. } swig_const_info;
  22. typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
  23. typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
  24. typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int);
  25. typedef void (*swig_delete_func)(ClientData);
  26. typedef struct swig_method {
  27. const char *name;
  28. swig_wrapper method;
  29. } swig_method;
  30. typedef struct swig_attribute {
  31. const char *name;
  32. swig_wrapper getmethod;
  33. swig_wrapper setmethod;
  34. } swig_attribute;
  35. typedef struct swig_class {
  36. const char *name;
  37. swig_type_info **type;
  38. swig_wrapper constructor;
  39. void (*destructor)(void *);
  40. swig_method *methods;
  41. swig_attribute *attributes;
  42. struct swig_class **bases;
  43. const char **base_names;
  44. swig_module_info *module;
  45. } swig_class;
  46. typedef struct swig_instance {
  47. Tcl_Obj *thisptr;
  48. void *thisvalue;
  49. swig_class *classptr;
  50. int destroy;
  51. Tcl_Command cmdtok;
  52. } swig_instance;
  53. /* Structure for command table */
  54. typedef struct {
  55. const char *name;
  56. int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
  57. ClientData clientdata;
  58. } swig_command_info;
  59. /* Structure for variable linking table */
  60. typedef struct {
  61. const char *name;
  62. void *addr;
  63. char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);
  64. char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);
  65. } swig_var_info;
  66. /* -----------------------------------------------------------------------------*
  67. * Install a constant object
  68. * -----------------------------------------------------------------------------*/
  69. static Tcl_HashTable swigconstTable;
  70. static int swigconstTableinit = 0;
  71. SWIGINTERN void
  72. SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) {
  73. int newobj;
  74. Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY);
  75. Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj);
  76. }
  77. SWIGINTERN Tcl_Obj *
  78. SWIG_Tcl_GetConstantObj(const char *key) {
  79. Tcl_HashEntry *entryPtr;
  80. if (!swigconstTableinit) return 0;
  81. entryPtr = Tcl_FindHashEntry(&swigconstTable, key);
  82. if (entryPtr) {
  83. return (Tcl_Obj *) Tcl_GetHashValue(entryPtr);
  84. }
  85. return 0;
  86. }
  87. #ifdef __cplusplus
  88. }
  89. #endif