Skip to content

Commit bf0f5b6

Browse files
committed
Merge pull request #6 from msoucy/master
ACS and import fixes
2 parents e5d8df0 + 738d710 commit bf0f5b6

File tree

2 files changed

+48
-51
lines changed

2 files changed

+48
-51
lines changed

deimos/ncurses/curses.d

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module deimos.ncurses.curses;
4141
import std.c.stdio;
4242
import std.c.stddef; /* we want wchar_t */
4343
import std.c.stdarg; /* we need va_list */
44+
import core.stdc.config; /* we need c_ulong */
4445

4546
//#include <ncursesw/unctrl.h>
4647
public import deimos.ncurses.unctrl;
@@ -68,10 +69,9 @@ string NCURSES_VERSION = "5.7";
6869
extern (C)
6970
{
7071

71-
//TODO curses.h say chtype, mmask_t is a ulong, but that exhibits errors...
7272
/* types */
73-
alias uint chtype;
74-
alias uint mmask_t;
73+
alias c_ulong chtype;
74+
alias c_ulong mmask_t;
7575
alias chtype attr_t;
7676
alias int OPTIONS;
7777
alias void SCREEN;
@@ -160,82 +160,79 @@ __gshared chtype acs_map[256];
160160

161161

162162
/* acs symbols */
163-
///I couldn't make it perfect, this is the best that I have come up with...
164-
///Instead of calling ACS_VAR, you use ACS_VAR().
165-
///Close enough for now??
166163
/* VT100 symbols begin here */
167164

168-
auto ACS_ULCORNER()()
165+
@property auto ACS_ULCORNER()()
169166
{ return acs_map[cast(ubyte)'l']; }
170-
auto ACS_LLCORNER()()
167+
@property auto ACS_LLCORNER()()
171168
{ return acs_map[cast(ubyte)'m']; }
172-
auto ACS_URCORNER()()
169+
@property auto ACS_URCORNER()()
173170
{ return acs_map[cast(ubyte)'k']; }
174-
auto ACS_LRCORNER()()
171+
@property auto ACS_LRCORNER()()
175172
{ return acs_map[cast(ubyte)'j']; }
176-
auto ACS_LTEE()()
173+
@property auto ACS_LTEE()()
177174
{ return acs_map[cast(ubyte)'t']; }
178-
auto ACS_RTEE()()
175+
@property auto ACS_RTEE()()
179176
{ return acs_map[cast(ubyte)'u']; }
180-
auto ACS_BTEE()()
177+
@property auto ACS_BTEE()()
181178
{ return acs_map[cast(ubyte)'v']; }
182-
auto ACS_TTEE()()
179+
@property auto ACS_TTEE()()
183180
{ return acs_map[cast(ubyte)'w']; }
184-
auto ACS_HLINE()()
181+
@property auto ACS_HLINE()()
185182
{ return acs_map[cast(ubyte)'q']; }
186-
auto ACS_VLINE()()
183+
@property auto ACS_VLINE()()
187184
{ return acs_map[cast(ubyte)'x']; }
188-
auto ACS_PLUS()()
185+
@property auto ACS_PLUS()()
189186
{ return acs_map[cast(ubyte)'n']; }
190-
auto ACS_S1()()
187+
@property auto ACS_S1()()
191188
{ return acs_map[cast(ubyte)'o']; }
192-
auto ACS_S9()()
189+
@property auto ACS_S9()()
193190
{ return acs_map[cast(ubyte)'s']; }
194-
auto ACS_DIAMOND()()
191+
@property auto ACS_DIAMOND()()
195192
{ return acs_map[cast(ubyte)'`']; }
196-
auto ACS_CKBOARD()()
193+
@property auto ACS_CKBOARD()()
197194
{ return acs_map[cast(ubyte)'a']; }
198-
auto ACS_DEGREE()()
195+
@property auto ACS_DEGREE()()
199196
{ return acs_map[cast(ubyte)'f']; }
200-
auto ACS_PLMINUS()()
197+
@property auto ACS_PLMINUS()()
201198
{ return acs_map[cast(ubyte)'g']; }
202-
auto ACS_BULLET()()
199+
@property auto ACS_BULLET()()
203200
{ return acs_map[cast(ubyte)'~']; }
204201

205202
/* Teletype 5410v1 symbols begin here */
206-
auto ACS_LARROW()()
203+
@property auto ACS_LARROW()()
207204
{ return acs_map[cast(ubyte)',']; }
208-
auto ACS_RARROW()()
205+
@property auto ACS_RARROW()()
209206
{ return acs_map[cast(ubyte)'+'];}
210-
auto ACS_DARROW()()
207+
@property auto ACS_DARROW()()
211208
{ return acs_map[cast(ubyte)'.']; }
212-
auto ACS_UARROW()()
209+
@property auto ACS_UARROW()()
213210
{ return acs_map[cast(ubyte)'-']; }
214-
auto ACS_BOARD()()
211+
@property auto ACS_BOARD()()
215212
{ return acs_map[cast(ubyte)'h']; }
216-
auto ACS_LANTERN()()
213+
@property auto ACS_LANTERN()()
217214
{ return acs_map[cast(ubyte)'i']; }
218-
auto ACS_BLOCK()()
215+
@property auto ACS_BLOCK()()
219216
{ return acs_map[cast(ubyte)'0']; }
220217

221218
/*
222219
* These aren't documented, but a lot of System Vs have them anyway
223220
* (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
224221
* The ACS_names may not match AT&T's, our source didn't know them.
225222
*/
226-
auto ACS_S3()()
223+
@property auto ACS_S3()()
227224
{ return acs_map[cast(ubyte)'p']; }
228-
auto ACS_S7()()
225+
@property auto ACS_S7()()
229226
{ return acs_map[cast(ubyte)'r']; }
230-
auto ACS_LEQUAL()()
227+
@property auto ACS_LEQUAL()()
231228
{ return acs_map[cast(ubyte)'y']; }
232-
auto ACS_GEQUAL()()
229+
@property auto ACS_GEQUAL()()
233230
{ return acs_map[cast(ubyte)'z']; }
234-
auto ACS_PI()()
231+
@property auto ACS_PI()()
235232
{ return acs_map[cast(ubyte)'{']; }
236-
auto ACS_NEQUAL()()
233+
@property auto ACS_NEQUAL()()
237234
{ return acs_map[cast(ubyte)'|']; }
238-
auto ACS_STERLING()()
235+
@property auto ACS_STERLING()()
239236
{ return acs_map[cast(ubyte)'}']; }
240237

241238
/*
@@ -244,27 +241,27 @@ auto ACS_STERLING()()
244241
* be B (blank), S (single), D (double), or T (thick). The subset defined
245242
* here only uses B and S.
246243
*/
247-
auto ACS_BSSB()()
244+
@property auto ACS_BSSB()()
248245
{ return ACS_ULCORNER(); }
249-
auto ACS_SSBB()()
246+
@property auto ACS_SSBB()()
250247
{ return ACS_LLCORNER(); }
251-
auto ACS_BBSS()()
248+
@property auto ACS_BBSS()()
252249
{ return ACS_URCORNER(); }
253-
auto ACS_SBBS()()
250+
@property auto ACS_SBBS()()
254251
{ return ACS_LRCORNER(); }
255-
auto ACS_SBSS()()
252+
@property auto ACS_SBSS()()
256253
{ return ACS_RTEE(); }
257-
auto ACS_SSSB()()
254+
@property auto ACS_SSSB()()
258255
{ return ACS_LTEE(); }
259-
auto ACS_SSBS()()
256+
@property auto ACS_SSBS()()
260257
{ return ACS_BTEE(); }
261-
auto ACS_BSSS()()
258+
@property auto ACS_BSSS()()
262259
{ return ACS_TTEE(); }
263-
auto ACS_BSBS()()
260+
@property auto ACS_BSBS()()
264261
{ return ACS_HLINE(); }
265-
auto ACS_SBSB()()
262+
@property auto ACS_SBSB()()
266263
{ return ACS_VLINE(); }
267-
auto ACS_SSSS()()
264+
@property auto ACS_SSSS()()
268265
{ return ACS_PLUS(); }
269266

270267

@@ -814,7 +811,7 @@ int wattron(W:WINDOW, N:chtype)(W* win, N attrs)
814811
{ return wattr_on(win, cast(attr_t)attrs, null); }
815812
int wattroff(W:WINDOW, N:chtype)(W* win, N attrs)
816813
{ return wattr_off(win, attrs, null); }
817-
int wattrset(W:WINDOW, N:chtype)(W* win, N attrs)
814+
N wattrset(W:WINDOW, N:chtype)(W* win, N attrs)
818815
{ return win.attrs = attrs; }
819816
int wattr_get(W:WINDOW, A:attr_t, S:short, V:void)
820817
(W* win, A* attrs, S* pair, V* opts)

deimos/ncurses/ncurses.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
/****************************************************************************
3030
* Author: Jude "1100110" Young <[email protected]. *
3131
****************************************************************************/
32-
module deimos.ncurses.curses;
32+
module deimos.ncurses.ncurses;
3333

3434
public import deimos.ncurses.curses;

0 commit comments

Comments
 (0)