PageRenderTime 205ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/tcl/tclapi.swg

#
Unknown | 108 lines | 90 code | 18 blank | 0 comment | 0 complexity | 07833963354644bc11c24bf9951695e0 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  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. Tcl_HashTable hashtable;
  46. } swig_class;
  47. typedef struct swig_instance {
  48. Tcl_Obj *thisptr;
  49. void *thisvalue;
  50. swig_class *classptr;
  51. int destroy;
  52. Tcl_Command cmdtok;
  53. } swig_instance;
  54. /* Structure for command table */
  55. typedef struct {
  56. const char *name;
  57. int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
  58. ClientData clientdata;
  59. } swig_command_info;
  60. /* Structure for variable linking table */
  61. typedef struct {
  62. const char *name;
  63. void *addr;
  64. char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);
  65. char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);
  66. } swig_var_info;
  67. /* -----------------------------------------------------------------------------*
  68. * Install a constant object
  69. * -----------------------------------------------------------------------------*/
  70. static Tcl_HashTable swigconstTable;
  71. static int swigconstTableinit = 0;
  72. SWIGINTERN void
  73. SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) {
  74. int newobj;
  75. Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY);
  76. Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj);
  77. }
  78. SWIGINTERN Tcl_Obj *
  79. SWIG_Tcl_GetConstantObj(const char *key) {
  80. Tcl_HashEntry *entryPtr;
  81. if (!swigconstTableinit) return 0;
  82. entryPtr = Tcl_FindHashEntry(&swigconstTable, key);
  83. if (entryPtr) {
  84. return (Tcl_Obj *) Tcl_GetHashValue(entryPtr);
  85. }
  86. return 0;
  87. }
  88. #ifdef __cplusplus
  89. }
  90. #endif