tk 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +4 -3
  3. data/MANUAL_tcltklib.ja +1 -1
  4. data/README.md +8 -0
  5. data/ext/tk/extconf.rb +6 -7
  6. data/ext/tk/stubs.c +1 -2
  7. data/ext/tk/tcltklib.c +419 -868
  8. data/ext/tk/tkutil/tkutil.c +81 -202
  9. data/lib/multi-tk.rb +2 -2
  10. data/lib/thread_tk.rb +1 -1
  11. data/lib/tk/bgerror.rb +1 -1
  12. data/lib/tk/bindtag.rb +1 -1
  13. data/lib/tk/busy.rb +1 -1
  14. data/lib/tk/button.rb +1 -1
  15. data/lib/tk/canvas.rb +1 -1
  16. data/lib/tk/canvastag.rb +1 -1
  17. data/lib/tk/checkbutton.rb +1 -1
  18. data/lib/tk/clipboard.rb +1 -1
  19. data/lib/tk/clock.rb +1 -1
  20. data/lib/tk/composite.rb +1 -1
  21. data/lib/tk/console.rb +1 -1
  22. data/lib/tk/dialog.rb +1 -1
  23. data/lib/tk/encodedstr.rb +1 -1
  24. data/lib/tk/entry.rb +1 -1
  25. data/lib/tk/font.rb +1 -1
  26. data/lib/tk/fontchooser.rb +1 -1
  27. data/lib/tk/frame.rb +1 -1
  28. data/lib/tk/grid.rb +1 -1
  29. data/lib/tk/image.rb +1 -1
  30. data/lib/tk/itemconfig.rb +1 -1
  31. data/lib/tk/itemfont.rb +1 -1
  32. data/lib/tk/kinput.rb +1 -1
  33. data/lib/tk/label.rb +1 -1
  34. data/lib/tk/labelframe.rb +1 -1
  35. data/lib/tk/listbox.rb +1 -1
  36. data/lib/tk/macpkg.rb +1 -1
  37. data/lib/tk/menu.rb +1 -1
  38. data/lib/tk/menubar.rb +1 -1
  39. data/lib/tk/message.rb +1 -1
  40. data/lib/tk/mngfocus.rb +1 -1
  41. data/lib/tk/msgcat.rb +1 -1
  42. data/lib/tk/namespace.rb +1 -1
  43. data/lib/tk/optiondb.rb +1 -1
  44. data/lib/tk/optionobj.rb +1 -1
  45. data/lib/tk/pack.rb +1 -1
  46. data/lib/tk/package.rb +1 -1
  47. data/lib/tk/palette.rb +1 -1
  48. data/lib/tk/panedwindow.rb +1 -1
  49. data/lib/tk/place.rb +1 -1
  50. data/lib/tk/radiobutton.rb +1 -1
  51. data/lib/tk/root.rb +1 -1
  52. data/lib/tk/scale.rb +1 -1
  53. data/lib/tk/scrollable.rb +1 -1
  54. data/lib/tk/scrollbar.rb +1 -1
  55. data/lib/tk/scrollbox.rb +1 -1
  56. data/lib/tk/selection.rb +1 -1
  57. data/lib/tk/spinbox.rb +1 -1
  58. data/lib/tk/tagfont.rb +1 -1
  59. data/lib/tk/text.rb +1 -1
  60. data/lib/tk/textimage.rb +1 -1
  61. data/lib/tk/textmark.rb +1 -1
  62. data/lib/tk/texttag.rb +1 -1
  63. data/lib/tk/textwindow.rb +1 -1
  64. data/lib/tk/timer.rb +1 -1
  65. data/lib/tk/tk_mac.rb +1 -1
  66. data/lib/tk/toplevel.rb +1 -1
  67. data/lib/tk/txtwin_abst.rb +1 -1
  68. data/lib/tk/validation.rb +1 -1
  69. data/lib/tk/variable.rb +1 -1
  70. data/lib/tk/virtevent.rb +1 -1
  71. data/lib/tk/winfo.rb +1 -1
  72. data/lib/tk/winpkg.rb +1 -1
  73. data/lib/tk/wm.rb +1 -1
  74. data/lib/tk/xim.rb +1 -1
  75. data/lib/tk.rb +4 -2
  76. data/lib/tkextlib/ICONS/icons.rb +1 -1
  77. data/lib/tkextlib/blt/barchart.rb +1 -1
  78. data/lib/tkextlib/blt/bitmap.rb +1 -1
  79. data/lib/tkextlib/blt/busy.rb +1 -1
  80. data/lib/tkextlib/blt/component.rb +1 -1
  81. data/lib/tkextlib/blt/container.rb +1 -1
  82. data/lib/tkextlib/blt/cutbuffer.rb +1 -1
  83. data/lib/tkextlib/blt/dragdrop.rb +1 -1
  84. data/lib/tkextlib/blt/eps.rb +1 -1
  85. data/lib/tkextlib/blt/graph.rb +1 -1
  86. data/lib/tkextlib/blt/htext.rb +1 -1
  87. data/lib/tkextlib/blt/spline.rb +1 -1
  88. data/lib/tkextlib/blt/stripchart.rb +1 -1
  89. data/lib/tkextlib/blt/table.rb +1 -1
  90. data/lib/tkextlib/blt/tabnotebook.rb +1 -1
  91. data/lib/tkextlib/blt/tabset.rb +1 -1
  92. data/lib/tkextlib/blt/ted.rb +1 -1
  93. data/lib/tkextlib/blt/tile/button.rb +1 -1
  94. data/lib/tkextlib/blt/tile/checkbutton.rb +1 -1
  95. data/lib/tkextlib/blt/tile/frame.rb +1 -1
  96. data/lib/tkextlib/blt/tile/label.rb +1 -1
  97. data/lib/tkextlib/blt/tile/radiobutton.rb +1 -1
  98. data/lib/tkextlib/blt/tile/scrollbar.rb +1 -1
  99. data/lib/tkextlib/blt/tile/toplevel.rb +1 -1
  100. data/lib/tkextlib/blt/tile.rb +1 -1
  101. data/lib/tkextlib/blt/tree.rb +1 -1
  102. data/lib/tkextlib/blt/treeview.rb +1 -1
  103. data/lib/tkextlib/blt/unix_dnd.rb +1 -1
  104. data/lib/tkextlib/blt/vector.rb +1 -1
  105. data/lib/tkextlib/blt/watch.rb +1 -1
  106. data/lib/tkextlib/blt/win_printer.rb +1 -1
  107. data/lib/tkextlib/blt/winop.rb +1 -1
  108. data/lib/tkextlib/blt.rb +1 -1
  109. data/lib/tkextlib/bwidget/arrowbutton.rb +1 -1
  110. data/lib/tkextlib/bwidget/bitmap.rb +1 -1
  111. data/lib/tkextlib/bwidget/button.rb +1 -1
  112. data/lib/tkextlib/bwidget/buttonbox.rb +1 -1
  113. data/lib/tkextlib/bwidget/combobox.rb +1 -1
  114. data/lib/tkextlib/bwidget/dialog.rb +1 -1
  115. data/lib/tkextlib/bwidget/dragsite.rb +1 -1
  116. data/lib/tkextlib/bwidget/dropsite.rb +1 -1
  117. data/lib/tkextlib/bwidget/dynamichelp.rb +1 -1
  118. data/lib/tkextlib/bwidget/entry.rb +1 -1
  119. data/lib/tkextlib/bwidget/label.rb +1 -1
  120. data/lib/tkextlib/bwidget/labelentry.rb +1 -1
  121. data/lib/tkextlib/bwidget/labelframe.rb +1 -1
  122. data/lib/tkextlib/bwidget/listbox.rb +1 -1
  123. data/lib/tkextlib/bwidget/mainframe.rb +1 -1
  124. data/lib/tkextlib/bwidget/messagedlg.rb +1 -1
  125. data/lib/tkextlib/bwidget/notebook.rb +1 -1
  126. data/lib/tkextlib/bwidget/pagesmanager.rb +1 -1
  127. data/lib/tkextlib/bwidget/panedwindow.rb +1 -1
  128. data/lib/tkextlib/bwidget/panelframe.rb +1 -1
  129. data/lib/tkextlib/bwidget/passwddlg.rb +1 -1
  130. data/lib/tkextlib/bwidget/progressbar.rb +1 -1
  131. data/lib/tkextlib/bwidget/progressdlg.rb +1 -1
  132. data/lib/tkextlib/bwidget/scrollableframe.rb +1 -1
  133. data/lib/tkextlib/bwidget/scrolledwindow.rb +1 -1
  134. data/lib/tkextlib/bwidget/scrollview.rb +1 -1
  135. data/lib/tkextlib/bwidget/selectcolor.rb +1 -1
  136. data/lib/tkextlib/bwidget/selectfont.rb +1 -1
  137. data/lib/tkextlib/bwidget/separator.rb +1 -1
  138. data/lib/tkextlib/bwidget/spinbox.rb +1 -1
  139. data/lib/tkextlib/bwidget/statusbar.rb +1 -1
  140. data/lib/tkextlib/bwidget/titleframe.rb +1 -1
  141. data/lib/tkextlib/bwidget/tree.rb +1 -1
  142. data/lib/tkextlib/bwidget/widget.rb +1 -1
  143. data/lib/tkextlib/bwidget.rb +1 -1
  144. data/lib/tkextlib/itcl/incr_tcl.rb +1 -1
  145. data/lib/tkextlib/itk/incr_tk.rb +1 -1
  146. data/lib/tkextlib/iwidgets/buttonbox.rb +1 -1
  147. data/lib/tkextlib/iwidgets/calendar.rb +1 -1
  148. data/lib/tkextlib/iwidgets/canvasprintbox.rb +1 -1
  149. data/lib/tkextlib/iwidgets/canvasprintdialog.rb +1 -1
  150. data/lib/tkextlib/iwidgets/checkbox.rb +1 -1
  151. data/lib/tkextlib/iwidgets/combobox.rb +1 -1
  152. data/lib/tkextlib/iwidgets/dateentry.rb +1 -1
  153. data/lib/tkextlib/iwidgets/datefield.rb +1 -1
  154. data/lib/tkextlib/iwidgets/dialog.rb +1 -1
  155. data/lib/tkextlib/iwidgets/dialogshell.rb +1 -1
  156. data/lib/tkextlib/iwidgets/disjointlistbox.rb +1 -1
  157. data/lib/tkextlib/iwidgets/entryfield.rb +1 -1
  158. data/lib/tkextlib/iwidgets/extbutton.rb +1 -1
  159. data/lib/tkextlib/iwidgets/extfileselectionbox.rb +1 -1
  160. data/lib/tkextlib/iwidgets/extfileselectiondialog.rb +1 -1
  161. data/lib/tkextlib/iwidgets/feedback.rb +1 -1
  162. data/lib/tkextlib/iwidgets/fileselectionbox.rb +1 -1
  163. data/lib/tkextlib/iwidgets/fileselectiondialog.rb +1 -1
  164. data/lib/tkextlib/iwidgets/finddialog.rb +1 -1
  165. data/lib/tkextlib/iwidgets/hierarchy.rb +1 -1
  166. data/lib/tkextlib/iwidgets/hyperhelp.rb +1 -1
  167. data/lib/tkextlib/iwidgets/labeledframe.rb +1 -1
  168. data/lib/tkextlib/iwidgets/labeledwidget.rb +1 -1
  169. data/lib/tkextlib/iwidgets/mainwindow.rb +1 -1
  170. data/lib/tkextlib/iwidgets/menubar.rb +1 -1
  171. data/lib/tkextlib/iwidgets/messagebox.rb +1 -1
  172. data/lib/tkextlib/iwidgets/messagedialog.rb +1 -1
  173. data/lib/tkextlib/iwidgets/notebook.rb +2 -2
  174. data/lib/tkextlib/iwidgets/optionmenu.rb +1 -1
  175. data/lib/tkextlib/iwidgets/panedwindow.rb +1 -1
  176. data/lib/tkextlib/iwidgets/promptdialog.rb +1 -1
  177. data/lib/tkextlib/iwidgets/pushbutton.rb +1 -1
  178. data/lib/tkextlib/iwidgets/radiobox.rb +1 -1
  179. data/lib/tkextlib/iwidgets/scopedobject.rb +1 -1
  180. data/lib/tkextlib/iwidgets/scrolledcanvas.rb +1 -1
  181. data/lib/tkextlib/iwidgets/scrolledframe.rb +1 -1
  182. data/lib/tkextlib/iwidgets/scrolledhtml.rb +1 -1
  183. data/lib/tkextlib/iwidgets/scrolledlistbox.rb +1 -1
  184. data/lib/tkextlib/iwidgets/scrolledtext.rb +1 -1
  185. data/lib/tkextlib/iwidgets/scrolledwidget.rb +1 -1
  186. data/lib/tkextlib/iwidgets/selectionbox.rb +1 -1
  187. data/lib/tkextlib/iwidgets/selectiondialog.rb +1 -1
  188. data/lib/tkextlib/iwidgets/shell.rb +1 -1
  189. data/lib/tkextlib/iwidgets/spindate.rb +1 -1
  190. data/lib/tkextlib/iwidgets/spinint.rb +1 -1
  191. data/lib/tkextlib/iwidgets/spinner.rb +1 -1
  192. data/lib/tkextlib/iwidgets/spintime.rb +1 -1
  193. data/lib/tkextlib/iwidgets/tabnotebook.rb +2 -2
  194. data/lib/tkextlib/iwidgets/tabset.rb +1 -1
  195. data/lib/tkextlib/iwidgets/timeentry.rb +1 -1
  196. data/lib/tkextlib/iwidgets/timefield.rb +1 -1
  197. data/lib/tkextlib/iwidgets/toolbar.rb +1 -1
  198. data/lib/tkextlib/iwidgets/watch.rb +1 -1
  199. data/lib/tkextlib/iwidgets.rb +1 -1
  200. data/lib/tkextlib/pkg_checker.rb +1 -1
  201. data/lib/tkextlib/tcllib/autoscroll.rb +1 -1
  202. data/lib/tkextlib/tcllib/calendar.rb +1 -1
  203. data/lib/tkextlib/tcllib/canvas_sqmap.rb +1 -1
  204. data/lib/tkextlib/tcllib/canvas_zoom.rb +1 -1
  205. data/lib/tkextlib/tcllib/chatwidget.rb +1 -1
  206. data/lib/tkextlib/tcllib/crosshair.rb +1 -1
  207. data/lib/tkextlib/tcllib/ctext.rb +1 -1
  208. data/lib/tkextlib/tcllib/cursor.rb +1 -1
  209. data/lib/tkextlib/tcllib/dateentry.rb +1 -1
  210. data/lib/tkextlib/tcllib/datefield.rb +1 -1
  211. data/lib/tkextlib/tcllib/diagrams.rb +1 -1
  212. data/lib/tkextlib/tcllib/dialog.rb +1 -1
  213. data/lib/tkextlib/tcllib/getstring.rb +1 -1
  214. data/lib/tkextlib/tcllib/history.rb +1 -1
  215. data/lib/tkextlib/tcllib/ico.rb +1 -1
  216. data/lib/tkextlib/tcllib/ip_entry.rb +1 -1
  217. data/lib/tkextlib/tcllib/khim.rb +1 -1
  218. data/lib/tkextlib/tcllib/menuentry.rb +1 -1
  219. data/lib/tkextlib/tcllib/ntext.rb +1 -1
  220. data/lib/tkextlib/tcllib/panelframe.rb +1 -1
  221. data/lib/tkextlib/tcllib/plotchart.rb +1 -1
  222. data/lib/tkextlib/tcllib/ruler.rb +1 -1
  223. data/lib/tkextlib/tcllib/screenruler.rb +1 -1
  224. data/lib/tkextlib/tcllib/scrolledwindow.rb +1 -1
  225. data/lib/tkextlib/tcllib/scrollwin.rb +1 -1
  226. data/lib/tkextlib/tcllib/statusbar.rb +1 -1
  227. data/lib/tkextlib/tcllib/style.rb +1 -1
  228. data/lib/tkextlib/tcllib/superframe.rb +1 -1
  229. data/lib/tkextlib/tcllib/swaplist.rb +1 -1
  230. data/lib/tkextlib/tcllib/tablelist.rb +1 -1
  231. data/lib/tkextlib/tcllib/tablelist_core.rb +5 -5
  232. data/lib/tkextlib/tcllib/tablelist_tile.rb +1 -1
  233. data/lib/tkextlib/tcllib/tkpiechart.rb +1 -1
  234. data/lib/tkextlib/tcllib/toolbar.rb +1 -1
  235. data/lib/tkextlib/tcllib/tooltip.rb +1 -1
  236. data/lib/tkextlib/tcllib/validator.rb +1 -1
  237. data/lib/tkextlib/tcllib/widget.rb +1 -1
  238. data/lib/tkextlib/tcllib.rb +1 -1
  239. data/lib/tkextlib/tclx/tclx.rb +1 -1
  240. data/lib/tkextlib/tile/dialog.rb +1 -1
  241. data/lib/tkextlib/tile/sizegrip.rb +1 -1
  242. data/lib/tkextlib/tile/style.rb +1 -1
  243. data/lib/tkextlib/tile/tbutton.rb +1 -1
  244. data/lib/tkextlib/tile/tcheckbutton.rb +1 -1
  245. data/lib/tkextlib/tile/tcombobox.rb +1 -1
  246. data/lib/tkextlib/tile/tentry.rb +1 -1
  247. data/lib/tkextlib/tile/tframe.rb +1 -1
  248. data/lib/tkextlib/tile/tlabel.rb +1 -1
  249. data/lib/tkextlib/tile/tlabelframe.rb +1 -1
  250. data/lib/tkextlib/tile/tmenubutton.rb +1 -1
  251. data/lib/tkextlib/tile/tnotebook.rb +1 -1
  252. data/lib/tkextlib/tile/tpaned.rb +1 -1
  253. data/lib/tkextlib/tile/tprogressbar.rb +1 -1
  254. data/lib/tkextlib/tile/tradiobutton.rb +1 -1
  255. data/lib/tkextlib/tile/treeview.rb +1 -1
  256. data/lib/tkextlib/tile/tscale.rb +1 -1
  257. data/lib/tkextlib/tile/tscrollbar.rb +1 -1
  258. data/lib/tkextlib/tile/tseparator.rb +1 -1
  259. data/lib/tkextlib/tile/tspinbox.rb +1 -1
  260. data/lib/tkextlib/tile/tsquare.rb +1 -1
  261. data/lib/tkextlib/tile.rb +1 -1
  262. data/lib/tkextlib/tkDND/shape.rb +1 -1
  263. data/lib/tkextlib/tkDND/tkdnd.rb +1 -1
  264. data/lib/tkextlib/tkDND.rb +1 -1
  265. data/lib/tkextlib/tkHTML/htmlwidget.rb +1 -1
  266. data/lib/tkextlib/tkimg/bmp.rb +1 -1
  267. data/lib/tkextlib/tkimg/dted.rb +1 -1
  268. data/lib/tkextlib/tkimg/gif.rb +1 -1
  269. data/lib/tkextlib/tkimg/ico.rb +1 -1
  270. data/lib/tkextlib/tkimg/jpeg.rb +1 -1
  271. data/lib/tkextlib/tkimg/pcx.rb +1 -1
  272. data/lib/tkextlib/tkimg/pixmap.rb +1 -1
  273. data/lib/tkextlib/tkimg/png.rb +1 -1
  274. data/lib/tkextlib/tkimg/ppm.rb +1 -1
  275. data/lib/tkextlib/tkimg/ps.rb +1 -1
  276. data/lib/tkextlib/tkimg/raw.rb +1 -1
  277. data/lib/tkextlib/tkimg/sgi.rb +1 -1
  278. data/lib/tkextlib/tkimg/sun.rb +1 -1
  279. data/lib/tkextlib/tkimg/tga.rb +1 -1
  280. data/lib/tkextlib/tkimg/tiff.rb +1 -1
  281. data/lib/tkextlib/tkimg/window.rb +1 -1
  282. data/lib/tkextlib/tkimg/xbm.rb +1 -1
  283. data/lib/tkextlib/tkimg/xpm.rb +1 -1
  284. data/lib/tkextlib/tkimg.rb +1 -1
  285. data/lib/tkextlib/tktable/tktable.rb +1 -1
  286. data/lib/tkextlib/tktable.rb +1 -1
  287. data/lib/tkextlib/tktrans/tktrans.rb +1 -1
  288. data/lib/tkextlib/tktrans.rb +1 -1
  289. data/lib/tkextlib/treectrl/tktreectrl.rb +2 -2
  290. data/lib/tkextlib/trofs/trofs.rb +1 -1
  291. data/lib/tkextlib/vu/bargraph.rb +1 -1
  292. data/lib/tkextlib/vu/charts.rb +1 -1
  293. data/lib/tkextlib/vu/dial.rb +1 -1
  294. data/lib/tkextlib/vu/pie.rb +1 -1
  295. data/lib/tkextlib/vu/spinbox.rb +1 -1
  296. data/lib/tkextlib/vu.rb +1 -1
  297. data/lib/tkextlib/winico/winico.rb +1 -1
  298. data/lib/tkextlib/winico.rb +1 -1
  299. data/sample/tktextio.rb +2 -2
  300. data/tk.gemspec +1 -1
  301. metadata +3 -6
data/ext/tk/tcltklib.c CHANGED
@@ -59,7 +59,7 @@ int rb_thread_check_trap_pending(void);
59
59
 
60
60
  #if defined(HAVE_RB_PROC_NEW) && !defined(RUBY_VM)
61
61
  /* Ruby 1.8 :: rb_proc_new() was hidden from intern.h at 2008/04/22 */
62
- extern VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE));
62
+ extern VALUE rb_proc_new (VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
63
63
  #endif
64
64
 
65
65
  #undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
@@ -131,7 +131,11 @@ set_tcltk_version(void)
131
131
  &(tcltk_version.type));
132
132
  }
133
133
 
134
- #if TCL_MAJOR_VERSION >= 8
134
+ #if TCL_MAJOR_VERSION >= 9
135
+ # define CONST const
136
+ # define CONST84 const
137
+ # define CONST86 const
138
+ #elif TCL_MAJOR_VERSION >= 8
135
139
  # ifndef CONST84
136
140
  # if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */
137
141
  # define CONST84
@@ -152,6 +156,13 @@ set_tcltk_version(void)
152
156
  # endif
153
157
  #endif
154
158
 
159
+ /* let's deal with Tcl_Size */
160
+ #if TCL_MAJOR_VERSION >= 9
161
+ # define TYPE_TCL_SIZE Tcl_Size
162
+ #else
163
+ # define TYPE_TCL_SIZE int
164
+ #endif
165
+
155
166
  #ifndef CONST86
156
167
  # if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 5 /* Tcl8.0.x -- 8.5.x */
157
168
  # define CONST86
@@ -188,8 +199,8 @@ static const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
188
199
  /* finalize_proc_name */
189
200
  static const char finalize_hook_name[] = "INTERP_FINALIZE_HOOK";
190
201
 
191
- static void ip_finalize _((Tcl_Interp*));
192
- static void ip_free _((void *p));
202
+ static void ip_finalize (Tcl_Interp*);
203
+ static void ip_free (void *p);
193
204
 
194
205
  static int at_exit = 0;
195
206
 
@@ -203,15 +214,15 @@ static int ENCODING_INDEX_BINARY;
203
214
  static VALUE ENCODING_NAME_UTF8;
204
215
  static VALUE ENCODING_NAME_BINARY;
205
216
 
206
- static VALUE create_dummy_encoding_for_tk_core _((VALUE, VALUE, VALUE));
207
- static VALUE create_dummy_encoding_for_tk _((VALUE, VALUE));
208
- static int update_encoding_table _((VALUE, VALUE, VALUE));
209
- static VALUE encoding_table_get_name_core _((VALUE, VALUE, VALUE));
210
- static VALUE encoding_table_get_obj_core _((VALUE, VALUE, VALUE));
211
- static VALUE encoding_table_get_name _((VALUE, VALUE));
212
- static VALUE encoding_table_get_obj _((VALUE, VALUE));
213
- static VALUE create_encoding_table _((VALUE));
214
- static VALUE ip_get_encoding_table _((VALUE));
217
+ static VALUE create_dummy_encoding_for_tk_core (VALUE, VALUE, VALUE);
218
+ static VALUE create_dummy_encoding_for_tk (VALUE, VALUE);
219
+ static int update_encoding_table (VALUE, VALUE, VALUE);
220
+ static VALUE encoding_table_get_name_core (VALUE, VALUE, VALUE);
221
+ static VALUE encoding_table_get_obj_core (VALUE, VALUE, VALUE);
222
+ static VALUE encoding_table_get_name (VALUE, VALUE);
223
+ static VALUE encoding_table_get_obj (VALUE, VALUE);
224
+ static VALUE create_encoding_table (VALUE);
225
+ static VALUE ip_get_encoding_table (VALUE);
215
226
 
216
227
 
217
228
  /* for callback break & continue */
@@ -252,10 +263,10 @@ static ID ID_next;
252
263
  static ID ID_to_s;
253
264
  static ID ID_inspect;
254
265
 
255
- static VALUE ip_invoke_real _((int, VALUE*, VALUE));
256
- static VALUE ip_invoke _((int, VALUE*, VALUE));
257
- static VALUE ip_invoke_with_position _((int, VALUE*, VALUE, Tcl_QueuePosition));
258
- static VALUE tk_funcall _((VALUE(), int, VALUE*, VALUE));
266
+ static VALUE ip_invoke_real (int, VALUE*, VALUE);
267
+ static VALUE ip_invoke (int, VALUE*, VALUE);
268
+ static VALUE ip_invoke_with_position (int, VALUE*, VALUE, Tcl_QueuePosition);
269
+ static VALUE tk_funcall (VALUE(*)(VALUE, int, VALUE *), int, VALUE*, VALUE);
259
270
 
260
271
  /* Tcl's object type */
261
272
  #if TCL_MAJOR_VERSION >= 8
@@ -436,7 +447,7 @@ struct eval_queue {
436
447
 
437
448
  struct call_queue {
438
449
  Tcl_Event ev;
439
- VALUE (*func)();
450
+ VALUE (*func)(VALUE, int, VALUE *);
440
451
  int argc;
441
452
  VALUE *argv;
442
453
  VALUE interp;
@@ -549,11 +560,11 @@ static int check_rootwidget_flag = 0;
549
560
 
550
561
  /* call ruby interpreter */
551
562
  #if TCL_MAJOR_VERSION >= 8
552
- static int ip_ruby_eval _((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*));
553
- static int ip_ruby_cmd _((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*));
563
+ static int ip_ruby_eval (ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*);
564
+ static int ip_ruby_cmd (ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*);
554
565
  #else /* TCL_MAJOR_VERSION < 8 */
555
- static int ip_ruby_eval _((ClientData, Tcl_Interp *, int, char **));
556
- static int ip_ruby_cmd _((ClientData, Tcl_Interp *, int, char **));
566
+ static int ip_ruby_eval (ClientData, Tcl_Interp *, int, char **);
567
+ static int ip_ruby_cmd (ClientData, Tcl_Interp *, int, char **);
557
568
  #endif
558
569
 
559
570
  struct cmd_body_arg {
@@ -580,7 +591,7 @@ EXTERN struct TclIntStubs *tclIntStubsPtr;
580
591
  /* Tcl7.x doesn't have namespace support. */
581
592
  /* Tcl8.5+ has definition of Tcl_GetCurrentNamespace() in tclDecls.h */
582
593
  # ifndef Tcl_GetCurrentNamespace
583
- EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace _((Tcl_Interp *));
594
+ EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace (Tcl_Interp *);
584
595
  # endif
585
596
  # if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
586
597
  # ifndef Tcl_GetCurrentNamespace
@@ -591,7 +602,7 @@ struct DummyTclIntStubs_for_GetCurrentNamespace {
591
602
  int magic;
592
603
  struct TclIntStubHooks *hooks;
593
604
  void (*func[FunctionNum_of_GetCurrentNamespace])();
594
- Tcl_Namespace * (*tcl_GetCurrentNamespace) _((Tcl_Interp *));
605
+ Tcl_Namespace * (*tcl_GetCurrentNamespace) (Tcl_Interp *);
595
606
  };
596
607
 
597
608
  #define Tcl_GetCurrentNamespace \
@@ -636,7 +647,7 @@ typedef struct CallFrame {
636
647
  # endif
637
648
 
638
649
  # if !defined(TclGetFrame) && !defined(TclGetFrame_TCL_DECLARED)
639
- EXTERN int TclGetFrame _((Tcl_Interp *, CONST char *, CallFrame **));
650
+ EXTERN int TclGetFrame (Tcl_Interp *, CONST char *, CallFrame **);
640
651
  # endif
641
652
  # if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
642
653
  # ifndef TclGetFrame
@@ -647,7 +658,7 @@ struct DummyTclIntStubs_for_GetFrame {
647
658
  int magic;
648
659
  struct TclIntStubHooks *hooks;
649
660
  void (*func[FunctionNum_of_GetFrame])();
650
- int (*tclGetFrame) _((Tcl_Interp *, CONST char *, CallFrame **));
661
+ int (*tclGetFrame) (Tcl_Interp *, CONST char *, CallFrame **);
651
662
  };
652
663
  #define TclGetFrame \
653
664
  (((struct DummyTclIntStubs_for_GetFrame *)tclIntStubsPtr)->tclGetFrame)
@@ -655,8 +666,8 @@ struct DummyTclIntStubs_for_GetFrame {
655
666
  # endif
656
667
 
657
668
  # if !defined(Tcl_PopCallFrame) && !defined(Tcl_PopCallFrame_TCL_DECLARED)
658
- EXTERN void Tcl_PopCallFrame _((Tcl_Interp *));
659
- EXTERN int Tcl_PushCallFrame _((Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int));
669
+ EXTERN void Tcl_PopCallFrame (Tcl_Interp *);
670
+ EXTERN int Tcl_PushCallFrame (Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int);
660
671
  # endif
661
672
  # if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
662
673
  # ifndef Tcl_PopCallFrame
@@ -667,8 +678,8 @@ struct DummyTclIntStubs_for_PopCallFrame {
667
678
  int magic;
668
679
  struct TclIntStubHooks *hooks;
669
680
  void (*func[FunctionNum_of_PopCallFrame])();
670
- void (*tcl_PopCallFrame) _((Tcl_Interp *));
671
- int (*tcl_PushCallFrame) _((Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int));
681
+ void (*tcl_PopCallFrame) (Tcl_Interp *);
682
+ int (*tcl_PushCallFrame) (Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int);
672
683
  };
673
684
 
674
685
  #define Tcl_PopCallFrame \
@@ -694,7 +705,7 @@ typedef struct CallFrame {
694
705
  # endif
695
706
 
696
707
  # if !defined(TclGetFrame) && !defined(TclGetFrame_TCL_DECLARED)
697
- EXTERN int TclGetFrame _((Tcl_Interp *, CONST char *, CallFrame **));
708
+ EXTERN int TclGetFrame (Tcl_Interp *, CONST char *, CallFrame **);
698
709
  # endif
699
710
 
700
711
  # if !defined(Tcl_PopCallFrame) && !defined(Tcl_PopCallFrame_TCL_DECLARED)
@@ -781,8 +792,7 @@ static const rb_data_type_t tcltkip_type = {
781
792
  };
782
793
 
783
794
  static struct tcltkip *
784
- get_ip(self)
785
- VALUE self;
795
+ get_ip(VALUE self)
786
796
  {
787
797
  struct tcltkip *ptr;
788
798
 
@@ -799,8 +809,7 @@ get_ip(self)
799
809
  }
800
810
 
801
811
  static int
802
- deleted_ip(ptr)
803
- struct tcltkip *ptr;
812
+ deleted_ip(struct tcltkip *ptr)
804
813
  {
805
814
  if (!ptr || !ptr->ip || Tcl_InterpDeleted(ptr->ip)
806
815
  #if TCL_NAMESPACE_DEBUG
@@ -815,8 +824,7 @@ deleted_ip(ptr)
815
824
 
816
825
  /* increment/decrement reference count of tcltkip */
817
826
  static int
818
- rbtk_preserve_ip(ptr)
819
- struct tcltkip *ptr;
827
+ rbtk_preserve_ip(struct tcltkip *ptr)
820
828
  {
821
829
  ptr->ref_count++;
822
830
  if (ptr->ip == (Tcl_Interp*)NULL) {
@@ -829,8 +837,7 @@ rbtk_preserve_ip(ptr)
829
837
  }
830
838
 
831
839
  static int
832
- rbtk_release_ip(ptr)
833
- struct tcltkip *ptr;
840
+ rbtk_release_ip(struct tcltkip *ptr)
834
841
  {
835
842
  ptr->ref_count--;
836
843
  if (ptr->ref_count < 0) {
@@ -920,12 +927,12 @@ Software used in Tclkit, which each have very liberal BSD/MIT-like licenses:
920
927
 
921
928
  #if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
922
929
  EXTERN Tcl_Obj* TclGetStartupScriptPath();
923
- EXTERN void TclSetStartupScriptPath _((Tcl_Obj*));
930
+ EXTERN void TclSetStartupScriptPath (Tcl_Obj*);
924
931
  #define Tcl_GetStartupScript(encPtr) TclGetStartupScriptPath()
925
932
  #define Tcl_SetStartupScript(path,enc) TclSetStartupScriptPath(path)
926
933
  #endif
927
934
  #if !defined(TclSetPreInitScript) && !defined(TclSetPreInitScript_TCL_DECLARED)
928
- EXTERN char* TclSetPreInitScript _((char *));
935
+ EXTERN char* TclSetPreInitScript (char *);
929
936
  #endif
930
937
 
931
938
  #ifndef KIT_INCLUDES_TK
@@ -1324,8 +1331,7 @@ tcl_stubs_check(void)
1324
1331
 
1325
1332
 
1326
1333
  static VALUE
1327
- tcltkip_init_tk(interp)
1328
- VALUE interp;
1334
+ tcltkip_init_tk(VALUE interp)
1329
1335
  {
1330
1336
  struct tcltkip *ptr = get_ip(interp);
1331
1337
 
@@ -1432,9 +1438,7 @@ pending_exception_check0(void)
1432
1438
  }
1433
1439
 
1434
1440
  static int
1435
- pending_exception_check1(thr_crit_bup, ptr)
1436
- int thr_crit_bup;
1437
- struct tcltkip *ptr;
1441
+ pending_exception_check1(int thr_crit_bup, struct tcltkip *ptr)
1438
1442
  {
1439
1443
  volatile VALUE exc = rbtk_pending_exception;
1440
1444
 
@@ -1477,9 +1481,7 @@ pending_exception_check1(thr_crit_bup, ptr)
1477
1481
 
1478
1482
  /* call original 'exit' command */
1479
1483
  static void
1480
- call_original_exit(ptr, state)
1481
- struct tcltkip *ptr;
1482
- int state;
1484
+ call_original_exit(struct tcltkip *ptr, int state)
1483
1485
  {
1484
1486
  int thr_crit_bup;
1485
1487
  Tcl_CmdInfo *info;
@@ -1556,7 +1558,7 @@ call_original_exit(ptr, state)
1556
1558
  #endif
1557
1559
  argv[0] = (char *)"exit";
1558
1560
  /* argv[1] = Tcl_GetString(state_obj); */
1559
- argv[1] = Tcl_GetStringFromObj(state_obj, (int*)NULL);
1561
+ argv[1] = Tcl_GetStringFromObj(state_obj, (TYPE_TCL_SIZE*)NULL);
1560
1562
  argv[2] = (char *)NULL;
1561
1563
 
1562
1564
  ptr->return_value = (*(info->proc))(info->clientData, ptr->ip, 2, argv);
@@ -1626,10 +1628,8 @@ call_original_exit(ptr, state)
1626
1628
  static Tcl_TimerToken timer_token = (Tcl_TimerToken)NULL;
1627
1629
 
1628
1630
  /* timer callback */
1629
- static void _timer_for_tcl _((ClientData));
1630
1631
  static void
1631
- _timer_for_tcl(clientData)
1632
- ClientData clientData;
1632
+ _timer_for_tcl(ClientData clientData)
1633
1633
  {
1634
1634
  int thr_crit_bup;
1635
1635
 
@@ -1679,9 +1679,7 @@ toggle_eventloop_window_mode_for_idle(void)
1679
1679
  #endif
1680
1680
 
1681
1681
  static VALUE
1682
- set_eventloop_window_mode(self, mode)
1683
- VALUE self;
1684
- VALUE mode;
1682
+ set_eventloop_window_mode(VALUE self, VALUE mode)
1685
1683
  {
1686
1684
 
1687
1685
  if (RTEST(mode)) {
@@ -1694,8 +1692,7 @@ set_eventloop_window_mode(self, mode)
1694
1692
  }
1695
1693
 
1696
1694
  static VALUE
1697
- get_eventloop_window_mode(self)
1698
- VALUE self;
1695
+ get_eventloop_window_mode(VALUE self)
1699
1696
  {
1700
1697
  if ( ~window_event_mode ) {
1701
1698
  return Qfalse;
@@ -1705,9 +1702,7 @@ get_eventloop_window_mode(self)
1705
1702
  }
1706
1703
 
1707
1704
  static VALUE
1708
- set_eventloop_tick(self, tick)
1709
- VALUE self;
1710
- VALUE tick;
1705
+ set_eventloop_tick(VALUE self, VALUE tick)
1711
1706
  {
1712
1707
  int ttick = NUM2INT(tick);
1713
1708
  int thr_crit_bup;
@@ -1739,16 +1734,13 @@ set_eventloop_tick(self, tick)
1739
1734
  }
1740
1735
 
1741
1736
  static VALUE
1742
- get_eventloop_tick(self)
1743
- VALUE self;
1737
+ get_eventloop_tick(VALUE self)
1744
1738
  {
1745
1739
  return INT2NUM(timer_tick);
1746
1740
  }
1747
1741
 
1748
1742
  static VALUE
1749
- ip_set_eventloop_tick(self, tick)
1750
- VALUE self;
1751
- VALUE tick;
1743
+ ip_set_eventloop_tick(VALUE self, VALUE tick)
1752
1744
  {
1753
1745
  struct tcltkip *ptr = get_ip(self);
1754
1746
 
@@ -1765,16 +1757,13 @@ ip_set_eventloop_tick(self, tick)
1765
1757
  }
1766
1758
 
1767
1759
  static VALUE
1768
- ip_get_eventloop_tick(self)
1769
- VALUE self;
1760
+ ip_get_eventloop_tick(VALUE self)
1770
1761
  {
1771
1762
  return get_eventloop_tick(self);
1772
1763
  }
1773
1764
 
1774
1765
  static VALUE
1775
- set_no_event_wait(self, wait)
1776
- VALUE self;
1777
- VALUE wait;
1766
+ set_no_event_wait(VALUE self, VALUE wait)
1778
1767
  {
1779
1768
  int t_wait = NUM2INT(wait);
1780
1769
 
@@ -1790,16 +1779,13 @@ set_no_event_wait(self, wait)
1790
1779
  }
1791
1780
 
1792
1781
  static VALUE
1793
- get_no_event_wait(self)
1794
- VALUE self;
1782
+ get_no_event_wait(VALUE self)
1795
1783
  {
1796
1784
  return INT2NUM(no_event_wait);
1797
1785
  }
1798
1786
 
1799
1787
  static VALUE
1800
- ip_set_no_event_wait(self, wait)
1801
- VALUE self;
1802
- VALUE wait;
1788
+ ip_set_no_event_wait(VALUE self, VALUE wait)
1803
1789
  {
1804
1790
  struct tcltkip *ptr = get_ip(self);
1805
1791
 
@@ -1816,17 +1802,13 @@ ip_set_no_event_wait(self, wait)
1816
1802
  }
1817
1803
 
1818
1804
  static VALUE
1819
- ip_get_no_event_wait(self)
1820
- VALUE self;
1805
+ ip_get_no_event_wait(VALUE self)
1821
1806
  {
1822
1807
  return get_no_event_wait(self);
1823
1808
  }
1824
1809
 
1825
1810
  static VALUE
1826
- set_eventloop_weight(self, loop_max, no_event)
1827
- VALUE self;
1828
- VALUE loop_max;
1829
- VALUE no_event;
1811
+ set_eventloop_weight(VALUE self, VALUE loop_max, VALUE no_event)
1830
1812
  {
1831
1813
  int lpmax = NUM2INT(loop_max);
1832
1814
  int no_ev = NUM2INT(no_event);
@@ -1843,17 +1825,13 @@ set_eventloop_weight(self, loop_max, no_event)
1843
1825
  }
1844
1826
 
1845
1827
  static VALUE
1846
- get_eventloop_weight(self)
1847
- VALUE self;
1828
+ get_eventloop_weight(VALUE self)
1848
1829
  {
1849
1830
  return rb_ary_new3(2, INT2NUM(event_loop_max), INT2NUM(no_event_tick));
1850
1831
  }
1851
1832
 
1852
1833
  static VALUE
1853
- ip_set_eventloop_weight(self, loop_max, no_event)
1854
- VALUE self;
1855
- VALUE loop_max;
1856
- VALUE no_event;
1834
+ ip_set_eventloop_weight(VALUE self, VALUE loop_max, VALUE no_event)
1857
1835
  {
1858
1836
  struct tcltkip *ptr = get_ip(self);
1859
1837
 
@@ -1870,16 +1848,13 @@ ip_set_eventloop_weight(self, loop_max, no_event)
1870
1848
  }
1871
1849
 
1872
1850
  static VALUE
1873
- ip_get_eventloop_weight(self)
1874
- VALUE self;
1851
+ ip_get_eventloop_weight(VALUE self)
1875
1852
  {
1876
1853
  return get_eventloop_weight(self);
1877
1854
  }
1878
1855
 
1879
1856
  static VALUE
1880
- set_max_block_time(self, time)
1881
- VALUE self;
1882
- VALUE time;
1857
+ set_max_block_time(VALUE self, VALUE time)
1883
1858
  {
1884
1859
  struct Tcl_Time tcl_time;
1885
1860
  VALUE divmod;
@@ -1910,8 +1885,7 @@ set_max_block_time(self, time)
1910
1885
  }
1911
1886
 
1912
1887
  static VALUE
1913
- lib_evloop_thread_p(self)
1914
- VALUE self;
1888
+ lib_evloop_thread_p(VALUE self)
1915
1889
  {
1916
1890
  if (NIL_P(eventloop_thread)) {
1917
1891
  return Qnil; /* no eventloop */
@@ -1923,8 +1897,7 @@ lib_evloop_thread_p(self)
1923
1897
  }
1924
1898
 
1925
1899
  static VALUE
1926
- lib_evloop_abort_on_exc(self)
1927
- VALUE self;
1900
+ lib_evloop_abort_on_exc(VALUE self)
1928
1901
  {
1929
1902
  if (event_loop_abort_on_exc > 0) {
1930
1903
  return Qtrue;
@@ -1936,15 +1909,13 @@ lib_evloop_abort_on_exc(self)
1936
1909
  }
1937
1910
 
1938
1911
  static VALUE
1939
- ip_evloop_abort_on_exc(self)
1940
- VALUE self;
1912
+ ip_evloop_abort_on_exc(VALUE self)
1941
1913
  {
1942
1914
  return lib_evloop_abort_on_exc(self);
1943
1915
  }
1944
1916
 
1945
1917
  static VALUE
1946
- lib_evloop_abort_on_exc_set(self, val)
1947
- VALUE self, val;
1918
+ lib_evloop_abort_on_exc_set(VALUE self, VALUE val)
1948
1919
  {
1949
1920
  if (RTEST(val)) {
1950
1921
  event_loop_abort_on_exc = 1;
@@ -1957,8 +1928,7 @@ lib_evloop_abort_on_exc_set(self, val)
1957
1928
  }
1958
1929
 
1959
1930
  static VALUE
1960
- ip_evloop_abort_on_exc_set(self, val)
1961
- VALUE self, val;
1931
+ ip_evloop_abort_on_exc_set(VALUE self, VALUE val)
1962
1932
  {
1963
1933
  struct tcltkip *ptr = get_ip(self);
1964
1934
 
@@ -1976,10 +1946,7 @@ ip_evloop_abort_on_exc_set(self, val)
1976
1946
  }
1977
1947
 
1978
1948
  static VALUE
1979
- lib_num_of_mainwindows_core(self, argc, argv)
1980
- VALUE self;
1981
- int argc; /* dummy */
1982
- VALUE *argv; /* dummy */
1949
+ lib_num_of_mainwindows_core(VALUE self, int argc /* dummy */, VALUE *argv /* dummy */)
1983
1950
  {
1984
1951
  if (tk_stubs_init_p()) {
1985
1952
  return INT2FIX(Tk_GetNumMainWindows());
@@ -1989,8 +1956,7 @@ lib_num_of_mainwindows_core(self, argc, argv)
1989
1956
  }
1990
1957
 
1991
1958
  static VALUE
1992
- lib_num_of_mainwindows(self)
1993
- VALUE self;
1959
+ lib_num_of_mainwindows(VALUE self)
1994
1960
  {
1995
1961
  #ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
1996
1962
  return tk_funcall(lib_num_of_mainwindows_core, 0, (VALUE*)NULL, self);
@@ -2017,12 +1983,7 @@ rbtk_EventCheckProc(ClientData clientData, int flag)
2017
1983
 
2018
1984
  #ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
2019
1985
  static VALUE
2020
- #ifdef HAVE_PROTOTYPES
2021
- call_DoOneEvent_core(VALUE flag_val)
2022
- #else
2023
- call_DoOneEvent_core(flag_val)
2024
- VALUE flag_val;
2025
- #endif
1986
+ call_DoOneEvent_core(VALUE flag_val, RB_UNUSED_VAR(int argc), RB_UNUSED_VAR(VALUE *argv))
2026
1987
  {
2027
1988
  int flag;
2028
1989
 
@@ -2035,24 +1996,14 @@ call_DoOneEvent_core(flag_val)
2035
1996
  }
2036
1997
 
2037
1998
  static VALUE
2038
- #ifdef HAVE_PROTOTYPES
2039
1999
  call_DoOneEvent(VALUE flag_val)
2040
- #else
2041
- call_DoOneEvent(flag_val)
2042
- VALUE flag_val;
2043
- #endif
2044
2000
  {
2045
2001
  return tk_funcall(call_DoOneEvent_core, 0, (VALUE*)NULL, flag_val);
2046
2002
  }
2047
2003
 
2048
2004
  #else /* Ruby 1.8- */
2049
2005
  static VALUE
2050
- #ifdef HAVE_PROTOTYPES
2051
2006
  call_DoOneEvent(VALUE flag_val)
2052
- #else
2053
- call_DoOneEvent(flag_val)
2054
- VALUE flag_val;
2055
- #endif
2056
2007
  {
2057
2008
  int flag;
2058
2009
 
@@ -2194,11 +2145,7 @@ check_eventloop_interp(void)
2194
2145
  }
2195
2146
 
2196
2147
  static int
2197
- lib_eventloop_core(check_root, update_flag, check_var, interp)
2198
- int check_root;
2199
- int update_flag;
2200
- int *check_var;
2201
- Tcl_Interp *interp;
2148
+ lib_eventloop_core(int check_root, int update_flag, int *check_var, Tcl_Interp *interp)
2202
2149
  {
2203
2150
  volatile VALUE current = eventloop_thread;
2204
2151
  int found_event = 1;
@@ -2570,8 +2517,7 @@ struct evloop_params {
2570
2517
  };
2571
2518
 
2572
2519
  VALUE
2573
- lib_eventloop_main_core(args)
2574
- VALUE args;
2520
+ lib_eventloop_main_core(VALUE args)
2575
2521
  {
2576
2522
  struct evloop_params *params = (struct evloop_params *)args;
2577
2523
 
@@ -2590,8 +2536,7 @@ lib_eventloop_main_core(args)
2590
2536
  }
2591
2537
 
2592
2538
  VALUE
2593
- lib_eventloop_main(args)
2594
- VALUE args;
2539
+ lib_eventloop_main(VALUE args)
2595
2540
  {
2596
2541
  return lib_eventloop_main_core(args);
2597
2542
 
@@ -2625,8 +2570,7 @@ lib_eventloop_main(args)
2625
2570
  }
2626
2571
 
2627
2572
  VALUE
2628
- lib_eventloop_ensure(args)
2629
- VALUE args;
2573
+ lib_eventloop_ensure(VALUE args)
2630
2574
  {
2631
2575
  struct evloop_params *ptr = (struct evloop_params *)args;
2632
2576
  volatile VALUE current_evloop = rb_thread_current();
@@ -2687,11 +2631,7 @@ lib_eventloop_ensure(args)
2687
2631
  }
2688
2632
 
2689
2633
  static VALUE
2690
- lib_eventloop_launcher(check_root, update_flag, check_var, interp)
2691
- int check_root;
2692
- int update_flag;
2693
- int *check_var;
2694
- Tcl_Interp *interp;
2634
+ lib_eventloop_launcher(int check_root, int update_flag, int *check_var, Tcl_Interp *interp)
2695
2635
  {
2696
2636
  volatile VALUE parent_evloop = eventloop_thread;
2697
2637
  struct evloop_params *args = ALLOC(struct evloop_params);
@@ -2741,10 +2681,7 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp)
2741
2681
 
2742
2682
  /* execute Tk_MainLoop */
2743
2683
  static VALUE
2744
- lib_mainloop(argc, argv, self)
2745
- int argc;
2746
- VALUE *argv;
2747
- VALUE self;
2684
+ lib_mainloop(int argc, VALUE *argv, VALUE self)
2748
2685
  {
2749
2686
  VALUE check_rootwidget;
2750
2687
 
@@ -2761,10 +2698,7 @@ lib_mainloop(argc, argv, self)
2761
2698
  }
2762
2699
 
2763
2700
  static VALUE
2764
- ip_mainloop(argc, argv, self)
2765
- int argc;
2766
- VALUE *argv;
2767
- VALUE self;
2701
+ ip_mainloop(int argc, VALUE *argv, VALUE self)
2768
2702
  {
2769
2703
  volatile VALUE ret;
2770
2704
  struct tcltkip *ptr = get_ip(self);
@@ -2787,9 +2721,9 @@ ip_mainloop(argc, argv, self)
2787
2721
 
2788
2722
 
2789
2723
  static VALUE
2790
- watchdog_evloop_launcher(check_rootwidget)
2791
- VALUE check_rootwidget;
2724
+ watchdog_evloop_launcher(void *arg)
2792
2725
  {
2726
+ VALUE check_rootwidget = (VALUE)arg;
2793
2727
  return lib_eventloop_launcher(RTEST(check_rootwidget), 0,
2794
2728
  (int*)NULL, (Tcl_Interp*)NULL);
2795
2729
  }
@@ -2797,8 +2731,7 @@ watchdog_evloop_launcher(check_rootwidget)
2797
2731
  #define EVLOOP_WAKEUP_CHANCE 3
2798
2732
 
2799
2733
  static VALUE
2800
- lib_watchdog_core(check_rootwidget)
2801
- VALUE check_rootwidget;
2734
+ lib_watchdog_core(VALUE check_rootwidget)
2802
2735
  {
2803
2736
  VALUE evloop;
2804
2737
  int prev_val = -1;
@@ -2854,8 +2787,7 @@ lib_watchdog_core(check_rootwidget)
2854
2787
  }
2855
2788
 
2856
2789
  VALUE
2857
- lib_watchdog_ensure(arg)
2858
- VALUE arg;
2790
+ lib_watchdog_ensure(VALUE arg)
2859
2791
  {
2860
2792
  eventloop_thread = Qnil; /* stop eventloops */
2861
2793
  #ifdef RUBY_USE_NATIVE_THREAD
@@ -2865,10 +2797,7 @@ lib_watchdog_ensure(arg)
2865
2797
  }
2866
2798
 
2867
2799
  static VALUE
2868
- lib_mainloop_watchdog(argc, argv, self)
2869
- int argc;
2870
- VALUE *argv;
2871
- VALUE self;
2800
+ lib_mainloop_watchdog(int argc, VALUE *argv, VALUE self)
2872
2801
  {
2873
2802
  VALUE check_rootwidget;
2874
2803
 
@@ -2890,10 +2819,7 @@ lib_mainloop_watchdog(argc, argv, self)
2890
2819
  }
2891
2820
 
2892
2821
  static VALUE
2893
- ip_mainloop_watchdog(argc, argv, self)
2894
- int argc;
2895
- VALUE *argv;
2896
- VALUE self;
2822
+ ip_mainloop_watchdog(int argc, VALUE *argv, VALUE self)
2897
2823
  {
2898
2824
  struct tcltkip *ptr = get_ip(self);
2899
2825
 
@@ -2923,16 +2849,14 @@ _thread_call_proc_arg_mark(struct thread_call_proc_arg *q)
2923
2849
  }
2924
2850
 
2925
2851
  static VALUE
2926
- _thread_call_proc_core(arg)
2927
- VALUE arg;
2852
+ _thread_call_proc_core(VALUE arg)
2928
2853
  {
2929
2854
  struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
2930
2855
  return rb_funcall(q->proc, ID_call, 0);
2931
2856
  }
2932
2857
 
2933
2858
  static VALUE
2934
- _thread_call_proc_ensure(arg)
2935
- VALUE arg;
2859
+ _thread_call_proc_ensure(VALUE arg)
2936
2860
  {
2937
2861
  struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
2938
2862
  *(q->done) = 1;
@@ -2940,8 +2864,7 @@ _thread_call_proc_ensure(arg)
2940
2864
  }
2941
2865
 
2942
2866
  static VALUE
2943
- _thread_call_proc(arg)
2944
- VALUE arg;
2867
+ _thread_call_proc(void *arg)
2945
2868
  {
2946
2869
  struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
2947
2870
 
@@ -2950,21 +2873,13 @@ _thread_call_proc(arg)
2950
2873
  }
2951
2874
 
2952
2875
  static VALUE
2953
- #ifdef HAVE_PROTOTYPES
2954
2876
  _thread_call_proc_value(VALUE th)
2955
- #else
2956
- _thread_call_proc_value(th)
2957
- VALUE th;
2958
- #endif
2959
2877
  {
2960
2878
  return rb_funcall(th, ID_value, 0);
2961
2879
  }
2962
2880
 
2963
2881
  static VALUE
2964
- lib_thread_callback(argc, argv, self)
2965
- int argc;
2966
- VALUE *argv;
2967
- VALUE self;
2882
+ lib_thread_callback(int argc, VALUE *argv, VALUE self)
2968
2883
  {
2969
2884
  struct thread_call_proc_arg *q;
2970
2885
  VALUE proc, th, ret;
@@ -3020,11 +2935,7 @@ lib_thread_callback(argc, argv, self)
3020
2935
 
3021
2936
  /* do_one_event */
3022
2937
  static VALUE
3023
- lib_do_one_event_core(argc, argv, self, is_ip)
3024
- int argc;
3025
- VALUE *argv;
3026
- VALUE self;
3027
- int is_ip;
2938
+ lib_do_one_event_core(int argc, VALUE *argv, VALUE self, int is_ip)
3028
2939
  {
3029
2940
  VALUE vflags;
3030
2941
  int flags;
@@ -3073,28 +2984,20 @@ lib_do_one_event_core(argc, argv, self, is_ip)
3073
2984
  }
3074
2985
 
3075
2986
  static VALUE
3076
- lib_do_one_event(argc, argv, self)
3077
- int argc;
3078
- VALUE *argv;
3079
- VALUE self;
2987
+ lib_do_one_event(int argc, VALUE *argv, VALUE self)
3080
2988
  {
3081
2989
  return lib_do_one_event_core(argc, argv, self, 0);
3082
2990
  }
3083
2991
 
3084
2992
  static VALUE
3085
- ip_do_one_event(argc, argv, self)
3086
- int argc;
3087
- VALUE *argv;
3088
- VALUE self;
2993
+ ip_do_one_event(int argc, VALUE *argv, VALUE self)
3089
2994
  {
3090
2995
  return lib_do_one_event_core(argc, argv, self, 0);
3091
2996
  }
3092
2997
 
3093
2998
 
3094
2999
  static void
3095
- ip_set_exc_message(interp, exc)
3096
- Tcl_Interp *interp;
3097
- VALUE exc;
3000
+ ip_set_exc_message(Tcl_Interp *interp, VALUE exc)
3098
3001
  {
3099
3002
  char *buf;
3100
3003
  Tcl_DString dstr;
@@ -3155,8 +3058,7 @@ ip_set_exc_message(interp, exc)
3155
3058
  }
3156
3059
 
3157
3060
  static VALUE
3158
- TkStringValue(obj)
3159
- VALUE obj;
3061
+ TkStringValue(VALUE obj)
3160
3062
  {
3161
3063
  switch(TYPE(obj)) {
3162
3064
  case T_STRING:
@@ -3184,14 +3086,7 @@ TkStringValue(obj)
3184
3086
  }
3185
3087
 
3186
3088
  static int
3187
- #ifdef HAVE_PROTOTYPES
3188
- tcl_protect_core(Tcl_Interp *interp, VALUE (*proc)(VALUE), VALUE data)
3189
- #else
3190
- tcl_protect_core(interp, proc, data) /* should not raise exception */
3191
- Tcl_Interp *interp;
3192
- VALUE (*proc)();
3193
- VALUE data;
3194
- #endif
3089
+ tcl_protect_core(Tcl_Interp *interp, VALUE (*proc)(VALUE), VALUE data) /* should not raise exception */
3195
3090
  {
3196
3091
  volatile VALUE ret, exc = Qnil;
3197
3092
  int status = 0;
@@ -3363,10 +3258,7 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */
3363
3258
  }
3364
3259
 
3365
3260
  static int
3366
- tcl_protect(interp, proc, data)
3367
- Tcl_Interp *interp;
3368
- VALUE (*proc)();
3369
- VALUE data;
3261
+ tcl_protect(Tcl_Interp *interp, VALUE (*proc)(VALUE), VALUE data)
3370
3262
  {
3371
3263
  int code;
3372
3264
 
@@ -3393,19 +3285,16 @@ tcl_protect(interp, proc, data)
3393
3285
  }
3394
3286
 
3395
3287
  static int
3288
+ ip_ruby_eval(
3289
+ ClientData clientData,
3290
+ Tcl_Interp *interp,
3291
+ int argc,
3396
3292
  #if TCL_MAJOR_VERSION >= 8
3397
- ip_ruby_eval(clientData, interp, argc, argv)
3398
- ClientData clientData;
3399
- Tcl_Interp *interp;
3400
- int argc;
3401
- Tcl_Obj *CONST argv[];
3293
+ Tcl_Obj *CONST argv[]
3402
3294
  #else /* TCL_MAJOR_VERSION < 8 */
3403
- ip_ruby_eval(clientData, interp, argc, argv)
3404
- ClientData clientData;
3405
- Tcl_Interp *interp;
3406
- int argc;
3407
- char *argv[];
3295
+ char *argv[]
3408
3296
  #endif
3297
+ )
3409
3298
  {
3410
3299
  char *arg;
3411
3300
  int thr_crit_bup;
@@ -3438,7 +3327,7 @@ ip_ruby_eval(clientData, interp, argc, argv)
3438
3327
  #if TCL_MAJOR_VERSION >= 8
3439
3328
  {
3440
3329
  char *str;
3441
- int len;
3330
+ TYPE_TCL_SIZE len;
3442
3331
 
3443
3332
  thr_crit_bup = rb_thread_critical;
3444
3333
  rb_thread_critical = Qtrue;
@@ -3459,7 +3348,7 @@ ip_ruby_eval(clientData, interp, argc, argv)
3459
3348
  /* evaluate the argument string by ruby */
3460
3349
  DUMP2("rb_eval_string(%s)", arg);
3461
3350
 
3462
- code = tcl_protect(interp, rb_eval_string, (VALUE)arg);
3351
+ code = tcl_protect(interp, (VALUE (*)(VALUE))rb_eval_string, (VALUE)arg);
3463
3352
 
3464
3353
  #if TCL_MAJOR_VERSION >= 8
3465
3354
  xfree(arg);
@@ -3472,11 +3361,11 @@ ip_ruby_eval(clientData, interp, argc, argv)
3472
3361
 
3473
3362
  /* Tcl command `ruby_cmd' */
3474
3363
  static VALUE
3475
- ip_ruby_cmd_core(arg)
3476
- struct cmd_body_arg *arg;
3364
+ ip_ruby_cmd_core(VALUE varg)
3477
3365
  {
3478
3366
  volatile VALUE ret;
3479
3367
  int thr_crit_bup;
3368
+ struct cmd_body_arg *arg = (struct cmd_body_arg *)varg;
3480
3369
 
3481
3370
  DUMP1("call ip_ruby_cmd_core");
3482
3371
  thr_crit_bup = rb_thread_critical;
@@ -3490,15 +3379,14 @@ ip_ruby_cmd_core(arg)
3490
3379
  }
3491
3380
 
3492
3381
  static VALUE
3493
- ip_ruby_cmd_receiver_const_get(name)
3494
- char *name;
3382
+ ip_ruby_cmd_receiver_const_get(VALUE vname)
3495
3383
  {
3384
+ char *name = (char *)vname;
3496
3385
  return rb_path2class(name);
3497
3386
  }
3498
3387
 
3499
3388
  static VALUE
3500
- ip_ruby_cmd_receiver_get(str)
3501
- char *str;
3389
+ ip_ruby_cmd_receiver_get(char *str)
3502
3390
  {
3503
3391
  volatile VALUE receiver;
3504
3392
  int state;
@@ -3531,26 +3419,23 @@ ip_ruby_cmd_receiver_get(str)
3531
3419
 
3532
3420
  /* ruby_cmd receiver method arg ... */
3533
3421
  static int
3422
+ ip_ruby_cmd(
3423
+ ClientData clientData,
3424
+ Tcl_Interp *interp,
3425
+ int argc,
3534
3426
  #if TCL_MAJOR_VERSION >= 8
3535
- ip_ruby_cmd(clientData, interp, argc, argv)
3536
- ClientData clientData;
3537
- Tcl_Interp *interp;
3538
- int argc;
3539
- Tcl_Obj *CONST argv[];
3427
+ Tcl_Obj *CONST argv[]
3540
3428
  #else /* TCL_MAJOR_VERSION < 8 */
3541
- ip_ruby_cmd(clientData, interp, argc, argv)
3542
- ClientData clientData;
3543
- Tcl_Interp *interp;
3544
- int argc;
3545
- char *argv[];
3429
+ char *argv[]
3546
3430
  #endif
3431
+ )
3547
3432
  {
3548
3433
  volatile VALUE receiver;
3549
3434
  volatile ID method;
3550
3435
  volatile VALUE args;
3551
3436
  char *str;
3552
3437
  int i;
3553
- int len;
3438
+ TYPE_TCL_SIZE len;
3554
3439
  struct cmd_body_arg *arg;
3555
3440
  int thr_crit_bup;
3556
3441
  VALUE old_gc;
@@ -3651,29 +3536,16 @@ ip_ruby_cmd(clientData, interp, argc, argv)
3651
3536
  /* relpace of 'exit' command */
3652
3537
  /*****************************/
3653
3538
  static int
3539
+ ip_InterpExitObjCmd(
3540
+ ClientData clientData,
3541
+ Tcl_Interp *interp,
3542
+ int argc,
3654
3543
  #if TCL_MAJOR_VERSION >= 8
3655
- #ifdef HAVE_PROTOTYPES
3656
- ip_InterpExitObjCmd(ClientData clientData, Tcl_Interp *interp,
3657
- int argc, Tcl_Obj *CONST argv[])
3544
+ Tcl_Obj *CONST argv[]
3658
3545
  #else
3659
- ip_InterpExitObjCmd(clientData, interp, argc, argv)
3660
- ClientData clientData;
3661
- Tcl_Interp *interp;
3662
- int argc;
3663
- Tcl_Obj *CONST argv[];
3664
- #endif
3665
- #else /* TCL_MAJOR_VERSION < 8 */
3666
- #ifdef HAVE_PROTOTYPES
3667
- ip_InterpExitCommand(ClientData clientData, Tcl_Interp *interp,
3668
- int argc, char *argv[])
3669
- #else
3670
- ip_InterpExitCommand(clientData, interp, argc, argv)
3671
- ClientData clientData;
3672
- Tcl_Interp *interp;
3673
- int argc;
3674
- char *argv[];
3675
- #endif
3546
+ char *argv[]
3676
3547
  #endif
3548
+ )
3677
3549
  {
3678
3550
  DUMP1("start ip_InterpExitCommand");
3679
3551
  if (interp != (Tcl_Interp*)NULL
@@ -3696,29 +3568,16 @@ ip_InterpExitCommand(clientData, interp, argc, argv)
3696
3568
  }
3697
3569
 
3698
3570
  static int
3571
+ ip_RubyExitObjCmd(
3572
+ ClientData clientData,
3573
+ Tcl_Interp *interp,
3574
+ int argc,
3699
3575
  #if TCL_MAJOR_VERSION >= 8
3700
- #ifdef HAVE_PROTOTYPES
3701
- ip_RubyExitObjCmd(ClientData clientData, Tcl_Interp *interp,
3702
- int argc, Tcl_Obj *CONST argv[])
3703
- #else
3704
- ip_RubyExitObjCmd(clientData, interp, argc, argv)
3705
- ClientData clientData;
3706
- Tcl_Interp *interp;
3707
- int argc;
3708
- Tcl_Obj *CONST argv[];
3709
- #endif
3576
+ Tcl_Obj *CONST argv[]
3710
3577
  #else /* TCL_MAJOR_VERSION < 8 */
3711
- #ifdef HAVE_PROTOTYPES
3712
- ip_RubyExitCommand(ClientData clientData, Tcl_Interp *interp,
3713
- int argc, char *argv[])
3714
- #else
3715
- ip_RubyExitCommand(clientData, interp, argc, argv)
3716
- ClientData clientData;
3717
- Tcl_Interp *interp;
3718
- int argc;
3719
- char *argv[];
3720
- #endif
3578
+ char *argv[]
3721
3579
  #endif
3580
+ )
3722
3581
  {
3723
3582
  int state;
3724
3583
  char *cmd, *param;
@@ -3731,7 +3590,7 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
3731
3590
 
3732
3591
  #if TCL_MAJOR_VERSION >= 8
3733
3592
  /* cmd = Tcl_GetString(argv[0]); */
3734
- cmd = Tcl_GetStringFromObj(argv[0], (int*)NULL);
3593
+ cmd = Tcl_GetStringFromObj(argv[0], (TYPE_TCL_SIZE*)NULL);
3735
3594
  #endif
3736
3595
 
3737
3596
  if (argc < 1 || argc > 2) {
@@ -3774,7 +3633,7 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
3774
3633
  return TCL_ERROR;
3775
3634
  }
3776
3635
  /* param = Tcl_GetString(argv[1]); */
3777
- param = Tcl_GetStringFromObj(argv[1], (int*)NULL);
3636
+ param = Tcl_GetStringFromObj(argv[1], (TYPE_TCL_SIZE*)NULL);
3778
3637
  #else /* TCL_MAJOR_VERSION < 8 */
3779
3638
  state = (int)strtol(argv[1], &endptr, 0);
3780
3639
  if (*endptr) {
@@ -3813,24 +3672,17 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
3813
3672
  /*********************/
3814
3673
  /* replace of update */
3815
3674
  /*********************/
3816
- #if TCL_MAJOR_VERSION >= 8
3817
- static int ip_rbUpdateObjCmd _((ClientData, Tcl_Interp *, int,
3818
- Tcl_Obj *CONST []));
3819
3675
  static int
3820
- ip_rbUpdateObjCmd(clientData, interp, objc, objv)
3821
- ClientData clientData;
3822
- Tcl_Interp *interp;
3823
- int objc;
3824
- Tcl_Obj *CONST objv[];
3676
+ ip_rbUpdateObjCmd(
3677
+ ClientData clientData,
3678
+ Tcl_Interp *interp,
3679
+ int objc,
3680
+ #if TCL_MAJOR_VERSION >= 8
3681
+ Tcl_Obj *CONST objv[]
3825
3682
  #else /* TCL_MAJOR_VERSION < 8 */
3826
- static int ip_rbUpdateCommand _((ClientData, Tcl_Interp *, int, char *[]));
3827
- static int
3828
- ip_rbUpdateCommand(clientData, interp, objc, objv)
3829
- ClientData clientData;
3830
- Tcl_Interp *interp;
3831
- int objc;
3832
- char *objv[];
3683
+ char *objv[]
3833
3684
  #endif
3685
+ )
3834
3686
  {
3835
3687
  int flags = 0;
3836
3688
  static CONST char *updateOptions[] = {"idletasks", (char *) NULL};
@@ -3884,7 +3736,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv)
3884
3736
  Tcl_WrongNumArgs(interp, 1, objv, "[ idletasks ]");
3885
3737
  #else
3886
3738
  # if TCL_MAJOR_VERSION >= 8
3887
- int dummy;
3739
+ TYPE_TCL_SIZE dummy;
3888
3740
  Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
3889
3741
  Tcl_GetStringFromObj(objv[0], &dummy),
3890
3742
  " [ idletasks ]\"",
@@ -3947,10 +3799,10 @@ struct th_update_param {
3947
3799
  int done;
3948
3800
  };
3949
3801
 
3950
- static void rb_threadUpdateProc _((ClientData));
3951
3802
  static void
3952
- rb_threadUpdateProc(clientData)
3953
- ClientData clientData; /* Pointer to integer to set to 1. */
3803
+ rb_threadUpdateProc(
3804
+ ClientData clientData /* Pointer to integer to set to 1. */
3805
+ )
3954
3806
  {
3955
3807
  struct th_update_param *param = (struct th_update_param *) clientData;
3956
3808
 
@@ -3961,25 +3813,17 @@ rb_threadUpdateProc(clientData)
3961
3813
  return;
3962
3814
  }
3963
3815
 
3964
- #if TCL_MAJOR_VERSION >= 8
3965
- static int ip_rb_threadUpdateObjCmd _((ClientData, Tcl_Interp *, int,
3966
- Tcl_Obj *CONST []));
3967
3816
  static int
3968
- ip_rb_threadUpdateObjCmd(clientData, interp, objc, objv)
3969
- ClientData clientData;
3970
- Tcl_Interp *interp;
3971
- int objc;
3972
- Tcl_Obj *CONST objv[];
3817
+ ip_rb_threadUpdateObjCmd(
3818
+ ClientData clientData,
3819
+ Tcl_Interp *interp,
3820
+ int objc,
3821
+ #if TCL_MAJOR_VERSION >= 8
3822
+ Tcl_Obj *CONST objv[]
3973
3823
  #else /* TCL_MAJOR_VERSION < 8 */
3974
- static int ip_rb_threadUpdateCommand _((ClientData, Tcl_Interp *, int,
3975
- char *[]));
3976
- static int
3977
- ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
3978
- ClientData clientData;
3979
- Tcl_Interp *interp;
3980
- int objc;
3981
- char *objv[];
3824
+ char *objv[]
3982
3825
  #endif
3826
+ )
3983
3827
  {
3984
3828
  # if 0
3985
3829
  int flags = 0;
@@ -4056,7 +3900,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
4056
3900
  Tcl_WrongNumArgs(interp, 1, objv, "[ idletasks ]");
4057
3901
  #else
4058
3902
  # if TCL_MAJOR_VERSION >= 8
4059
- int dummy;
3903
+ TYPE_TCL_SIZE dummy;
4060
3904
  Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
4061
3905
  Tcl_GetStringFromObj(objv[0], &dummy),
4062
3906
  " [ idletasks ]\"",
@@ -4115,43 +3959,36 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
4115
3959
  /* replace of vwait/tkwait */
4116
3960
  /***************************/
4117
3961
  #if TCL_MAJOR_VERSION >= 8
4118
- static int ip_rbVwaitObjCmd _((ClientData, Tcl_Interp *, int,
4119
- Tcl_Obj *CONST []));
4120
- static int ip_rb_threadVwaitObjCmd _((ClientData, Tcl_Interp *, int,
4121
- Tcl_Obj *CONST []));
4122
- static int ip_rbTkWaitObjCmd _((ClientData, Tcl_Interp *, int,
4123
- Tcl_Obj *CONST []));
4124
- static int ip_rb_threadTkWaitObjCmd _((ClientData, Tcl_Interp *, int,
4125
- Tcl_Obj *CONST []));
4126
- #else
4127
- static int ip_rbVwaitCommand _((ClientData, Tcl_Interp *, int, char *[]));
4128
- static int ip_rb_threadVwaitCommand _((ClientData, Tcl_Interp *, int,
4129
- char *[]));
4130
- static int ip_rbTkWaitCommand _((ClientData, Tcl_Interp *, int, char *[]));
4131
- static int ip_rb_threadTkWaitCommand _((ClientData, Tcl_Interp *, int,
4132
- char *[]));
3962
+ static int ip_rbVwaitObjCmd (ClientData, Tcl_Interp *, int,
3963
+ Tcl_Obj *CONST []);
3964
+ static int ip_rb_threadVwaitObjCmd (ClientData, Tcl_Interp *, int,
3965
+ Tcl_Obj *CONST []);
3966
+ static int ip_rbTkWaitObjCmd (ClientData, Tcl_Interp *, int,
3967
+ Tcl_Obj *CONST []);
3968
+ static int ip_rb_threadTkWaitObjCmd (ClientData, Tcl_Interp *, int,
3969
+ Tcl_Obj *CONST []);
3970
+ #else
3971
+ static int ip_rbVwaitCommand (ClientData, Tcl_Interp *, int, char *[]);
3972
+ static int ip_rb_threadVwaitCommand (ClientData, Tcl_Interp *, int,
3973
+ char *[]);
3974
+ static int ip_rbTkWaitCommand (ClientData, Tcl_Interp *, int, char *[]);
3975
+ static int ip_rb_threadTkWaitCommand (ClientData, Tcl_Interp *, int,
3976
+ char *[]);
4133
3977
  #endif
4134
3978
 
4135
- #if TCL_MAJOR_VERSION >= 8
4136
- static char *VwaitVarProc _((ClientData, Tcl_Interp *,
4137
- CONST84 char *,CONST84 char *, int));
4138
3979
  static char *
4139
- VwaitVarProc(clientData, interp, name1, name2, flags)
4140
- ClientData clientData; /* Pointer to integer to set to 1. */
4141
- Tcl_Interp *interp; /* Interpreter containing variable. */
4142
- CONST84 char *name1; /* Name of variable. */
4143
- CONST84 char *name2; /* Second part of variable name. */
4144
- int flags; /* Information about what happened. */
4145
- #else /* TCL_MAJOR_VERSION < 8 */
4146
- static char *VwaitVarProc _((ClientData, Tcl_Interp *, char *, char *, int));
4147
- static char *
4148
- VwaitVarProc(clientData, interp, name1, name2, flags)
4149
- ClientData clientData; /* Pointer to integer to set to 1. */
4150
- Tcl_Interp *interp; /* Interpreter containing variable. */
4151
- char *name1; /* Name of variable. */
4152
- char *name2; /* Second part of variable name. */
4153
- int flags; /* Information about what happened. */
3980
+ VwaitVarProc(
3981
+ ClientData clientData, /* Pointer to integer to set to 1. */
3982
+ Tcl_Interp *interp, /* Interpreter containing variable. */
3983
+ #if TCL_MAJOR_VERSION >= 8
3984
+ CONST84 char *name1, /* Name of variable. */
3985
+ CONST84 char *name2, /* Second part of variable name. */
3986
+ #else
3987
+ char *name1, /* Name of variable. */
3988
+ char *name2, /* Second part of variable name. */
4154
3989
  #endif
3990
+ int flags /* Information about what happened. */
3991
+ )
4155
3992
  {
4156
3993
  int *donePtr = (int *) clientData;
4157
3994
 
@@ -4159,25 +3996,21 @@ VwaitVarProc(clientData, interp, name1, name2, flags)
4159
3996
  return (char *) NULL;
4160
3997
  }
4161
3998
 
4162
- #if TCL_MAJOR_VERSION >= 8
4163
3999
  static int
4164
- ip_rbVwaitObjCmd(clientData, interp, objc, objv)
4165
- ClientData clientData; /* Not used */
4166
- Tcl_Interp *interp;
4167
- int objc;
4168
- Tcl_Obj *CONST objv[];
4000
+ ip_rbVwaitObjCmd(
4001
+ ClientData clientData, /* Not used */
4002
+ Tcl_Interp *interp,
4003
+ int objc,
4004
+ #if TCL_MAJOR_VERSION >= 8
4005
+ Tcl_Obj *CONST objv[]
4169
4006
  #else /* TCL_MAJOR_VERSION < 8 */
4170
- static int
4171
- ip_rbVwaitCommand(clientData, interp, objc, objv)
4172
- ClientData clientData; /* Not used */
4173
- Tcl_Interp *interp;
4174
- int objc;
4175
- char *objv[];
4007
+ char *objv[]
4176
4008
  #endif
4009
+ )
4177
4010
  {
4178
4011
  int ret, done, foundEvent;
4179
4012
  char *nameString;
4180
- int dummy;
4013
+ TYPE_TCL_SIZE dummy;
4181
4014
  int thr_crit_bup;
4182
4015
 
4183
4016
  DUMP1("Ruby's 'vwait' is called");
@@ -4342,27 +4175,19 @@ ip_rbVwaitCommand(clientData, interp, objc, objv)
4342
4175
  /**************************/
4343
4176
  /* based on tkCmd.c */
4344
4177
  /**************************/
4345
- #if TCL_MAJOR_VERSION >= 8
4346
- static char *WaitVariableProc _((ClientData, Tcl_Interp *,
4347
- CONST84 char *,CONST84 char *, int));
4348
4178
  static char *
4349
- WaitVariableProc(clientData, interp, name1, name2, flags)
4350
- ClientData clientData; /* Pointer to integer to set to 1. */
4351
- Tcl_Interp *interp; /* Interpreter containing variable. */
4352
- CONST84 char *name1; /* Name of variable. */
4353
- CONST84 char *name2; /* Second part of variable name. */
4354
- int flags; /* Information about what happened. */
4179
+ WaitVariableProc(
4180
+ ClientData clientData, /* Pointer to integer to set to 1. */
4181
+ Tcl_Interp *interp, /* Interpreter containing variable. */
4182
+ #if TCL_MAJOR_VERSION >= 8
4183
+ CONST84 char *name1, /* Name of variable. */
4184
+ CONST84 char *name2, /* Second part of variable name. */
4355
4185
  #else /* TCL_MAJOR_VERSION < 8 */
4356
- static char *WaitVariableProc _((ClientData, Tcl_Interp *,
4357
- char *, char *, int));
4358
- static char *
4359
- WaitVariableProc(clientData, interp, name1, name2, flags)
4360
- ClientData clientData; /* Pointer to integer to set to 1. */
4361
- Tcl_Interp *interp; /* Interpreter containing variable. */
4362
- char *name1; /* Name of variable. */
4363
- char *name2; /* Second part of variable name. */
4364
- int flags; /* Information about what happened. */
4186
+ char *name1, /* Name of variable. */
4187
+ char *name2, /* Second part of variable name. */
4365
4188
  #endif
4189
+ int flags /* Information about what happened. */
4190
+ )
4366
4191
  {
4367
4192
  int *donePtr = (int *) clientData;
4368
4193
 
@@ -4370,11 +4195,11 @@ WaitVariableProc(clientData, interp, name1, name2, flags)
4370
4195
  return (char *) NULL;
4371
4196
  }
4372
4197
 
4373
- static void WaitVisibilityProc _((ClientData, XEvent *));
4374
4198
  static void
4375
- WaitVisibilityProc(clientData, eventPtr)
4376
- ClientData clientData; /* Pointer to integer to set to 1. */
4377
- XEvent *eventPtr; /* Information about event (not used). */
4199
+ WaitVisibilityProc(
4200
+ ClientData clientData, /* Pointer to integer to set to 1. */
4201
+ XEvent *eventPtr /* Information about event (not used). */
4202
+ )
4378
4203
  {
4379
4204
  int *donePtr = (int *) clientData;
4380
4205
 
@@ -4386,11 +4211,11 @@ WaitVisibilityProc(clientData, eventPtr)
4386
4211
  }
4387
4212
  }
4388
4213
 
4389
- static void WaitWindowProc _((ClientData, XEvent *));
4390
4214
  static void
4391
- WaitWindowProc(clientData, eventPtr)
4392
- ClientData clientData; /* Pointer to integer to set to 1. */
4393
- XEvent *eventPtr; /* Information about event. */
4215
+ WaitWindowProc(
4216
+ ClientData clientData, /* Pointer to integer to set to 1. */
4217
+ XEvent *eventPtr /* Information about event. */
4218
+ )
4394
4219
  {
4395
4220
  int *donePtr = (int *) clientData;
4396
4221
 
@@ -4399,21 +4224,17 @@ WaitWindowProc(clientData, eventPtr)
4399
4224
  }
4400
4225
  }
4401
4226
 
4402
- #if TCL_MAJOR_VERSION >= 8
4403
4227
  static int
4404
- ip_rbTkWaitObjCmd(clientData, interp, objc, objv)
4405
- ClientData clientData;
4406
- Tcl_Interp *interp;
4407
- int objc;
4408
- Tcl_Obj *CONST objv[];
4228
+ ip_rbTkWaitObjCmd(
4229
+ ClientData clientData,
4230
+ Tcl_Interp *interp,
4231
+ int objc,
4232
+ #if TCL_MAJOR_VERSION >= 8
4233
+ Tcl_Obj *CONST objv[]
4409
4234
  #else /* TCL_MAJOR_VERSION < 8 */
4410
- static int
4411
- ip_rbTkWaitCommand(clientData, interp, objc, objv)
4412
- ClientData clientData;
4413
- Tcl_Interp *interp;
4414
- int objc;
4415
- char *objv[];
4235
+ char *objv[]
4416
4236
  #endif
4237
+ )
4417
4238
  {
4418
4239
  Tk_Window tkwin = (Tk_Window) clientData;
4419
4240
  Tk_Window window;
@@ -4422,7 +4243,8 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv)
4422
4243
  (char *) NULL };
4423
4244
  enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
4424
4245
  char *nameString;
4425
- int ret, dummy;
4246
+ int ret;
4247
+ TYPE_TCL_SIZE dummy;
4426
4248
  int thr_crit_bup;
4427
4249
 
4428
4250
  DUMP1("Ruby's 'tkwait' is called");
@@ -4775,31 +4597,23 @@ struct th_vwait_param {
4775
4597
  int done;
4776
4598
  };
4777
4599
 
4778
- #if TCL_MAJOR_VERSION >= 8
4779
- static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *,
4780
- CONST84 char *,CONST84 char *, int));
4781
4600
  static char *
4782
- rb_threadVwaitProc(clientData, interp, name1, name2, flags)
4783
- ClientData clientData; /* Pointer to integer to set to 1. */
4784
- Tcl_Interp *interp; /* Interpreter containing variable. */
4785
- CONST84 char *name1; /* Name of variable. */
4786
- CONST84 char *name2; /* Second part of variable name. */
4787
- int flags; /* Information about what happened. */
4601
+ rb_threadVwaitProc(
4602
+ ClientData clientData, /* Pointer to integer to set to 1. */
4603
+ Tcl_Interp *interp, /* Interpreter containing variable. */
4604
+ #if TCL_MAJOR_VERSION >= 8
4605
+ CONST84 char *name1, /* Name of variable. */
4606
+ CONST84 char *name2, /* Second part of variable name. */
4788
4607
  #else /* TCL_MAJOR_VERSION < 8 */
4789
- static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *,
4790
- char *, char *, int));
4791
- static char *
4792
- rb_threadVwaitProc(clientData, interp, name1, name2, flags)
4793
- ClientData clientData; /* Pointer to integer to set to 1. */
4794
- Tcl_Interp *interp; /* Interpreter containing variable. */
4795
- char *name1; /* Name of variable. */
4796
- char *name2; /* Second part of variable name. */
4797
- int flags; /* Information about what happened. */
4608
+ char *name1, /* Name of variable. */
4609
+ char *name2, /* Second part of variable name. */
4798
4610
  #endif
4611
+ int flags /* Information about what happened. */
4612
+ )
4799
4613
  {
4800
4614
  struct th_vwait_param *param = (struct th_vwait_param *) clientData;
4801
4615
 
4802
- if (flags & (TCL_INTERP_DESTROYED | TCL_TRACE_DESTROYED)) {
4616
+ if ((flags & TCL_TRACE_DESTROYED) || Tcl_InterpDeleted(interp)) {
4803
4617
  param->done = -1;
4804
4618
  } else {
4805
4619
  param->done = 1;
@@ -4812,11 +4626,11 @@ rb_threadVwaitProc(clientData, interp, name1, name2, flags)
4812
4626
  #define TKWAIT_MODE_VISIBILITY 1
4813
4627
  #define TKWAIT_MODE_DESTROY 2
4814
4628
 
4815
- static void rb_threadWaitVisibilityProc _((ClientData, XEvent *));
4816
4629
  static void
4817
- rb_threadWaitVisibilityProc(clientData, eventPtr)
4818
- ClientData clientData; /* Pointer to integer to set to 1. */
4819
- XEvent *eventPtr; /* Information about event (not used). */
4630
+ rb_threadWaitVisibilityProc(
4631
+ ClientData clientData, /* Pointer to integer to set to 1. */
4632
+ XEvent *eventPtr /* Information about event (not used). */
4633
+ )
4820
4634
  {
4821
4635
  struct th_vwait_param *param = (struct th_vwait_param *) clientData;
4822
4636
 
@@ -4829,11 +4643,11 @@ rb_threadWaitVisibilityProc(clientData, eventPtr)
4829
4643
  if (param->done != 0) rb_thread_wakeup(param->thread);
4830
4644
  }
4831
4645
 
4832
- static void rb_threadWaitWindowProc _((ClientData, XEvent *));
4833
4646
  static void
4834
- rb_threadWaitWindowProc(clientData, eventPtr)
4835
- ClientData clientData; /* Pointer to integer to set to 1. */
4836
- XEvent *eventPtr; /* Information about event. */
4647
+ rb_threadWaitWindowProc(
4648
+ ClientData clientData, /* Pointer to integer to set to 1. */
4649
+ XEvent *eventPtr /* Information about event. */
4650
+ )
4837
4651
  {
4838
4652
  struct th_vwait_param *param = (struct th_vwait_param *) clientData;
4839
4653
 
@@ -4843,25 +4657,22 @@ rb_threadWaitWindowProc(clientData, eventPtr)
4843
4657
  if (param->done != 0) rb_thread_wakeup(param->thread);
4844
4658
  }
4845
4659
 
4846
- #if TCL_MAJOR_VERSION >= 8
4847
4660
  static int
4848
- ip_rb_threadVwaitObjCmd(clientData, interp, objc, objv)
4849
- ClientData clientData;
4850
- Tcl_Interp *interp;
4851
- int objc;
4852
- Tcl_Obj *CONST objv[];
4661
+ ip_rb_threadVwaitObjCmd(
4662
+ ClientData clientData,
4663
+ Tcl_Interp *interp,
4664
+ int objc,
4665
+ #if TCL_MAJOR_VERSION >= 8
4666
+ Tcl_Obj *CONST objv[]
4853
4667
  #else /* TCL_MAJOR_VERSION < 8 */
4854
- static int
4855
- ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
4856
- ClientData clientData; /* Not used */
4857
- Tcl_Interp *interp;
4858
- int objc;
4859
- char *objv[];
4668
+ char *objv[]
4860
4669
  #endif
4670
+ )
4861
4671
  {
4862
4672
  struct th_vwait_param *param;
4863
4673
  char *nameString;
4864
- int ret, dummy;
4674
+ int ret;
4675
+ TYPE_TCL_SIZE dummy;
4865
4676
  int thr_crit_bup;
4866
4677
  volatile VALUE current_thread = rb_thread_current();
4867
4678
  struct timeval t;
@@ -5000,21 +4811,17 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
5000
4811
  return TCL_OK;
5001
4812
  }
5002
4813
 
5003
- #if TCL_MAJOR_VERSION >= 8
5004
4814
  static int
5005
- ip_rb_threadTkWaitObjCmd(clientData, interp, objc, objv)
5006
- ClientData clientData;
5007
- Tcl_Interp *interp;
5008
- int objc;
5009
- Tcl_Obj *CONST objv[];
4815
+ ip_rb_threadTkWaitObjCmd(
4816
+ ClientData clientData,
4817
+ Tcl_Interp *interp,
4818
+ int objc,
4819
+ #if TCL_MAJOR_VERSION >= 8
4820
+ Tcl_Obj *CONST objv[]
5010
4821
  #else /* TCL_MAJOR_VERSION < 8 */
5011
- static int
5012
- ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
5013
- ClientData clientData;
5014
- Tcl_Interp *interp;
5015
- int objc;
5016
- char *objv[];
4822
+ char *objv[]
5017
4823
  #endif
4824
+ )
5018
4825
  {
5019
4826
  struct th_vwait_param *param;
5020
4827
  Tk_Window tkwin = (Tk_Window) clientData;
@@ -5024,7 +4831,8 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
5024
4831
  (char *) NULL };
5025
4832
  enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
5026
4833
  char *nameString;
5027
- int ret, dummy;
4834
+ int ret;
4835
+ TYPE_TCL_SIZE dummy;
5028
4836
  int thr_crit_bup;
5029
4837
  volatile VALUE current_thread = rb_thread_current();
5030
4838
  struct timeval t;
@@ -5442,9 +5250,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
5442
5250
  }
5443
5251
 
5444
5252
  static VALUE
5445
- ip_thread_vwait(self, var)
5446
- VALUE self;
5447
- VALUE var;
5253
+ ip_thread_vwait(VALUE self, VALUE var)
5448
5254
  {
5449
5255
  VALUE argv[2];
5450
5256
  volatile VALUE cmd_str = rb_str_new2("thread_vwait");
@@ -5456,10 +5262,7 @@ ip_thread_vwait(self, var)
5456
5262
  }
5457
5263
 
5458
5264
  static VALUE
5459
- ip_thread_tkwait(self, mode, target)
5460
- VALUE self;
5461
- VALUE mode;
5462
- VALUE target;
5265
+ ip_thread_tkwait(VALUE self, VALUE mode, VALUE target)
5463
5266
  {
5464
5267
  VALUE argv[3];
5465
5268
  volatile VALUE cmd_str = rb_str_new2("thread_tkwait");
@@ -5475,14 +5278,14 @@ ip_thread_tkwait(self, mode, target)
5475
5278
  /* delete slave interpreters */
5476
5279
  #if TCL_MAJOR_VERSION >= 8
5477
5280
  static void
5478
- delete_slaves(ip)
5479
- Tcl_Interp *ip;
5281
+ delete_slaves(Tcl_Interp *ip)
5480
5282
  {
5481
5283
  int thr_crit_bup;
5482
5284
  Tcl_Interp *slave;
5483
5285
  Tcl_Obj *slave_list, *elem;
5484
5286
  char *slave_name;
5485
- int i, len;
5287
+ int i;
5288
+ TYPE_TCL_SIZE len;
5486
5289
 
5487
5290
  DUMP1("delete slaves");
5488
5291
  thr_crit_bup = rb_thread_critical;
@@ -5502,7 +5305,7 @@ delete_slaves(ip)
5502
5305
 
5503
5306
  /* get slave */
5504
5307
  /* slave_name = Tcl_GetString(elem); */
5505
- slave_name = Tcl_GetStringFromObj(elem, (int*)NULL);
5308
+ slave_name = Tcl_GetStringFromObj(elem, (TYPE_TCL_SIZE*)NULL);
5506
5309
  DUMP2("delete slave:'%s'", slave_name);
5507
5310
 
5508
5311
  Tcl_DecrRefCount(elem);
@@ -5527,8 +5330,7 @@ delete_slaves(ip)
5527
5330
  }
5528
5331
  #else /* TCL_MAJOR_VERSION < 8 */
5529
5332
  static void
5530
- delete_slaves(ip)
5531
- Tcl_Interp *ip;
5333
+ delete_slaves(Tcl_Interp *ip)
5532
5334
  {
5533
5335
  int thr_crit_bup;
5534
5336
  Tcl_Interp *slave;
@@ -5571,38 +5373,17 @@ delete_slaves(ip)
5571
5373
 
5572
5374
  /* finalize operation */
5573
5375
  static void
5574
- #ifdef HAVE_PROTOTYPES
5575
5376
  lib_mark_at_exit(VALUE self)
5576
- #else
5577
- lib_mark_at_exit(self)
5578
- VALUE self;
5579
- #endif
5580
5377
  {
5581
5378
  at_exit = 1;
5582
5379
  }
5583
5380
 
5584
5381
  static int
5585
5382
  #if TCL_MAJOR_VERSION >= 8
5586
- #ifdef HAVE_PROTOTYPES
5587
5383
  ip_null_proc(ClientData clientData, Tcl_Interp *interp,
5588
5384
  int argc, Tcl_Obj *CONST argv[])
5589
- #else
5590
- ip_null_proc(clientData, interp, argc, argv)
5591
- ClientData clientData;
5592
- Tcl_Interp *interp;
5593
- int argc;
5594
- Tcl_Obj *CONST argv[];
5595
- #endif
5596
5385
  #else /* TCL_MAJOR_VERSION < 8 */
5597
- #ifdef HAVE_PROTOTYPES
5598
5386
  ip_null_proc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
5599
- #else
5600
- ip_null_proc(clientData, interp, argc, argv)
5601
- ClientData clientData;
5602
- Tcl_Interp *interp;
5603
- int argc;
5604
- char *argv[];
5605
- #endif
5606
5387
  #endif
5607
5388
  {
5608
5389
  Tcl_ResetResult(interp);
@@ -5610,8 +5391,7 @@ ip_null_proc(clientData, interp, argc, argv)
5610
5391
  }
5611
5392
 
5612
5393
  static void
5613
- ip_finalize(ip)
5614
- Tcl_Interp *ip;
5394
+ ip_finalize(Tcl_Interp *ip)
5615
5395
  {
5616
5396
  Tcl_CmdInfo info;
5617
5397
  int thr_crit_bup;
@@ -5752,8 +5532,7 @@ ip_finalize(ip)
5752
5532
 
5753
5533
  /* destroy interpreter */
5754
5534
  static void
5755
- ip_free(p)
5756
- void *p;
5535
+ ip_free(void *p)
5757
5536
  {
5758
5537
  struct tcltkip *ptr = p;
5759
5538
  int thr_crit_bup;
@@ -5804,18 +5583,15 @@ ip_free(p)
5804
5583
 
5805
5584
 
5806
5585
  /* create and initialize interpreter */
5807
- static VALUE ip_alloc _((VALUE));
5586
+ static VALUE ip_alloc (VALUE);
5808
5587
  static VALUE
5809
- ip_alloc(self)
5810
- VALUE self;
5588
+ ip_alloc(VALUE self)
5811
5589
  {
5812
5590
  return TypedData_Wrap_Struct(self, &tcltkip_type, 0);
5813
5591
  }
5814
5592
 
5815
5593
  static void
5816
- ip_replace_wait_commands(interp, mainWin)
5817
- Tcl_Interp *interp;
5818
- Tk_Window mainWin;
5594
+ ip_replace_wait_commands(Tcl_Interp *interp, Tk_Window mainWin)
5819
5595
  {
5820
5596
  /* replace 'vwait' command */
5821
5597
  #if TCL_MAJOR_VERSION >= 8
@@ -5885,21 +5661,17 @@ ip_replace_wait_commands(interp, mainWin)
5885
5661
  }
5886
5662
 
5887
5663
 
5888
- #if TCL_MAJOR_VERSION >= 8
5889
5664
  static int
5890
- ip_rb_replaceSlaveTkCmdsObjCmd(clientData, interp, objc, objv)
5891
- ClientData clientData;
5892
- Tcl_Interp *interp;
5893
- int objc;
5894
- Tcl_Obj *CONST objv[];
5665
+ ip_rb_replaceSlaveTkCmdsObjCmd(
5666
+ ClientData clientData,
5667
+ Tcl_Interp *interp,
5668
+ int objc,
5669
+ #if TCL_MAJOR_VERSION >= 8
5670
+ Tcl_Obj *CONST objv[]
5895
5671
  #else /* TCL_MAJOR_VERSION < 8 */
5896
- static int
5897
- ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
5898
- ClientData clientData;
5899
- Tcl_Interp *interp;
5900
- int objc;
5901
- char *objv[];
5672
+ char *objv[]
5902
5673
  #endif
5674
+ )
5903
5675
  {
5904
5676
  char *slave_name;
5905
5677
  Tcl_Interp *slave;
@@ -5911,7 +5683,7 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
5911
5683
  #else
5912
5684
  char *nameString;
5913
5685
  #if TCL_MAJOR_VERSION >= 8
5914
- nameString = Tcl_GetStringFromObj(objv[0], (int*)NULL);
5686
+ nameString = Tcl_GetStringFromObj(objv[0], (TYPE_TCL_SIZE*)NULL);
5915
5687
  #else /* TCL_MAJOR_VERSION < 8 */
5916
5688
  nameString = objv[0];
5917
5689
  #endif
@@ -5921,7 +5693,7 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
5921
5693
  }
5922
5694
 
5923
5695
  #if TCL_MAJOR_VERSION >= 8
5924
- slave_name = Tcl_GetStringFromObj(objv[1], (int*)NULL);
5696
+ slave_name = Tcl_GetStringFromObj(objv[1], (TYPE_TCL_SIZE*)NULL);
5925
5697
  #else
5926
5698
  slave_name = objv[1];
5927
5699
  #endif
@@ -5956,14 +5728,8 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
5956
5728
  #endif
5957
5729
 
5958
5730
  #if TCL_MAJOR_VERSION >= 8
5959
- static int ip_rbNamespaceObjCmd _((ClientData, Tcl_Interp *, int,
5960
- Tcl_Obj *CONST []));
5961
5731
  static int
5962
- ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
5963
- ClientData clientData;
5964
- Tcl_Interp *interp;
5965
- int objc;
5966
- Tcl_Obj *CONST objv[];
5732
+ ip_rbNamespaceObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
5967
5733
  {
5968
5734
  Tcl_CmdInfo info;
5969
5735
  int ret;
@@ -6021,7 +5787,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
6021
5787
 
6022
5788
  for(i = 0; i < objc; i++) {
6023
5789
  /* argv[i] = Tcl_GetString(objv[i]); */
6024
- argv[i] = Tcl_GetStringFromObj(objv[i], (int*)NULL);
5790
+ argv[i] = Tcl_GetStringFromObj(objv[i], (TYPE_TCL_SIZE*)NULL);
6025
5791
  }
6026
5792
  argv[objc] = (char *)NULL;
6027
5793
 
@@ -6049,8 +5815,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
6049
5815
  #endif
6050
5816
 
6051
5817
  static void
6052
- ip_wrap_namespace_command(interp)
6053
- Tcl_Interp *interp;
5818
+ ip_wrap_namespace_command(Tcl_Interp *interp)
6054
5819
  {
6055
5820
  #if TCL_MAJOR_VERSION >= 8
6056
5821
 
@@ -6084,13 +5849,7 @@ ip_wrap_namespace_command(interp)
6084
5849
 
6085
5850
  /* call when interpreter is deleted */
6086
5851
  static void
6087
- #ifdef HAVE_PROTOTYPES
6088
5852
  ip_CallWhenDeleted(ClientData clientData, Tcl_Interp *ip)
6089
- #else
6090
- ip_CallWhenDeleted(clientData, ip)
6091
- ClientData clientData;
6092
- Tcl_Interp *ip;
6093
- #endif
6094
5853
  {
6095
5854
  int thr_crit_bup;
6096
5855
  /* Tk_Window main_win = (Tk_Window) clientData; */
@@ -6109,10 +5868,7 @@ ip_CallWhenDeleted(clientData, ip)
6109
5868
 
6110
5869
  /* initialize interpreter */
6111
5870
  static VALUE
6112
- ip_init(argc, argv, self)
6113
- int argc;
6114
- VALUE *argv;
6115
- VALUE self;
5871
+ ip_init(int argc, VALUE *argv, VALUE self)
6116
5872
  {
6117
5873
  struct tcltkip *ptr; /* tcltkip data struct */
6118
5874
  VALUE argv0, opts;
@@ -6288,7 +6044,12 @@ ip_init(argc, argv, self)
6288
6044
  #endif
6289
6045
  /* get main window */
6290
6046
  mainWin = Tk_MainWindow(ptr->ip);
6291
- Tk_Preserve((ClientData)mainWin);
6047
+ #if TCL_MAJOR_VERSION >= 9
6048
+ # define TCL_PRESERVE_FUNCTION Tcl_Preserve
6049
+ #else
6050
+ # define TCL_PRESERVE_FUNCTION Tk_Preserve
6051
+ #endif
6052
+ TCL_PRESERVE_FUNCTION((ClientData)mainWin);
6292
6053
  }
6293
6054
 
6294
6055
  /* add ruby command to the interpreter */
@@ -6358,17 +6119,19 @@ ip_init(argc, argv, self)
6358
6119
  Tcl_CallWhenDeleted(ptr->ip, ip_CallWhenDeleted, (ClientData)mainWin);
6359
6120
 
6360
6121
  if (mainWin != (Tk_Window)NULL) {
6361
- Tk_Release((ClientData)mainWin);
6122
+ #if TCL_MAJOR_VERSION >= 9
6123
+ # define TCL_RELEASE_FUNCTION Tcl_Release
6124
+ #else
6125
+ # define TCL_RELEASE_FUNCTION Tk_Release
6126
+ #endif
6127
+ TCL_RELEASE_FUNCTION((ClientData)mainWin);
6362
6128
  }
6363
6129
 
6364
6130
  return self;
6365
6131
  }
6366
6132
 
6367
6133
  static VALUE
6368
- ip_create_slave_core(interp, argc, argv)
6369
- VALUE interp;
6370
- int argc;
6371
- VALUE *argv;
6134
+ ip_create_slave_core(VALUE interp, int argc, VALUE *argv)
6372
6135
  {
6373
6136
  struct tcltkip *master = get_ip(interp);
6374
6137
  struct tcltkip *slave;
@@ -6479,10 +6242,7 @@ ip_create_slave_core(interp, argc, argv)
6479
6242
  }
6480
6243
 
6481
6244
  static VALUE
6482
- ip_create_slave(argc, argv, self)
6483
- int argc;
6484
- VALUE *argv;
6485
- VALUE self;
6245
+ ip_create_slave(int argc, VALUE *argv, VALUE self)
6486
6246
  {
6487
6247
  struct tcltkip *master = get_ip(self);
6488
6248
  VALUE safemode;
@@ -6513,8 +6273,7 @@ ip_create_slave(argc, argv, self)
6513
6273
 
6514
6274
  /* self is slave of master? */
6515
6275
  static VALUE
6516
- ip_is_slave_of_p(self, master)
6517
- VALUE self, master;
6276
+ ip_is_slave_of_p(VALUE self, VALUE master)
6518
6277
  {
6519
6278
  if (!rb_obj_is_kind_of(master, tcltkip_class)) {
6520
6279
  rb_raise(rb_eArgError, "expected TclTkIp object");
@@ -6536,21 +6295,18 @@ ip_is_slave_of_p(self, master)
6536
6295
  && (TCL_RELEASE_LEVEL == TCL_ALPHA_RELEASE \
6537
6296
  || (TCL_RELEASE_LEVEL == TCL_BETA_RELEASE \
6538
6297
  && TCL_RELEASE_SERIAL < 2) ) )
6539
- EXTERN void TkConsoleCreate _((void));
6298
+ EXTERN void TkConsoleCreate (void);
6540
6299
  #endif
6541
6300
  #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 \
6542
6301
  && ( (TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE \
6543
6302
  && TCL_RELEASE_SERIAL == 0) \
6544
6303
  || (TCL_RELEASE_LEVEL == TCL_BETA_RELEASE \
6545
6304
  && TCL_RELEASE_SERIAL >= 2) )
6546
- EXTERN void TkConsoleCreate_ _((void));
6305
+ EXTERN void TkConsoleCreate_ (void);
6547
6306
  #endif
6548
6307
  #endif
6549
6308
  static VALUE
6550
- ip_create_console_core(interp, argc, argv)
6551
- VALUE interp;
6552
- int argc; /* dummy */
6553
- VALUE *argv; /* dummy */
6309
+ ip_create_console_core(VALUE interp, int argc /* dummy */, VALUE *argv /* dummy */)
6554
6310
  {
6555
6311
  struct tcltkip *ptr = get_ip(interp);
6556
6312
 
@@ -6595,8 +6351,7 @@ ip_create_console_core(interp, argc, argv)
6595
6351
  }
6596
6352
 
6597
6353
  static VALUE
6598
- ip_create_console(self)
6599
- VALUE self;
6354
+ ip_create_console(VALUE self)
6600
6355
  {
6601
6356
  struct tcltkip *ptr = get_ip(self);
6602
6357
 
@@ -6610,10 +6365,7 @@ ip_create_console(self)
6610
6365
 
6611
6366
  /* make ip "safe" */
6612
6367
  static VALUE
6613
- ip_make_safe_core(interp, argc, argv)
6614
- VALUE interp;
6615
- int argc; /* dummy */
6616
- VALUE *argv; /* dummy */
6368
+ ip_make_safe_core(VALUE interp, int argc /* dummy */, VALUE *argv /* dummy */)
6617
6369
  {
6618
6370
  struct tcltkip *ptr = get_ip(interp);
6619
6371
  Tk_Window mainWin;
@@ -6623,12 +6375,14 @@ ip_make_safe_core(interp, argc, argv)
6623
6375
  return rb_exc_new2(rb_eRuntimeError, "interpreter is deleted");
6624
6376
  }
6625
6377
 
6626
- if (Tcl_MakeSafe(ptr->ip) == TCL_ERROR) {
6627
- /* return rb_exc_new2(rb_eRuntimeError,
6628
- Tcl_GetStringResult(ptr->ip)); */
6629
- return create_ip_exc(interp, rb_eRuntimeError, "%s",
6630
- Tcl_GetStringResult(ptr->ip));
6631
- }
6378
+ /* Tcl_MakeSafe was removed, how to indicate this? */
6379
+
6380
+ /* if (Tcl_MakeSafe(ptr->ip) == TCL_ERROR) {
6381
+ * * return rb_exc_new2(rb_eRuntimeError,
6382
+ * Tcl_GetStringResult(ptr->ip)); *
6383
+ * return create_ip_exc(interp, rb_eRuntimeError, "%s",
6384
+ * Tcl_GetStringResult(ptr->ip));
6385
+ * } */
6632
6386
 
6633
6387
  ptr->allow_ruby_exit = 0;
6634
6388
 
@@ -6648,8 +6402,7 @@ ip_make_safe_core(interp, argc, argv)
6648
6402
  }
6649
6403
 
6650
6404
  static VALUE
6651
- ip_make_safe(self)
6652
- VALUE self;
6405
+ ip_make_safe(VALUE self)
6653
6406
  {
6654
6407
  struct tcltkip *ptr = get_ip(self);
6655
6408
 
@@ -6663,8 +6416,7 @@ ip_make_safe(self)
6663
6416
 
6664
6417
  /* is safe? */
6665
6418
  static VALUE
6666
- ip_is_safe_p(self)
6667
- VALUE self;
6419
+ ip_is_safe_p(VALUE self)
6668
6420
  {
6669
6421
  struct tcltkip *ptr = get_ip(self);
6670
6422
 
@@ -6682,8 +6434,7 @@ ip_is_safe_p(self)
6682
6434
 
6683
6435
  /* allow_ruby_exit? */
6684
6436
  static VALUE
6685
- ip_allow_ruby_exit_p(self)
6686
- VALUE self;
6437
+ ip_allow_ruby_exit_p(VALUE self)
6687
6438
  {
6688
6439
  struct tcltkip *ptr = get_ip(self);
6689
6440
 
@@ -6701,8 +6452,7 @@ ip_allow_ruby_exit_p(self)
6701
6452
 
6702
6453
  /* allow_ruby_exit = mode */
6703
6454
  static VALUE
6704
- ip_allow_ruby_exit_set(self, val)
6705
- VALUE self, val;
6455
+ ip_allow_ruby_exit_set(VALUE self, VALUE val)
6706
6456
  {
6707
6457
  struct tcltkip *ptr = get_ip(self);
6708
6458
  Tk_Window mainWin;
@@ -6756,8 +6506,7 @@ ip_allow_ruby_exit_set(self, val)
6756
6506
 
6757
6507
  /* delete interpreter */
6758
6508
  static VALUE
6759
- ip_delete(self)
6760
- VALUE self;
6509
+ ip_delete(VALUE self)
6761
6510
  {
6762
6511
  int thr_crit_bup;
6763
6512
  struct tcltkip *ptr = get_ip(self);
@@ -6788,8 +6537,7 @@ ip_delete(self)
6788
6537
 
6789
6538
  /* is deleted? */
6790
6539
  static VALUE
6791
- ip_has_invalid_namespace_p(self)
6792
- VALUE self;
6540
+ ip_has_invalid_namespace_p(VALUE self)
6793
6541
  {
6794
6542
  struct tcltkip *ptr = get_ip(self);
6795
6543
 
@@ -6810,8 +6558,7 @@ ip_has_invalid_namespace_p(self)
6810
6558
  }
6811
6559
 
6812
6560
  static VALUE
6813
- ip_is_deleted_p(self)
6814
- VALUE self;
6561
+ ip_is_deleted_p(VALUE self)
6815
6562
  {
6816
6563
  struct tcltkip *ptr = get_ip(self);
6817
6564
 
@@ -6823,10 +6570,7 @@ ip_is_deleted_p(self)
6823
6570
  }
6824
6571
 
6825
6572
  static VALUE
6826
- ip_has_mainwindow_p_core(self, argc, argv)
6827
- VALUE self;
6828
- int argc; /* dummy */
6829
- VALUE *argv; /* dummy */
6573
+ ip_has_mainwindow_p_core(VALUE self, int argc /* dummy */, VALUE *argv /* dummy */)
6830
6574
  {
6831
6575
  struct tcltkip *ptr = get_ip(self);
6832
6576
 
@@ -6840,8 +6584,7 @@ ip_has_mainwindow_p_core(self, argc, argv)
6840
6584
  }
6841
6585
 
6842
6586
  static VALUE
6843
- ip_has_mainwindow_p(self)
6844
- VALUE self;
6587
+ ip_has_mainwindow_p(VALUE self)
6845
6588
  {
6846
6589
  return tk_funcall(ip_has_mainwindow_p_core, 0, (VALUE*)NULL, self);
6847
6590
  }
@@ -6850,10 +6593,10 @@ ip_has_mainwindow_p(self)
6850
6593
  /*** ruby string <=> tcl object ***/
6851
6594
  #if TCL_MAJOR_VERSION >= 8
6852
6595
  static VALUE
6853
- get_str_from_obj(obj)
6854
- Tcl_Obj *obj;
6596
+ get_str_from_obj(Tcl_Obj *obj)
6855
6597
  {
6856
- int len, binary = 0;
6598
+ TYPE_TCL_SIZE len;
6599
+ int binary = 0;
6857
6600
  const char *s;
6858
6601
  volatile VALUE str;
6859
6602
 
@@ -6898,8 +6641,7 @@ get_str_from_obj(obj)
6898
6641
  }
6899
6642
 
6900
6643
  static Tcl_Obj *
6901
- get_obj_from_str(str)
6902
- VALUE str;
6644
+ get_obj_from_str(VALUE str)
6903
6645
  {
6904
6646
  const char *s = StringValueCStr(str);
6905
6647
 
@@ -6934,8 +6676,7 @@ get_obj_from_str(str)
6934
6676
  #endif /* ruby string <=> tcl object */
6935
6677
 
6936
6678
  static VALUE
6937
- ip_get_result_string_obj(interp)
6938
- Tcl_Interp *interp;
6679
+ ip_get_result_string_obj(Tcl_Interp *interp)
6939
6680
  {
6940
6681
  #if TCL_MAJOR_VERSION >= 8
6941
6682
  Tcl_Obj *retObj;
@@ -6953,11 +6694,8 @@ ip_get_result_string_obj(interp)
6953
6694
  #endif
6954
6695
  }
6955
6696
 
6956
- static int call_queue_handler _((Tcl_Event *, int));
6957
6697
  static int
6958
- call_queue_handler(evPtr, flags)
6959
- Tcl_Event *evPtr;
6960
- int flags;
6698
+ call_queue_handler(Tcl_Event *evPtr, int flags)
6961
6699
  {
6962
6700
  struct call_queue *q = (struct call_queue *)evPtr;
6963
6701
  volatile VALUE ret;
@@ -7039,11 +6777,7 @@ call_queue_handler(evPtr, flags)
7039
6777
  }
7040
6778
 
7041
6779
  static VALUE
7042
- tk_funcall(func, argc, argv, obj)
7043
- VALUE (*func)();
7044
- int argc;
7045
- VALUE *argv;
7046
- VALUE obj;
6780
+ tk_funcall(VALUE (*func)(VALUE, int, VALUE *), int argc, VALUE *argv, VALUE obj)
7047
6781
  {
7048
6782
  struct call_queue *callq;
7049
6783
  struct tcltkip *ptr;
@@ -7239,12 +6973,7 @@ struct call_eval_info {
7239
6973
  };
7240
6974
 
7241
6975
  static VALUE
7242
- #ifdef HAVE_PROTOTYPES
7243
6976
  call_tcl_eval(VALUE arg)
7244
- #else
7245
- call_tcl_eval(arg)
7246
- VALUE arg;
7247
- #endif
7248
6977
  {
7249
6978
  struct call_eval_info *inf = (struct call_eval_info *)arg;
7250
6979
 
@@ -7256,10 +6985,7 @@ call_tcl_eval(arg)
7256
6985
  #endif
7257
6986
 
7258
6987
  static VALUE
7259
- ip_eval_real(self, cmd_str, cmd_len)
7260
- VALUE self;
7261
- char *cmd_str;
7262
- int cmd_len;
6988
+ ip_eval_real(VALUE self, char *cmd_str, int cmd_len)
7263
6989
  {
7264
6990
  volatile VALUE ret;
7265
6991
  struct tcltkip *ptr = get_ip(self);
@@ -7416,11 +7142,8 @@ ip_eval_real(self, cmd_str, cmd_len)
7416
7142
  #endif
7417
7143
  }
7418
7144
 
7419
- int eval_queue_handler _((Tcl_Event *, int));
7420
7145
  int
7421
- eval_queue_handler(evPtr, flags)
7422
- Tcl_Event *evPtr;
7423
- int flags;
7146
+ eval_queue_handler(Tcl_Event *evPtr, int flags)
7424
7147
  {
7425
7148
  struct eval_queue *q = (struct eval_queue *)evPtr;
7426
7149
  volatile VALUE ret;
@@ -7499,9 +7222,7 @@ eval_queue_handler(evPtr, flags)
7499
7222
  }
7500
7223
 
7501
7224
  static VALUE
7502
- ip_eval(self, str)
7503
- VALUE self;
7504
- VALUE str;
7225
+ ip_eval(VALUE self, VALUE str)
7505
7226
  {
7506
7227
  struct eval_queue *evq;
7507
7228
  #ifdef RUBY_USE_NATIVE_THREAD
@@ -7677,10 +7398,7 @@ ip_eval(self, str)
7677
7398
 
7678
7399
 
7679
7400
  static int
7680
- ip_cancel_eval_core(interp, msg, flag)
7681
- Tcl_Interp *interp;
7682
- VALUE msg;
7683
- int flag;
7401
+ ip_cancel_eval_core(Tcl_Interp *interp, VALUE msg, int flag)
7684
7402
  {
7685
7403
  #if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
7686
7404
  rb_raise(rb_eNotImpError,
@@ -7703,10 +7421,7 @@ ip_cancel_eval_core(interp, msg, flag)
7703
7421
  }
7704
7422
 
7705
7423
  static VALUE
7706
- ip_cancel_eval(argc, argv, self)
7707
- int argc;
7708
- VALUE *argv;
7709
- VALUE self;
7424
+ ip_cancel_eval(int argc, VALUE *argv, VALUE self)
7710
7425
  {
7711
7426
  VALUE retval;
7712
7427
 
@@ -7724,10 +7439,7 @@ ip_cancel_eval(argc, argv, self)
7724
7439
  #define TCL_CANCEL_UNWIND 0x100000
7725
7440
  #endif
7726
7441
  static VALUE
7727
- ip_cancel_eval_unwind(argc, argv, self)
7728
- int argc;
7729
- VALUE *argv;
7730
- VALUE self;
7442
+ ip_cancel_eval_unwind(int argc, VALUE *argv, VALUE self)
7731
7443
  {
7732
7444
  int flag = 0;
7733
7445
  VALUE retval;
@@ -7746,10 +7458,7 @@ ip_cancel_eval_unwind(argc, argv, self)
7746
7458
 
7747
7459
  /* restart Tk */
7748
7460
  static VALUE
7749
- lib_restart_core(interp, argc, argv)
7750
- VALUE interp;
7751
- int argc; /* dummy */
7752
- VALUE *argv; /* dummy */
7461
+ lib_restart_core(VALUE interp, int argc /* dummy */, VALUE *argv /* dummy */)
7753
7462
  {
7754
7463
  volatile VALUE exc;
7755
7464
  struct tcltkip *ptr = get_ip(interp);
@@ -7807,8 +7516,7 @@ lib_restart_core(interp, argc, argv)
7807
7516
  }
7808
7517
 
7809
7518
  static VALUE
7810
- lib_restart(self)
7811
- VALUE self;
7519
+ lib_restart(VALUE self)
7812
7520
  {
7813
7521
  struct tcltkip *ptr = get_ip(self);
7814
7522
 
@@ -7825,8 +7533,7 @@ lib_restart(self)
7825
7533
 
7826
7534
 
7827
7535
  static VALUE
7828
- ip_restart(self)
7829
- VALUE self;
7536
+ ip_restart(VALUE self)
7830
7537
  {
7831
7538
  struct tcltkip *ptr = get_ip(self);
7832
7539
 
@@ -7846,10 +7553,7 @@ ip_restart(self)
7846
7553
  }
7847
7554
 
7848
7555
  static VALUE
7849
- lib_toUTF8_core(ip_obj, src, encodename)
7850
- VALUE ip_obj;
7851
- VALUE src;
7852
- VALUE encodename;
7556
+ lib_toUTF8_core(VALUE ip_obj, VALUE src, VALUE encodename)
7853
7557
  {
7854
7558
  volatile VALUE str = src;
7855
7559
 
@@ -8004,10 +7708,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
8004
7708
  }
8005
7709
 
8006
7710
  static VALUE
8007
- lib_toUTF8(argc, argv, self)
8008
- int argc;
8009
- VALUE *argv;
8010
- VALUE self;
7711
+ lib_toUTF8(int argc, VALUE *argv, VALUE self)
8011
7712
  {
8012
7713
  VALUE str, encodename;
8013
7714
 
@@ -8018,10 +7719,7 @@ lib_toUTF8(argc, argv, self)
8018
7719
  }
8019
7720
 
8020
7721
  static VALUE
8021
- ip_toUTF8(argc, argv, self)
8022
- int argc;
8023
- VALUE *argv;
8024
- VALUE self;
7722
+ ip_toUTF8(int argc, VALUE *argv, VALUE self)
8025
7723
  {
8026
7724
  VALUE str, encodename;
8027
7725
 
@@ -8032,10 +7730,7 @@ ip_toUTF8(argc, argv, self)
8032
7730
  }
8033
7731
 
8034
7732
  static VALUE
8035
- lib_fromUTF8_core(ip_obj, src, encodename)
8036
- VALUE ip_obj;
8037
- VALUE src;
8038
- VALUE encodename;
7733
+ lib_fromUTF8_core(VALUE ip_obj, VALUE src, VALUE encodename)
8039
7734
  {
8040
7735
  volatile VALUE str = src;
8041
7736
 
@@ -8120,7 +7815,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
8120
7815
  if (strcmp(RSTRING_PTR(encodename), "binary") == 0) {
8121
7816
  Tcl_Obj *tclstr;
8122
7817
  char *s;
8123
- int len;
7818
+ TYPE_TCL_SIZE len;
8124
7819
 
8125
7820
  StringValue(str);
8126
7821
  tclstr = Tcl_NewStringObj(RSTRING_PTR(str), RSTRING_LENINT(str));
@@ -8204,10 +7899,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
8204
7899
  }
8205
7900
 
8206
7901
  static VALUE
8207
- lib_fromUTF8(argc, argv, self)
8208
- int argc;
8209
- VALUE *argv;
8210
- VALUE self;
7902
+ lib_fromUTF8(int argc, VALUE *argv, VALUE self)
8211
7903
  {
8212
7904
  VALUE str, encodename;
8213
7905
 
@@ -8218,10 +7910,7 @@ lib_fromUTF8(argc, argv, self)
8218
7910
  }
8219
7911
 
8220
7912
  static VALUE
8221
- ip_fromUTF8(argc, argv, self)
8222
- int argc;
8223
- VALUE *argv;
8224
- VALUE self;
7913
+ ip_fromUTF8(int argc, VALUE *argv, VALUE self)
8225
7914
  {
8226
7915
  VALUE str, encodename;
8227
7916
 
@@ -8232,10 +7921,7 @@ ip_fromUTF8(argc, argv, self)
8232
7921
  }
8233
7922
 
8234
7923
  static VALUE
8235
- lib_UTF_backslash_core(self, str, all_bs)
8236
- VALUE self;
8237
- VALUE str;
8238
- int all_bs;
7924
+ lib_UTF_backslash_core(VALUE self, VALUE str, int all_bs)
8239
7925
  {
8240
7926
  #ifdef TCL_UTF_MAX
8241
7927
  char *src_buf, *dst_buf, *ptr;
@@ -8310,24 +7996,19 @@ lib_UTF_backslash_core(self, str, all_bs)
8310
7996
  }
8311
7997
 
8312
7998
  static VALUE
8313
- lib_UTF_backslash(self, str)
8314
- VALUE self;
8315
- VALUE str;
7999
+ lib_UTF_backslash(VALUE self, VALUE str)
8316
8000
  {
8317
8001
  return lib_UTF_backslash_core(self, str, 0);
8318
8002
  }
8319
8003
 
8320
8004
  static VALUE
8321
- lib_Tcl_backslash(self, str)
8322
- VALUE self;
8323
- VALUE str;
8005
+ lib_Tcl_backslash(VALUE self, VALUE str)
8324
8006
  {
8325
8007
  return lib_UTF_backslash_core(self, str, 1);
8326
8008
  }
8327
8009
 
8328
8010
  static VALUE
8329
- lib_get_system_encoding(self)
8330
- VALUE self;
8011
+ lib_get_system_encoding(VALUE self)
8331
8012
  {
8332
8013
  #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
8333
8014
  tcl_stubs_check();
@@ -8338,9 +8019,7 @@ lib_get_system_encoding(self)
8338
8019
  }
8339
8020
 
8340
8021
  static VALUE
8341
- lib_set_system_encoding(self, enc_name)
8342
- VALUE self;
8343
- VALUE enc_name;
8022
+ lib_set_system_encoding(VALUE self, VALUE enc_name)
8344
8023
  {
8345
8024
  #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
8346
8025
  tcl_stubs_check();
@@ -8470,22 +8149,16 @@ invoke_tcl_proc(arg)
8470
8149
 
8471
8150
  #if TCL_MAJOR_VERSION >= 8
8472
8151
  static VALUE
8473
- ip_invoke_core(interp, objc, objv)
8474
- VALUE interp;
8475
- int objc;
8476
- Tcl_Obj **objv;
8152
+ ip_invoke_core(VALUE interp, int objc, Tcl_Obj **objv)
8477
8153
  #else
8478
8154
  static VALUE
8479
- ip_invoke_core(interp, argc, argv)
8480
- VALUE interp;
8481
- int argc;
8482
- char **argv;
8155
+ ip_invoke_core(VALUE interp, int argc, char **argv)
8483
8156
  #endif
8484
8157
  {
8485
8158
  struct tcltkip *ptr;
8486
8159
  Tcl_CmdInfo info;
8487
8160
  char *cmd;
8488
- int len;
8161
+ TYPE_TCL_SIZE len;
8489
8162
  int thr_crit_bup;
8490
8163
  int unknown_flag = 0;
8491
8164
 
@@ -8756,9 +8429,7 @@ static Tcl_Obj **
8756
8429
  #else /* TCL_MAJOR_VERSION < 8 */
8757
8430
  static char **
8758
8431
  #endif
8759
- alloc_invoke_arguments(argc, argv)
8760
- int argc;
8761
- VALUE *argv;
8432
+ alloc_invoke_arguments(int argc, VALUE *argv)
8762
8433
  {
8763
8434
  int i;
8764
8435
  int thr_crit_bup;
@@ -8804,13 +8475,14 @@ alloc_invoke_arguments(argc, argv)
8804
8475
  }
8805
8476
 
8806
8477
  static void
8807
- free_invoke_arguments(argc, av)
8808
- int argc;
8478
+ free_invoke_arguments(
8479
+ int argc,
8809
8480
  #if TCL_MAJOR_VERSION >= 8
8810
- Tcl_Obj **av;
8481
+ Tcl_Obj **av
8811
8482
  #else /* TCL_MAJOR_VERSION < 8 */
8812
- char **av;
8483
+ char **av
8813
8484
  #endif
8485
+ )
8814
8486
  {
8815
8487
  int i;
8816
8488
 
@@ -8848,10 +8520,7 @@ free_invoke_arguments(argc, av)
8848
8520
  }
8849
8521
 
8850
8522
  static VALUE
8851
- ip_invoke_real(argc, argv, interp)
8852
- int argc;
8853
- VALUE *argv;
8854
- VALUE interp;
8523
+ ip_invoke_real(int argc, VALUE *argv, VALUE interp)
8855
8524
  {
8856
8525
  VALUE v;
8857
8526
  struct tcltkip *ptr; /* tcltkip data struct */
@@ -8885,11 +8554,8 @@ ip_invoke_real(argc, argv, interp)
8885
8554
  return v;
8886
8555
  }
8887
8556
 
8888
- int invoke_queue_handler _((Tcl_Event *, int));
8889
8557
  int
8890
- invoke_queue_handler(evPtr, flags)
8891
- Tcl_Event *evPtr;
8892
- int flags;
8558
+ invoke_queue_handler(Tcl_Event *evPtr, int flags)
8893
8559
  {
8894
8560
  struct invoke_queue *q = (struct invoke_queue *)evPtr;
8895
8561
  volatile VALUE ret;
@@ -8970,11 +8636,7 @@ invoke_queue_handler(evPtr, flags)
8970
8636
  }
8971
8637
 
8972
8638
  static VALUE
8973
- ip_invoke_with_position(argc, argv, obj, position)
8974
- int argc;
8975
- VALUE *argv;
8976
- VALUE obj;
8977
- Tcl_QueuePosition position;
8639
+ ip_invoke_with_position(int argc, VALUE *argv, VALUE obj, Tcl_QueuePosition position)
8978
8640
  {
8979
8641
  struct invoke_queue *ivq;
8980
8642
  #ifdef RUBY_USE_NATIVE_THREAD
@@ -9146,8 +8808,7 @@ ip_invoke_with_position(argc, argv, obj, position)
9146
8808
 
9147
8809
  /* get return code from Tcl_Eval() */
9148
8810
  static VALUE
9149
- ip_retval(self)
9150
- VALUE self;
8811
+ ip_retval(VALUE self)
9151
8812
  {
9152
8813
  struct tcltkip *ptr; /* tcltkip data struct */
9153
8814
 
@@ -9163,19 +8824,13 @@ ip_retval(self)
9163
8824
  }
9164
8825
 
9165
8826
  static VALUE
9166
- ip_invoke(argc, argv, obj)
9167
- int argc;
9168
- VALUE *argv;
9169
- VALUE obj;
8827
+ ip_invoke(int argc, VALUE *argv, VALUE obj)
9170
8828
  {
9171
8829
  return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_TAIL);
9172
8830
  }
9173
8831
 
9174
8832
  static VALUE
9175
- ip_invoke_immediate(argc, argv, obj)
9176
- int argc;
9177
- VALUE *argv;
9178
- VALUE obj;
8833
+ ip_invoke_immediate(int argc, VALUE *argv, VALUE obj)
9179
8834
  {
9180
8835
  /* POTENTIALY INSECURE : can create infinite loop */
9181
8836
  return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_HEAD);
@@ -9184,10 +8839,7 @@ ip_invoke_immediate(argc, argv, obj)
9184
8839
 
9185
8840
  /* access Tcl variables */
9186
8841
  static VALUE
9187
- ip_get_variable2_core(interp, argc, argv)
9188
- VALUE interp;
9189
- int argc;
9190
- VALUE *argv;
8842
+ ip_get_variable2_core(VALUE interp, int argc, VALUE *argv)
9191
8843
  {
9192
8844
  struct tcltkip *ptr = get_ip(interp);
9193
8845
  int thr_crit_bup;
@@ -9280,11 +8932,7 @@ ip_get_variable2_core(interp, argc, argv)
9280
8932
  }
9281
8933
 
9282
8934
  static VALUE
9283
- ip_get_variable2(self, varname, index, flag)
9284
- VALUE self;
9285
- VALUE varname;
9286
- VALUE index;
9287
- VALUE flag;
8935
+ ip_get_variable2(VALUE self, VALUE varname, VALUE index, VALUE flag)
9288
8936
  {
9289
8937
  VALUE argv[3];
9290
8938
  VALUE retval;
@@ -9306,19 +8954,13 @@ ip_get_variable2(self, varname, index, flag)
9306
8954
  }
9307
8955
 
9308
8956
  static VALUE
9309
- ip_get_variable(self, varname, flag)
9310
- VALUE self;
9311
- VALUE varname;
9312
- VALUE flag;
8957
+ ip_get_variable(VALUE self, VALUE varname, VALUE flag)
9313
8958
  {
9314
8959
  return ip_get_variable2(self, varname, Qnil, flag);
9315
8960
  }
9316
8961
 
9317
8962
  static VALUE
9318
- ip_set_variable2_core(interp, argc, argv)
9319
- VALUE interp;
9320
- int argc;
9321
- VALUE *argv;
8963
+ ip_set_variable2_core(VALUE interp, int argc, VALUE *argv)
9322
8964
  {
9323
8965
  struct tcltkip *ptr = get_ip(interp);
9324
8966
  int thr_crit_bup;
@@ -9416,12 +9058,7 @@ ip_set_variable2_core(interp, argc, argv)
9416
9058
  }
9417
9059
 
9418
9060
  static VALUE
9419
- ip_set_variable2(self, varname, index, value, flag)
9420
- VALUE self;
9421
- VALUE varname;
9422
- VALUE index;
9423
- VALUE value;
9424
- VALUE flag;
9061
+ ip_set_variable2(VALUE self, VALUE varname, VALUE index, VALUE value, VALUE flag)
9425
9062
  {
9426
9063
  VALUE argv[4];
9427
9064
  VALUE retval;
@@ -9445,20 +9082,13 @@ ip_set_variable2(self, varname, index, value, flag)
9445
9082
  }
9446
9083
 
9447
9084
  static VALUE
9448
- ip_set_variable(self, varname, value, flag)
9449
- VALUE self;
9450
- VALUE varname;
9451
- VALUE value;
9452
- VALUE flag;
9085
+ ip_set_variable(VALUE self, VALUE varname, VALUE value, VALUE flag)
9453
9086
  {
9454
9087
  return ip_set_variable2(self, varname, Qnil, value, flag);
9455
9088
  }
9456
9089
 
9457
9090
  static VALUE
9458
- ip_unset_variable2_core(interp, argc, argv)
9459
- VALUE interp;
9460
- int argc;
9461
- VALUE *argv;
9091
+ ip_unset_variable2_core(VALUE interp, int argc, VALUE *argv)
9462
9092
  {
9463
9093
  struct tcltkip *ptr = get_ip(interp);
9464
9094
  volatile VALUE varname, index, flag;
@@ -9494,11 +9124,7 @@ ip_unset_variable2_core(interp, argc, argv)
9494
9124
  }
9495
9125
 
9496
9126
  static VALUE
9497
- ip_unset_variable2(self, varname, index, flag)
9498
- VALUE self;
9499
- VALUE varname;
9500
- VALUE index;
9501
- VALUE flag;
9127
+ ip_unset_variable2(VALUE self, VALUE varname, VALUE index, VALUE flag)
9502
9128
  {
9503
9129
  VALUE argv[3];
9504
9130
  VALUE retval;
@@ -9520,68 +9146,48 @@ ip_unset_variable2(self, varname, index, flag)
9520
9146
  }
9521
9147
 
9522
9148
  static VALUE
9523
- ip_unset_variable(self, varname, flag)
9524
- VALUE self;
9525
- VALUE varname;
9526
- VALUE flag;
9149
+ ip_unset_variable(VALUE self, VALUE varname, VALUE flag)
9527
9150
  {
9528
9151
  return ip_unset_variable2(self, varname, Qnil, flag);
9529
9152
  }
9530
9153
 
9531
9154
  static VALUE
9532
- ip_get_global_var(self, varname)
9533
- VALUE self;
9534
- VALUE varname;
9155
+ ip_get_global_var(VALUE self, VALUE varname)
9535
9156
  {
9536
9157
  return ip_get_variable(self, varname,
9537
9158
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
9538
9159
  }
9539
9160
 
9540
9161
  static VALUE
9541
- ip_get_global_var2(self, varname, index)
9542
- VALUE self;
9543
- VALUE varname;
9544
- VALUE index;
9162
+ ip_get_global_var2(VALUE self, VALUE varname, VALUE index)
9545
9163
  {
9546
9164
  return ip_get_variable2(self, varname, index,
9547
9165
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
9548
9166
  }
9549
9167
 
9550
9168
  static VALUE
9551
- ip_set_global_var(self, varname, value)
9552
- VALUE self;
9553
- VALUE varname;
9554
- VALUE value;
9169
+ ip_set_global_var(VALUE self, VALUE varname, VALUE value)
9555
9170
  {
9556
9171
  return ip_set_variable(self, varname, value,
9557
9172
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
9558
9173
  }
9559
9174
 
9560
9175
  static VALUE
9561
- ip_set_global_var2(self, varname, index, value)
9562
- VALUE self;
9563
- VALUE varname;
9564
- VALUE index;
9565
- VALUE value;
9176
+ ip_set_global_var2(VALUE self, VALUE varname, VALUE index, VALUE value)
9566
9177
  {
9567
9178
  return ip_set_variable2(self, varname, index, value,
9568
9179
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
9569
9180
  }
9570
9181
 
9571
9182
  static VALUE
9572
- ip_unset_global_var(self, varname)
9573
- VALUE self;
9574
- VALUE varname;
9183
+ ip_unset_global_var(VALUE self, VALUE varname)
9575
9184
  {
9576
9185
  return ip_unset_variable(self, varname,
9577
9186
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
9578
9187
  }
9579
9188
 
9580
9189
  static VALUE
9581
- ip_unset_global_var2(self, varname, index)
9582
- VALUE self;
9583
- VALUE varname;
9584
- VALUE index;
9190
+ ip_unset_global_var2(VALUE self, VALUE varname, VALUE index)
9585
9191
  {
9586
9192
  return ip_unset_variable2(self, varname, index,
9587
9193
  INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
@@ -9590,9 +9196,7 @@ ip_unset_global_var2(self, varname, index)
9590
9196
 
9591
9197
  /* treat Tcl_List */
9592
9198
  static VALUE
9593
- lib_split_tklist_core(ip_obj, list_str)
9594
- VALUE ip_obj;
9595
- VALUE list_str;
9199
+ lib_split_tklist_core(VALUE ip_obj, VALUE list_str)
9596
9200
  {
9597
9201
  Tcl_Interp *interp;
9598
9202
  volatile VALUE ary, elem;
@@ -9624,7 +9228,7 @@ lib_split_tklist_core(ip_obj, list_str)
9624
9228
  #if TCL_MAJOR_VERSION >= 8
9625
9229
  /* object style interface */
9626
9230
  Tcl_Obj *listobj;
9627
- int objc;
9231
+ TYPE_TCL_SIZE objc;
9628
9232
  Tcl_Obj **objv;
9629
9233
  int thr_crit_bup;
9630
9234
 
@@ -9716,29 +9320,23 @@ lib_split_tklist_core(ip_obj, list_str)
9716
9320
  }
9717
9321
 
9718
9322
  static VALUE
9719
- lib_split_tklist(self, list_str)
9720
- VALUE self;
9721
- VALUE list_str;
9323
+ lib_split_tklist(VALUE self, VALUE list_str)
9722
9324
  {
9723
9325
  return lib_split_tklist_core(Qnil, list_str);
9724
9326
  }
9725
9327
 
9726
9328
 
9727
9329
  static VALUE
9728
- ip_split_tklist(self, list_str)
9729
- VALUE self;
9730
- VALUE list_str;
9330
+ ip_split_tklist(VALUE self, VALUE list_str)
9731
9331
  {
9732
9332
  return lib_split_tklist_core(self, list_str);
9733
9333
  }
9734
9334
 
9735
9335
  static VALUE
9736
- lib_merge_tklist(argc, argv, obj)
9737
- int argc;
9738
- VALUE *argv;
9739
- VALUE obj;
9336
+ lib_merge_tklist(int argc, VALUE *argv, VALUE obj)
9740
9337
  {
9741
- int num, len;
9338
+ int num;
9339
+ TYPE_TCL_SIZE len;
9742
9340
  int *flagPtr;
9743
9341
  char *dst, *result;
9744
9342
  volatile VALUE str;
@@ -9828,11 +9426,10 @@ lib_merge_tklist(argc, argv, obj)
9828
9426
  }
9829
9427
 
9830
9428
  static VALUE
9831
- lib_conv_listelement(self, src)
9832
- VALUE self;
9833
- VALUE src;
9429
+ lib_conv_listelement(VALUE self, VALUE src)
9834
9430
  {
9835
- int len, scan_flag;
9431
+ TYPE_TCL_SIZE len;
9432
+ int scan_flag;
9836
9433
  volatile VALUE dst;
9837
9434
  int thr_crit_bup;
9838
9435
 
@@ -9863,8 +9460,7 @@ lib_conv_listelement(self, src)
9863
9460
  }
9864
9461
 
9865
9462
  static VALUE
9866
- lib_getversion(self)
9867
- VALUE self;
9463
+ lib_getversion(VALUE self)
9868
9464
  {
9869
9465
  set_tcltk_version();
9870
9466
 
@@ -9875,8 +9471,7 @@ lib_getversion(self)
9875
9471
  }
9876
9472
 
9877
9473
  static VALUE
9878
- lib_get_reltype_name(self)
9879
- VALUE self;
9474
+ lib_get_reltype_name(VALUE self)
9880
9475
  {
9881
9476
  set_tcltk_version();
9882
9477
 
@@ -9952,10 +9547,7 @@ tcltklib_compile_info(void)
9952
9547
  /*###############################################*/
9953
9548
 
9954
9549
  static VALUE
9955
- create_dummy_encoding_for_tk_core(interp, name, error_mode)
9956
- VALUE interp;
9957
- VALUE name;
9958
- VALUE error_mode;
9550
+ create_dummy_encoding_for_tk_core(VALUE interp, VALUE name, VALUE error_mode)
9959
9551
  {
9960
9552
  get_ip(interp);
9961
9553
 
@@ -9992,9 +9584,7 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
9992
9584
  #endif
9993
9585
  }
9994
9586
  static VALUE
9995
- create_dummy_encoding_for_tk(interp, name)
9996
- VALUE interp;
9997
- VALUE name;
9587
+ create_dummy_encoding_for_tk(VALUE interp, VALUE name)
9998
9588
  {
9999
9589
  return create_dummy_encoding_for_tk_core(interp, name, Qtrue);
10000
9590
  }
@@ -10002,14 +9592,12 @@ create_dummy_encoding_for_tk(interp, name)
10002
9592
 
10003
9593
  #ifdef HAVE_RUBY_ENCODING_H
10004
9594
  static int
10005
- update_encoding_table(table, interp, error_mode)
10006
- VALUE table;
10007
- VALUE interp;
10008
- VALUE error_mode;
9595
+ update_encoding_table(VALUE table, VALUE interp, VALUE error_mode)
10009
9596
  {
10010
9597
  struct tcltkip *ptr;
10011
9598
  int retry = 0;
10012
- int i, idx, objc;
9599
+ int i, idx;
9600
+ TYPE_TCL_SIZE objc;
10013
9601
  Tcl_Obj **objv;
10014
9602
  Tcl_Obj *enc_list;
10015
9603
  volatile VALUE encname = Qnil;
@@ -10059,10 +9647,7 @@ update_encoding_table(table, interp, error_mode)
10059
9647
  }
10060
9648
 
10061
9649
  static VALUE
10062
- encoding_table_get_name_core(table, enc_arg, error_mode)
10063
- VALUE table;
10064
- VALUE enc_arg;
10065
- VALUE error_mode;
9650
+ encoding_table_get_name_core(VALUE table, VALUE enc_arg, VALUE error_mode)
10066
9651
  {
10067
9652
  volatile VALUE enc = enc_arg;
10068
9653
  volatile VALUE name = Qnil;
@@ -10166,10 +9751,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
10166
9751
  return Qnil;
10167
9752
  }
10168
9753
  static VALUE
10169
- encoding_table_get_obj_core(table, enc, error_mode)
10170
- VALUE table;
10171
- VALUE enc;
10172
- VALUE error_mode;
9754
+ encoding_table_get_obj_core(VALUE table, VALUE enc, VALUE error_mode)
10173
9755
  {
10174
9756
  volatile VALUE obj = Qnil;
10175
9757
 
@@ -10185,10 +9767,7 @@ encoding_table_get_obj_core(table, enc, error_mode)
10185
9767
  #else /* ! HAVE_RUBY_ENCODING_H */
10186
9768
  #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
10187
9769
  static int
10188
- update_encoding_table(table, interp, error_mode)
10189
- VALUE table;
10190
- VALUE interp;
10191
- VALUE error_mode;
9770
+ update_encoding_table(VALUE table, VALUE interp, VALUE error_mode)
10192
9771
  {
10193
9772
  struct tcltkip *ptr;
10194
9773
  int retry = 0;
@@ -10231,10 +9810,7 @@ update_encoding_table(table, interp, error_mode)
10231
9810
  }
10232
9811
 
10233
9812
  static VALUE
10234
- encoding_table_get_name_core(table, enc, error_mode)
10235
- VALUE table;
10236
- VALUE enc;
10237
- VALUE error_mode;
9813
+ encoding_table_get_name_core(VALUE table, VALUE enc, VALUE error_mode)
10238
9814
  {
10239
9815
  volatile VALUE name = Qnil;
10240
9816
 
@@ -10264,28 +9840,19 @@ encoding_table_get_name_core(table, enc, error_mode)
10264
9840
  return Qnil;
10265
9841
  }
10266
9842
  static VALUE
10267
- encoding_table_get_obj_core(table, enc, error_mode)
10268
- VALUE table;
10269
- VALUE enc;
10270
- VALUE error_mode;
9843
+ encoding_table_get_obj_core(VALUE table, VALUE enc, VALUE error_mode)
10271
9844
  {
10272
9845
  return encoding_table_get_name_core(table, enc, error_mode);
10273
9846
  }
10274
9847
 
10275
9848
  #else /* Tcl/Tk 7.x or 8.0 */
10276
9849
  static VALUE
10277
- encoding_table_get_name_core(table, enc, error_mode)
10278
- VALUE table;
10279
- VALUE enc;
10280
- VALUE error_mode;
9850
+ encoding_table_get_name_core(VALUE table, VALUE enc, VALUE error_mode)
10281
9851
  {
10282
9852
  return Qnil;
10283
9853
  }
10284
9854
  static VALUE
10285
- encoding_table_get_obj_core(table, enc, error_mode)
10286
- VALUE table;
10287
- VALUE enc;
10288
- VALUE error_mode;
9855
+ encoding_table_get_obj_core(VALUE table, VALUE enc, VALUE error_mode)
10289
9856
  {
10290
9857
  return Qnil;
10291
9858
  }
@@ -10293,31 +9860,26 @@ encoding_table_get_obj_core(table, enc, error_mode)
10293
9860
  #endif
10294
9861
 
10295
9862
  static VALUE
10296
- encoding_table_get_name(table, enc)
10297
- VALUE table;
10298
- VALUE enc;
9863
+ encoding_table_get_name(VALUE table, VALUE enc)
10299
9864
  {
10300
9865
  return encoding_table_get_name_core(table, enc, Qtrue);
10301
9866
  }
10302
9867
  static VALUE
10303
- encoding_table_get_obj(table, enc)
10304
- VALUE table;
10305
- VALUE enc;
9868
+ encoding_table_get_obj(VALUE table, VALUE enc)
10306
9869
  {
10307
9870
  return encoding_table_get_obj_core(table, enc, Qtrue);
10308
9871
  }
10309
9872
 
10310
9873
  #ifdef HAVE_RUBY_ENCODING_H
10311
9874
  static VALUE
10312
- create_encoding_table_core(arg, interp)
10313
- VALUE arg;
10314
- VALUE interp;
9875
+ create_encoding_table_core(RB_BLOCK_CALL_FUNC_ARGLIST(arg, interp))
10315
9876
  {
10316
9877
  struct tcltkip *ptr = get_ip(interp);
10317
9878
  volatile VALUE table = rb_hash_new();
10318
9879
  volatile VALUE encname = Qnil;
10319
9880
  volatile VALUE encobj = Qnil;
10320
- int i, idx, objc;
9881
+ int i, idx;
9882
+ TYPE_TCL_SIZE objc;
10321
9883
  Tcl_Obj **objv;
10322
9884
  Tcl_Obj *enc_list;
10323
9885
 
@@ -10399,9 +9961,7 @@ create_encoding_table_core(arg, interp)
10399
9961
  #else /* ! HAVE_RUBY_ENCODING_H */
10400
9962
  #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
10401
9963
  static VALUE
10402
- create_encoding_table_core(arg, interp)
10403
- VALUE arg;
10404
- VALUE interp;
9964
+ create_encoding_table_core(RB_BLOCK_CALL_FUNC_ARGLIST(arg, interp))
10405
9965
  {
10406
9966
  struct tcltkip *ptr = get_ip(interp);
10407
9967
  volatile VALUE table = rb_hash_new();
@@ -10440,9 +10000,7 @@ create_encoding_table_core(arg, interp)
10440
10000
 
10441
10001
  #else /* Tcl/Tk 7.x or 8.0 */
10442
10002
  static VALUE
10443
- create_encoding_table_core(arg, interp)
10444
- VALUE arg;
10445
- VALUE interp;
10003
+ create_encoding_table_core(RB_BLOCK_CALL_FUNC_ARGLIST(arg, interp))
10446
10004
  {
10447
10005
  volatile VALUE table = rb_hash_new();
10448
10006
  rb_ivar_set(interp, ID_encoding_table, table);
@@ -10452,16 +10010,14 @@ create_encoding_table_core(arg, interp)
10452
10010
  #endif
10453
10011
 
10454
10012
  static VALUE
10455
- create_encoding_table(interp)
10456
- VALUE interp;
10013
+ create_encoding_table(VALUE interp)
10457
10014
  {
10458
10015
  return rb_funcall(rb_proc_new(create_encoding_table_core, interp),
10459
10016
  ID_call, 0);
10460
10017
  }
10461
10018
 
10462
10019
  static VALUE
10463
- ip_get_encoding_table(interp)
10464
- VALUE interp;
10020
+ ip_get_encoding_table(VALUE interp)
10465
10021
  {
10466
10022
  volatile VALUE table = Qnil;
10467
10023
 
@@ -10525,10 +10081,7 @@ EXTERN struct dummy_TkMenuRef *TkFindMenuReferences(Tcl_Interp*, char*);
10525
10081
  #endif
10526
10082
 
10527
10083
  static VALUE
10528
- ip_make_menu_embeddable_core(interp, argc, argv)
10529
- VALUE interp;
10530
- int argc;
10531
- VALUE *argv;
10084
+ ip_make_menu_embeddable_core(VALUE interp, int argc, VALUE *argv)
10532
10085
  {
10533
10086
  #if TCL_MAJOR_VERSION >= 8
10534
10087
  volatile VALUE menu_path;
@@ -10605,9 +10158,7 @@ ip_make_menu_embeddable_core(interp, argc, argv)
10605
10158
  }
10606
10159
 
10607
10160
  static VALUE
10608
- ip_make_menu_embeddable(interp, menu_path)
10609
- VALUE interp;
10610
- VALUE menu_path;
10161
+ ip_make_menu_embeddable(VALUE interp, VALUE menu_path)
10611
10162
  {
10612
10163
  VALUE argv[1];
10613
10164
 
@@ -10721,9 +10272,9 @@ Init_tcltklib(void)
10721
10272
 
10722
10273
  /* --------------------------------------------------------------- */
10723
10274
 
10724
- rb_define_module_function(lib, "get_version", lib_getversion, -1);
10275
+ rb_define_module_function(lib, "get_version", lib_getversion, 0);
10725
10276
  rb_define_module_function(lib, "get_release_type_name",
10726
- lib_get_reltype_name, -1);
10277
+ lib_get_reltype_name, 0);
10727
10278
 
10728
10279
  rb_define_const(release_type, "ALPHA", INT2FIX(TCL_ALPHA_RELEASE));
10729
10280
  rb_define_const(release_type, "BETA", INT2FIX(TCL_BETA_RELEASE));