ncursesw 1.4.13 → 1.4.14
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.
- checksums.yaml +4 -4
- data/Changes +11 -0
- data/form_wrap.c +21 -8
- data/menu_wrap.c +13 -5
- data/ncurses_wrap.c +36 -16
- data/panel_wrap.c +10 -2
- metadata +2 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 016e54ae104b0ef7cd1ccc31450cf6c187028dcc36924ec862f02d79a599d1ef
|
|
4
|
+
data.tar.gz: 2d9672ed5931baa142638ace9eabf3a32727ed023d69043af0b45c3ac5eee22a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c19f4ccf0c9825e2964f44b12e79f503fcbb95dc7b0b094c43c64b72830d95db5383ee38b6f8c2025ea5c5108b8f5b6d07ae9c4e63829cface34dd06522d68c
|
|
7
|
+
data.tar.gz: 56c3f55db7386478779bf59c8489967ca4388839c18bba718c85e9ec1e359a8a060743112ff45bbb658a309b7baeb3cb17440d3793d5654165dc1e6dfe5b3e65
|
data/Changes
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
ncurses-ruby-1.4.14
|
|
2
|
+
* Fixed segfault when calling tigetstr() for a non-existent capability.
|
|
3
|
+
* Fixed incorrect binding of wenclose(), mvwgetch(), and add_wch().
|
|
4
|
+
* Added missing NULL checks for functions which use NULL to signal an error.
|
|
5
|
+
Avoids a Ruby ArgumentError or segfault in the error cases.
|
|
6
|
+
* Replaced deprecated Data_Wrap_Struct() with TypedData_Wrap_Struct()
|
|
7
|
+
to get type checking for passed-in structs and avoid deprecation warnings.
|
|
8
|
+
* Fixed potential use-after-free for PANEL userptr.
|
|
9
|
+
* Fixed redefinition of methods when Ncurses.new_term or Ncurses.initscr
|
|
10
|
+
are called multiple times.
|
|
11
|
+
|
|
1
12
|
ncurses-ruby-1.4.13
|
|
2
13
|
* Fixed compilation errors under C23 due to unprototyped functions.
|
|
3
14
|
|
data/form_wrap.c
CHANGED
|
@@ -253,6 +253,9 @@ void init_form_opts_constants() {
|
|
|
253
253
|
/*
|
|
254
254
|
* FIELD wrapper
|
|
255
255
|
*/
|
|
256
|
+
static const struct rb_data_type_struct field_rbtype = {
|
|
257
|
+
.wrap_struct_name = "Ncurses::Form::FIELDTYPE",
|
|
258
|
+
};
|
|
256
259
|
static VALUE wrap_field(FIELD* field)
|
|
257
260
|
{
|
|
258
261
|
if (field == 0) return Qnil;
|
|
@@ -261,7 +264,7 @@ static VALUE wrap_field(FIELD* field)
|
|
|
261
264
|
VALUE field_adress = INT2NUM((long)(field));
|
|
262
265
|
VALUE rb_field = rb_hash_aref(fields_hash, field_adress);
|
|
263
266
|
if (rb_field == Qnil) {
|
|
264
|
-
rb_field =
|
|
267
|
+
rb_field = TypedData_Wrap_Struct(cFIELD, &field_rbtype, field);
|
|
265
268
|
rb_iv_set(rb_field, "@destroyed", Qfalse);
|
|
266
269
|
rb_hash_aset(fields_hash, field_adress, rb_field);
|
|
267
270
|
}
|
|
@@ -276,13 +279,16 @@ static FIELD* get_field(VALUE rb_field)
|
|
|
276
279
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed field");
|
|
277
280
|
return 0;
|
|
278
281
|
}
|
|
279
|
-
|
|
282
|
+
TypedData_Get_Struct(rb_field, FIELD, &field_rbtype, field);
|
|
280
283
|
return field;
|
|
281
284
|
}
|
|
282
285
|
|
|
283
286
|
/*
|
|
284
287
|
* FIELDTYPE wrapper
|
|
285
288
|
*/
|
|
289
|
+
static const struct rb_data_type_struct fieldtype_rbtype = {
|
|
290
|
+
.wrap_struct_name = "Ncurses::Form::FIELDTYPE",
|
|
291
|
+
};
|
|
286
292
|
static VALUE wrap_fieldtype(FIELDTYPE* fieldtype)
|
|
287
293
|
{
|
|
288
294
|
if (fieldtype == NULL) return Qnil;
|
|
@@ -291,7 +297,7 @@ static VALUE wrap_fieldtype(FIELDTYPE* fieldtype)
|
|
|
291
297
|
VALUE fieldtype_adress = INT2NUM((long)(fieldtype));
|
|
292
298
|
VALUE rb_fieldtype = rb_hash_aref(fieldtypes_hash, fieldtype_adress);
|
|
293
299
|
if (rb_fieldtype == Qnil) {
|
|
294
|
-
rb_fieldtype =
|
|
300
|
+
rb_fieldtype = TypedData_Wrap_Struct(cFIELDTYPE, &fieldtype_rbtype, fieldtype);
|
|
295
301
|
rb_iv_set(rb_fieldtype, "@destroyed", Qfalse);
|
|
296
302
|
rb_hash_aset(fieldtypes_hash, fieldtype_adress, rb_fieldtype);
|
|
297
303
|
}
|
|
@@ -306,13 +312,16 @@ static FIELDTYPE* get_fieldtype(VALUE rb_fieldtype)
|
|
|
306
312
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed fieldtype");
|
|
307
313
|
return 0;
|
|
308
314
|
}
|
|
309
|
-
|
|
315
|
+
TypedData_Get_Struct(rb_fieldtype, FIELDTYPE, &fieldtype_rbtype, fieldtype);
|
|
310
316
|
return fieldtype;
|
|
311
317
|
}
|
|
312
318
|
|
|
313
319
|
/*
|
|
314
320
|
* FORM wrapper
|
|
315
321
|
*/
|
|
322
|
+
static const struct rb_data_type_struct form_rbtype = {
|
|
323
|
+
.wrap_struct_name = "Ncurses::Form::FORM",
|
|
324
|
+
};
|
|
316
325
|
static VALUE wrap_form(FORM* form)
|
|
317
326
|
{
|
|
318
327
|
if (form == 0) return Qnil;
|
|
@@ -321,7 +330,7 @@ static VALUE wrap_form(FORM* form)
|
|
|
321
330
|
VALUE form_adress = INT2NUM((long)(form));
|
|
322
331
|
VALUE rb_form = rb_hash_aref(forms_hash, form_adress);
|
|
323
332
|
if (rb_form == Qnil) {
|
|
324
|
-
rb_form =
|
|
333
|
+
rb_form = TypedData_Wrap_Struct(cFORM, &form_rbtype, form);
|
|
325
334
|
rb_iv_set(rb_form, "@destroyed", Qfalse);
|
|
326
335
|
rb_hash_aset(forms_hash, form_adress, rb_form);
|
|
327
336
|
}
|
|
@@ -336,7 +345,7 @@ static FORM* get_form(VALUE rb_form)
|
|
|
336
345
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed form");
|
|
337
346
|
return 0;
|
|
338
347
|
}
|
|
339
|
-
|
|
348
|
+
TypedData_Get_Struct(rb_form, FORM, &form_rbtype, form);
|
|
340
349
|
return form;
|
|
341
350
|
}
|
|
342
351
|
|
|
@@ -763,7 +772,9 @@ static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf,
|
|
|
763
772
|
|
|
764
773
|
static VALUE rbncurs_c_field_buffer(VALUE rb_field, VALUE buffer) {
|
|
765
774
|
FIELD* field = get_field(rb_field);
|
|
766
|
-
|
|
775
|
+
char * str = field_buffer(field, NUM2INT(buffer));
|
|
776
|
+
if (str == NULL) return Qnil;
|
|
777
|
+
return rb_str_new2(str);
|
|
767
778
|
}
|
|
768
779
|
static VALUE rbncurs_m_field_buffer(VALUE dummy, VALUE rb_field, VALUE buffer)
|
|
769
780
|
{ return rbncurs_c_field_buffer(rb_field, buffer); }
|
|
@@ -1060,7 +1071,9 @@ static VALUE rbncurs_m_form_opts(VALUE dummy, VALUE rb_form)
|
|
|
1060
1071
|
* form_requestname
|
|
1061
1072
|
*/
|
|
1062
1073
|
static VALUE rbncurs_c_form_request_name(VALUE request) {
|
|
1063
|
-
|
|
1074
|
+
char * str = form_request_name(NUM2INT(request));
|
|
1075
|
+
if (str == NULL) return Qnil;
|
|
1076
|
+
return rb_str_new2(str);
|
|
1064
1077
|
}
|
|
1065
1078
|
static VALUE rbncurs_m_form_request_name(VALUE dummy, VALUE request)
|
|
1066
1079
|
{ return rbncurs_c_form_request_name(request); }
|
data/menu_wrap.c
CHANGED
|
@@ -140,6 +140,9 @@ void init_menu_opts_constants(void)
|
|
|
140
140
|
/*
|
|
141
141
|
* ITEM wrapper
|
|
142
142
|
*/
|
|
143
|
+
static const struct rb_data_type_struct item_rbtype = {
|
|
144
|
+
.wrap_struct_name = "Ncurses::Menu::ITEM",
|
|
145
|
+
};
|
|
143
146
|
static VALUE wrap_item(ITEM *item)
|
|
144
147
|
{
|
|
145
148
|
if (item == 0) return Qnil;
|
|
@@ -150,7 +153,7 @@ static VALUE wrap_item(ITEM *item)
|
|
|
150
153
|
|
|
151
154
|
if (rb_item == Qnil)
|
|
152
155
|
{
|
|
153
|
-
rb_item =
|
|
156
|
+
rb_item = TypedData_Wrap_Struct(cITEM, &item_rbtype, item);
|
|
154
157
|
rb_iv_set(rb_item, "@destroyed", Qfalse);
|
|
155
158
|
rb_hash_aset(items_hash, item_address, rb_item);
|
|
156
159
|
}
|
|
@@ -167,7 +170,7 @@ static ITEM *get_item(VALUE rb_item)
|
|
|
167
170
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed item");
|
|
168
171
|
return 0;
|
|
169
172
|
}
|
|
170
|
-
|
|
173
|
+
TypedData_Get_Struct(rb_item, ITEM, &item_rbtype, item);
|
|
171
174
|
return item;
|
|
172
175
|
}
|
|
173
176
|
|
|
@@ -175,6 +178,9 @@ static ITEM *get_item(VALUE rb_item)
|
|
|
175
178
|
/*
|
|
176
179
|
* MENU wrapper
|
|
177
180
|
*/
|
|
181
|
+
static const struct rb_data_type_struct menu_rbtype = {
|
|
182
|
+
.wrap_struct_name = "Ncurses::Menu::MENU",
|
|
183
|
+
};
|
|
178
184
|
static VALUE wrap_menu(MENU *menu)
|
|
179
185
|
{
|
|
180
186
|
if (menu == 0) return Qnil;
|
|
@@ -185,7 +191,7 @@ static VALUE wrap_menu(MENU *menu)
|
|
|
185
191
|
|
|
186
192
|
if (rb_menu == Qnil)
|
|
187
193
|
{
|
|
188
|
-
rb_menu =
|
|
194
|
+
rb_menu = TypedData_Wrap_Struct(cMENU, &menu_rbtype, menu);
|
|
189
195
|
rb_iv_set(rb_menu, "@destroyed", Qfalse);
|
|
190
196
|
rb_hash_aset(menus_hash, menu_address, rb_menu);
|
|
191
197
|
}
|
|
@@ -202,7 +208,7 @@ static MENU *get_menu(VALUE rb_menu)
|
|
|
202
208
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed menu");
|
|
203
209
|
return 0;
|
|
204
210
|
}
|
|
205
|
-
|
|
211
|
+
TypedData_Get_Struct(rb_menu, MENU, &menu_rbtype, menu);
|
|
206
212
|
return menu;
|
|
207
213
|
}
|
|
208
214
|
|
|
@@ -664,7 +670,9 @@ static VALUE rbncurs_m_menu_opts(VALUE dummy, VALUE rb_menu)
|
|
|
664
670
|
*/
|
|
665
671
|
static VALUE rbncurs_c_menu_request_name(VALUE request)
|
|
666
672
|
{
|
|
667
|
-
|
|
673
|
+
char *str = menu_request_name(NUM2INT(request));
|
|
674
|
+
if (str == NULL) return Qnil;
|
|
675
|
+
return rb_str_new2(str);
|
|
668
676
|
}
|
|
669
677
|
static VALUE rbncurs_m_menu_request_name(VALUE dummy, VALUE request)
|
|
670
678
|
{ return rbncurs_c_menu_request_name(request); }
|
data/ncurses_wrap.c
CHANGED
|
@@ -223,6 +223,9 @@ long rbncurs_array_length(VALUE array)
|
|
|
223
223
|
return NUM2LONG(rb_funcall(array, rb_intern("length"), 0));
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
static const struct rb_data_type_struct window_rbtype = {
|
|
227
|
+
.wrap_struct_name = "Ncurses::WINDOW",
|
|
228
|
+
};
|
|
226
229
|
VALUE wrap_window(WINDOW* window)
|
|
227
230
|
{
|
|
228
231
|
if (window == 0) return Qnil;
|
|
@@ -231,7 +234,7 @@ VALUE wrap_window(WINDOW* window)
|
|
|
231
234
|
VALUE window_adress = INT2NUM((long)(window));
|
|
232
235
|
VALUE rb_window = rb_hash_aref(windows_hash, window_adress);
|
|
233
236
|
if (rb_window == Qnil) {
|
|
234
|
-
rb_window =
|
|
237
|
+
rb_window = TypedData_Wrap_Struct(cWINDOW, &window_rbtype, window);
|
|
235
238
|
rb_iv_set(rb_window, "@destroyed", Qfalse);
|
|
236
239
|
rb_iv_set(rb_window, "@timeout", INT2FIX(-1));
|
|
237
240
|
rb_hash_aset(windows_hash, window_adress, rb_window);
|
|
@@ -247,7 +250,7 @@ WINDOW* get_window(VALUE rb_window)
|
|
|
247
250
|
rb_raise(eNcurses, "Attempt to access a destroyed window");
|
|
248
251
|
return 0;
|
|
249
252
|
}
|
|
250
|
-
|
|
253
|
+
TypedData_Get_Struct(rb_window, WINDOW, &window_rbtype, window);
|
|
251
254
|
return window;
|
|
252
255
|
}
|
|
253
256
|
static VALUE rbncurs_delwin(VALUE dummy, VALUE arg1) {
|
|
@@ -259,6 +262,9 @@ static VALUE rbncurs_delwin(VALUE dummy, VALUE arg1) {
|
|
|
259
262
|
return INT2NUM(delwin(window));
|
|
260
263
|
}
|
|
261
264
|
|
|
265
|
+
static const struct rb_data_type_struct screen_rbtype = {
|
|
266
|
+
.wrap_struct_name = "Ncurses::SCREEN",
|
|
267
|
+
};
|
|
262
268
|
static VALUE wrap_screen(SCREEN* screen)
|
|
263
269
|
{
|
|
264
270
|
if (screen == 0) return Qnil;
|
|
@@ -267,7 +273,7 @@ static VALUE wrap_screen(SCREEN* screen)
|
|
|
267
273
|
VALUE screen_adress = INT2NUM((long)(screen));
|
|
268
274
|
VALUE rb_screen = rb_hash_aref(screens_hash, screen_adress);
|
|
269
275
|
if (rb_screen == Qnil) {
|
|
270
|
-
rb_screen =
|
|
276
|
+
rb_screen = TypedData_Wrap_Struct(cSCREEN, &screen_rbtype, screen);
|
|
271
277
|
rb_iv_set(rb_screen, "@destroyed", Qfalse);
|
|
272
278
|
rb_hash_aset(screens_hash, screen_adress, rb_screen);
|
|
273
279
|
}
|
|
@@ -282,7 +288,7 @@ static SCREEN* get_screen(VALUE rb_screen)
|
|
|
282
288
|
rb_raise(eNcurses, "Attempt to access a destroyed screen");
|
|
283
289
|
return 0;
|
|
284
290
|
}
|
|
285
|
-
|
|
291
|
+
TypedData_Get_Struct(rb_screen, SCREEN, &screen_rbtype, screen);
|
|
286
292
|
return screen;
|
|
287
293
|
}
|
|
288
294
|
#ifdef HAVE_DELSCREEN
|
|
@@ -580,8 +586,8 @@ static VALUE rbncurs_addch(VALUE dummy, VALUE arg1) {
|
|
|
580
586
|
}
|
|
581
587
|
#ifdef HAVE_ADD_WCH
|
|
582
588
|
static VALUE rbncurs_add_wch(VALUE dummy, VALUE arg1) {
|
|
583
|
-
|
|
584
|
-
return INT2NUM(add_wch(
|
|
589
|
+
cchar_t c = { 0, { NUM2ULONG(arg1), 0 } };
|
|
590
|
+
return INT2NUM(add_wch(&c));
|
|
585
591
|
}
|
|
586
592
|
#endif
|
|
587
593
|
static VALUE rbncurs_addchnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
|
|
@@ -1126,7 +1132,9 @@ static VALUE rbncurs_is_wintouched(VALUE dummy, VALUE arg1) {
|
|
|
1126
1132
|
return (is_wintouched(get_window(arg1))) ? Qtrue : Qfalse;
|
|
1127
1133
|
}
|
|
1128
1134
|
static VALUE rbncurs_keyname(VALUE dummy, VALUE arg1) {
|
|
1129
|
-
|
|
1135
|
+
const char * str = keyname(NUM2INT(arg1));
|
|
1136
|
+
if (str == NULL) return Qnil;
|
|
1137
|
+
return rb_str_new2(str);
|
|
1130
1138
|
}
|
|
1131
1139
|
static VALUE rbncurs_keypad(VALUE dummy, VALUE arg1, VALUE arg2) {
|
|
1132
1140
|
return INT2NUM(keypad(get_window(arg1), RTEST(arg2)));
|
|
@@ -1246,10 +1254,10 @@ static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, V
|
|
|
1246
1254
|
static VALUE rbncurs_mvwdelch(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
|
|
1247
1255
|
return INT2NUM(mvwdelch(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3)));
|
|
1248
1256
|
}
|
|
1249
|
-
static VALUE rbncurs_mvwgetch(VALUE dummy, VALUE
|
|
1250
|
-
WINDOW * c_win = get_window(
|
|
1251
|
-
int windelay = NUM2INT(rb_iv_get(
|
|
1252
|
-
if (wmove(c_win, NUM2INT(
|
|
1257
|
+
static VALUE rbncurs_mvwgetch(VALUE dummy, VALUE rb_win, VALUE rb_y, VALUE rb_x) {
|
|
1258
|
+
WINDOW * c_win = get_window(rb_win);
|
|
1259
|
+
int windelay = NUM2INT(rb_iv_get(rb_win, "@timeout"));
|
|
1260
|
+
if (wmove(c_win, NUM2INT(rb_y), NUM2INT(rb_x)) == ERR)
|
|
1253
1261
|
return INT2NUM(ERR);
|
|
1254
1262
|
return INT2NUM(rbncurshelper_nonblocking_wgetch(c_win, windelay));
|
|
1255
1263
|
}
|
|
@@ -1442,7 +1450,9 @@ static VALUE rbncurs_slk_init(VALUE dummy, VALUE arg1) {
|
|
|
1442
1450
|
return INT2NUM(slk_init(NUM2INT(arg1)));
|
|
1443
1451
|
}
|
|
1444
1452
|
static VALUE rbncurs_slk_label(VALUE dummy, VALUE arg1) {
|
|
1445
|
-
|
|
1453
|
+
char * str = slk_label(NUM2INT(arg1));
|
|
1454
|
+
if (str == NULL) return Qnil;
|
|
1455
|
+
return rb_str_new2(str);
|
|
1446
1456
|
}
|
|
1447
1457
|
static VALUE rbncurs_slk_noutrefresh(VALUE dummy) {
|
|
1448
1458
|
return INT2NUM(slk_noutrefresh());
|
|
@@ -1495,7 +1505,9 @@ static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) {
|
|
|
1495
1505
|
#endif
|
|
1496
1506
|
#ifdef HAVE_TIGETSTR
|
|
1497
1507
|
static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) {
|
|
1498
|
-
|
|
1508
|
+
char * str = tigetstr(STR2CSTR(arg1));
|
|
1509
|
+
if (str == NULL || str == (char *)-1) return Qnil;
|
|
1510
|
+
return rb_str_new2(str);
|
|
1499
1511
|
}
|
|
1500
1512
|
#endif
|
|
1501
1513
|
static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) {
|
|
@@ -2078,7 +2090,6 @@ static void init_functions_2(void) {
|
|
|
2078
2090
|
NCFUNC(wvline, 3);
|
|
2079
2091
|
NCFUNC(color_content, 4);
|
|
2080
2092
|
NCFUNC(pair_content, 3);
|
|
2081
|
-
NCFUNC(pair_content, 3);
|
|
2082
2093
|
#ifdef HAVE_GETWIN
|
|
2083
2094
|
NCFUNC(getwin, 1);
|
|
2084
2095
|
#endif
|
|
@@ -2375,7 +2386,7 @@ static VALUE rbncurs_mousemask(VALUE dummy, VALUE rb_newmask, VALUE rb_oldmask)
|
|
|
2375
2386
|
#ifdef HAVE_WENCLOSE
|
|
2376
2387
|
static VALUE rbncurs_wenclose(VALUE dummy, VALUE rb_win, VALUE rb_y, VALUE rb_x)
|
|
2377
2388
|
{
|
|
2378
|
-
return wenclose(get_window(rb_win), NUM2INT(rb_y), NUM2INT(
|
|
2389
|
+
return wenclose(get_window(rb_win), NUM2INT(rb_y), NUM2INT(rb_x))
|
|
2379
2390
|
? Qtrue : Qfalse;
|
|
2380
2391
|
}
|
|
2381
2392
|
#endif
|
|
@@ -2837,7 +2848,11 @@ void init_SCREEN_methods(void)
|
|
|
2837
2848
|
|
|
2838
2849
|
#ifdef HAVE_LOCALE_H
|
|
2839
2850
|
static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale)
|
|
2840
|
-
{
|
|
2851
|
+
{
|
|
2852
|
+
char * str = setlocale(NUM2INT(category), STR2CSTR(locale));
|
|
2853
|
+
if (str == NULL) return Qnil;
|
|
2854
|
+
return rb_str_new2(str);
|
|
2855
|
+
}
|
|
2841
2856
|
#endif
|
|
2842
2857
|
|
|
2843
2858
|
static void init_safe_functions(void)
|
|
@@ -2881,6 +2896,9 @@ void Init_ncursesw_bin(void)
|
|
|
2881
2896
|
}
|
|
2882
2897
|
static void Init_ncurses_full(void)
|
|
2883
2898
|
{
|
|
2899
|
+
static bool already_done = false;
|
|
2900
|
+
if (already_done) return;
|
|
2901
|
+
|
|
2884
2902
|
init_globals_1();
|
|
2885
2903
|
init_globals_2();
|
|
2886
2904
|
init_functions_0();
|
|
@@ -2898,4 +2916,6 @@ static void Init_ncurses_full(void)
|
|
|
2898
2916
|
#if defined(HAVE_MENU_H) || defined(HAVE_NCURSESW_MENU_H)
|
|
2899
2917
|
init_menu();
|
|
2900
2918
|
#endif
|
|
2919
|
+
|
|
2920
|
+
already_done = true;
|
|
2901
2921
|
}
|
data/panel_wrap.c
CHANGED
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
VALUE mPanel;
|
|
30
30
|
VALUE cPANEL;
|
|
31
31
|
|
|
32
|
+
static void panel_rb_mark(void * panel) {
|
|
33
|
+
const void * userptr = panel_userptr((PANEL*)panel);
|
|
34
|
+
if (userptr != NULL) rb_gc_mark((VALUE)userptr);
|
|
35
|
+
}
|
|
36
|
+
static const struct rb_data_type_struct panel_rbtype = {
|
|
37
|
+
.wrap_struct_name = "Ncurses::Panel::PANEL",
|
|
38
|
+
.function.dmark = panel_rb_mark,
|
|
39
|
+
};
|
|
32
40
|
static VALUE wrap_panel(PANEL* panel)
|
|
33
41
|
{
|
|
34
42
|
if (panel == 0) return Qnil;
|
|
@@ -37,7 +45,7 @@ static VALUE wrap_panel(PANEL* panel)
|
|
|
37
45
|
VALUE panel_adress = INT2NUM((long)(panel));
|
|
38
46
|
VALUE rb_panel = rb_hash_aref(panels_hash, panel_adress);
|
|
39
47
|
if (rb_panel == Qnil) {
|
|
40
|
-
rb_panel =
|
|
48
|
+
rb_panel = TypedData_Wrap_Struct(cPANEL, &panel_rbtype, panel);
|
|
41
49
|
rb_iv_set(rb_panel, "@destroyed", Qfalse);
|
|
42
50
|
rb_hash_aset(panels_hash, panel_adress, rb_panel);
|
|
43
51
|
}
|
|
@@ -52,7 +60,7 @@ static PANEL* get_panel(VALUE rb_panel)
|
|
|
52
60
|
rb_raise(rb_eRuntimeError, "Attempt to access a destroyed panel");
|
|
53
61
|
return 0;
|
|
54
62
|
}
|
|
55
|
-
|
|
63
|
+
TypedData_Get_Struct(rb_panel, PANEL, &panel_rbtype, panel);
|
|
56
64
|
return panel;
|
|
57
65
|
}
|
|
58
66
|
static VALUE rbncurs_c_del_panel(VALUE rb_panel) {
|
metadata
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ncursesw
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tobias Herzke
|
|
8
8
|
- Sup developers
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
11
|
date: 1980-01-01 00:00:00.000000000 Z
|
|
@@ -50,7 +49,6 @@ homepage: http://github.com/sup-heliotrope/ncursesw-ruby
|
|
|
50
49
|
licenses:
|
|
51
50
|
- LGPL-2.1
|
|
52
51
|
metadata: {}
|
|
53
|
-
post_install_message:
|
|
54
52
|
rdoc_options: []
|
|
55
53
|
require_paths:
|
|
56
54
|
- lib
|
|
@@ -65,8 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
65
63
|
- !ruby/object:Gem::Version
|
|
66
64
|
version: '0'
|
|
67
65
|
requirements: []
|
|
68
|
-
rubygems_version: 3.
|
|
69
|
-
signing_key:
|
|
66
|
+
rubygems_version: 3.7.2
|
|
70
67
|
specification_version: 4
|
|
71
68
|
summary: 'This wrapper provides access to the functions, macros, global variables
|
|
72
69
|
and constants of the ncurses library. These are mapped to a Ruby Module named "Ncurses": Functions
|