|
@@ -293,7 +293,7 @@ extern int def_shell_mode ( void );
|
293
|
293
|
extern int delay_output ( int );
|
294
|
294
|
/*extern int delch ( void );*/
|
295
|
295
|
/*extern int deleteln ( void );*/
|
296
|
|
-extern void delscreen ( SCREEN * );
|
|
296
|
+extern void delscreen ( SCREEN * );
|
297
|
297
|
extern int delwin ( WINDOW * );
|
298
|
298
|
extern WINDOW *derwin ( WINDOW *, int, int, int, int );
|
299
|
299
|
/*extern int doupdate ( void );*/
|
|
@@ -314,21 +314,21 @@ extern int halfdelay ( int );
|
314
|
314
|
extern bool has_colors ( void );
|
315
|
315
|
extern bool has_ic ( void );
|
316
|
316
|
extern bool has_il ( void );
|
317
|
|
-extern int hline ( chtype, int );
|
|
317
|
+//extern int hline ( chtype, int );
|
318
|
318
|
extern void idcok ( WINDOW *, bool );
|
319
|
319
|
extern int idlok ( WINDOW *, bool );
|
320
|
320
|
extern void immedok ( WINDOW *, bool );
|
321
|
|
-extern chtype inch ( void );
|
322
|
|
-extern int inchnstr ( chtype *, int );
|
323
|
|
-extern int inchstr ( chtype * );
|
|
321
|
+/*extern chtype inch ( void );*/
|
|
322
|
+/*extern int inchnstr ( chtype *, int );*/
|
|
323
|
+/*extern int inchstr ( chtype * );*/
|
324
|
324
|
extern WINDOW *initscr ( void );
|
325
|
325
|
extern int init_color ( short, short, short, short );
|
326
|
326
|
extern int init_pair ( short, short, short );
|
327
|
|
-extern int innstr ( char *, int );
|
328
|
|
-extern int insch ( chtype );
|
329
|
|
-extern int insnstr ( const char *, int );
|
330
|
|
-extern int insstr ( const char * );
|
331
|
|
-extern int instr ( char * );
|
|
327
|
+//extern int innstr ( char *, int );
|
|
328
|
+//extern int insch ( chtype );
|
|
329
|
+//extern int insnstr ( const char *, int );
|
|
330
|
+//extern int insstr ( const char * );
|
|
331
|
+//extern int instr ( char * );
|
332
|
332
|
extern int intrflush ( WINDOW *, bool );
|
333
|
333
|
extern bool isendwin ( void );
|
334
|
334
|
extern bool is_linetouched ( WINDOW *, int );
|
|
@@ -351,18 +351,18 @@ extern int mvderwin ( WINDOW *, int, int );
|
351
|
351
|
extern int mvgetch ( int, int );
|
352
|
352
|
extern int mvgetnstr ( int, int, char *, int );
|
353
|
353
|
extern int mvgetstr ( int, int, char * );
|
354
|
|
-extern int mvhline ( int, int, chtype, int );
|
355
|
|
-extern chtype mvinch ( int, int );
|
356
|
|
-extern int mvinchnstr ( int, int, chtype *, int );
|
357
|
|
-extern int mvinchstr ( int, int, chtype * );
|
358
|
|
-extern int mvinnstr ( int, int, char *, int );
|
359
|
|
-extern int mvinsch ( int, int, chtype );
|
360
|
|
-extern int mvinsnstr ( int, int, const char *, int );
|
361
|
|
-extern int mvinsstr ( int, int, const char * );
|
362
|
|
-extern int mvinstr ( int, int, char * );
|
363
|
|
-extern int mvprintw ( int, int, char *, ... );
|
|
354
|
+//extern int mvhline ( int, int, chtype, int );
|
|
355
|
+//extern chtype mvinch ( int, int );
|
|
356
|
+/*extern int mvinchnstr ( int, int, chtype *, int );*/
|
|
357
|
+/*extern int mvinchstr ( int, int, chtype * );*/
|
|
358
|
+/*extern int mvinnstr ( int, int, char *, int );*/
|
|
359
|
+//extern int mvinsch ( int, int, chtype );
|
|
360
|
+//extern int mvinsnstr ( int, int, const char *, int );
|
|
361
|
+//extern int mvinsstr ( int, int, const char * );
|
|
362
|
+//extern int mvinstr ( int, int, char * );
|
|
363
|
+//extern int mvprintw ( int, int, char *, ... );
|
364
|
364
|
extern int mvscanw ( int, int, char *, ... );
|
365
|
|
-extern int mvvline ( int, int, chtype, int );
|
|
365
|
+//extern int mvvline ( int, int, chtype, int );
|
366
|
366
|
/*extern int mvwaddch ( WINDOW *, int, int, const chtype );*/
|
367
|
367
|
/*extern int mvwaddchnstr ( WINDOW *, int, int, const chtype *, int );*/
|
368
|
368
|
/*extern int mvwaddchstr ( WINDOW *, int, int, const chtype * );*/
|
|
@@ -372,19 +372,19 @@ extern int mvvline ( int, int, chtype, int );
|
372
|
372
|
extern int mvwgetch ( WINDOW *, int, int );
|
373
|
373
|
extern int mvwgetnstr ( WINDOW *, int, int, char *, int );
|
374
|
374
|
extern int mvwgetstr ( WINDOW *, int, int, char * );
|
375
|
|
-extern int mvwhline ( WINDOW *, int, int, chtype, int );
|
|
375
|
+//extern int mvwhline ( WINDOW *, int, int, chtype, int );
|
376
|
376
|
extern int mvwin ( WINDOW *, int, int );
|
377
|
|
-extern chtype mvwinch ( WINDOW *, int, int );
|
378
|
|
-extern int mvwinchnstr ( WINDOW *, int, int, chtype *, int );
|
379
|
|
-extern int mvwinchstr ( WINDOW *, int, int, chtype * );
|
380
|
|
-extern int mvwinnstr ( WINDOW *, int, int, char *, int );
|
381
|
|
-extern int mvwinsch ( WINDOW *, int, int, chtype );
|
382
|
|
-extern int mvwinsnstr ( WINDOW *, int, int, const char *, int );
|
383
|
|
-extern int mvwinsstr ( WINDOW *, int, int, const char * );
|
384
|
|
-extern int mvwinstr ( WINDOW *, int, int, char * );
|
385
|
|
-extern int mvwprintw ( WINDOW *, int, int, char *, ... );
|
|
377
|
+//extern chtype mvwinch ( WINDOW *, int, int );
|
|
378
|
+//extern int mvwinchnstr ( WINDOW *, int, int, chtype *, int );
|
|
379
|
+//extern int mvwinchstr ( WINDOW *, int, int, chtype * );
|
|
380
|
+//extern int mvwinnstr ( WINDOW *, int, int, char *, int );
|
|
381
|
+//extern int mvwinsch ( WINDOW *, int, int, chtype );
|
|
382
|
+//extern int mvwinsnstr ( WINDOW *, int, int, const char *, int );
|
|
383
|
+//extern int mvwinsstr ( WINDOW *, int, int, const char * );
|
|
384
|
+//extern int mvwinstr ( WINDOW *, int, int, char * );
|
|
385
|
+//extern int mvwprintw ( WINDOW *, int, int, char *, ... );
|
386
|
386
|
extern int mvwscanw ( WINDOW *, int, int, char *, ... );
|
387
|
|
-extern int mvwvline ( WINDOW *, int, int, chtype, int );
|
|
387
|
+//extern int mvwvline ( WINDOW *, int, int, chtype, int );
|
388
|
388
|
extern int napms ( int );
|
389
|
389
|
extern WINDOW *newpad ( int, int );
|
390
|
390
|
extern WINDOW *newwin ( int, int, int, int );
|
|
@@ -461,11 +461,11 @@ extern int vid_attr ( attr_t, short, void * );
|
461
|
461
|
extern int vidattr ( chtype );
|
462
|
462
|
extern int vid_puts ( attr_t, short, void *, int ( *) ( int) );
|
463
|
463
|
extern int vidputs ( chtype, int ( *) ( int) );
|
464
|
|
-extern int vline ( chtype, int );
|
465
|
|
-extern int vwprintw ( WINDOW *, char *, va_list * );
|
466
|
|
-extern int vw_printw ( WINDOW *, char *, va_list * );
|
467
|
|
-extern int vwscanw ( WINDOW *, char *, va_list * );
|
468
|
|
-extern int vw_scanw ( WINDOW *, char *, va_list * );
|
|
464
|
+//extern int vline ( chtype, int );
|
|
465
|
+//extern int vwprintw ( WINDOW *, const char *, va_list );
|
|
466
|
+extern int vw_printw ( WINDOW *, const char *, va_list );
|
|
467
|
+extern int vwscanw ( WINDOW *, char *, va_list );
|
|
468
|
+extern int vw_scanw ( WINDOW *, char *, va_list );
|
469
|
469
|
extern int waddch ( WINDOW *, const chtype );
|
470
|
470
|
extern int waddchnstr ( WINDOW *, const chtype *, int );
|
471
|
471
|
/*extern int waddchstr ( WINDOW *, const chtype * );*/
|
|
@@ -494,17 +494,17 @@ extern int wgetch ( WINDOW * );
|
494
|
494
|
extern int wgetnstr ( WINDOW *, char *, int );
|
495
|
495
|
extern int wgetstr ( WINDOW *, char * );
|
496
|
496
|
extern int whline ( WINDOW *, chtype, int );
|
497
|
|
-extern chtype winch ( WINDOW * );
|
498
|
|
-extern int winchnstr ( WINDOW *, chtype *, int );
|
499
|
|
-extern int winchstr ( WINDOW *, chtype * );
|
500
|
|
-extern int winnstr ( WINDOW *, char *, int );
|
501
|
|
-extern int winsch ( WINDOW *, chtype );
|
502
|
|
-extern int winsnstr ( WINDOW *, const char *, int );
|
503
|
|
-extern int winsstr ( WINDOW *, const char * );
|
504
|
|
-extern int winstr ( WINDOW *, char * );
|
|
497
|
+//extern chtype winch ( WINDOW * );
|
|
498
|
+//extern int winchnstr ( WINDOW *, chtype *, int );
|
|
499
|
+//extern int winchstr ( WINDOW *, chtype * );
|
|
500
|
+//extern int winnstr ( WINDOW *, char *, int );
|
|
501
|
+//extern int winsch ( WINDOW *, chtype );
|
|
502
|
+//extern int winsnstr ( WINDOW *, const char *, int );
|
|
503
|
+//extern int winsstr ( WINDOW *, const char * );
|
|
504
|
+//extern int winstr ( WINDOW *, char * );
|
505
|
505
|
extern int wmove ( WINDOW *, int, int );
|
506
|
506
|
extern int wnoutrefresh ( WINDOW * );
|
507
|
|
-extern int wprintw ( WINDOW *, char *, ... );
|
|
507
|
+extern int wprintw ( WINDOW *, const char *, ... );
|
508
|
508
|
/*extern int wredrawln ( WINDOW *, int, int );*/
|
509
|
509
|
/*extern int wrefresh ( WINDOW * );*/
|
510
|
510
|
extern int wscanw ( WINDOW *, char *, ... );
|
|
@@ -582,68 +582,112 @@ static inline int deleteln ( void ) {
|
582
|
582
|
return wdeleteln( stdscr );
|
583
|
583
|
}
|
584
|
584
|
|
|
585
|
+static inline int hline ( chtype ch, int n ) {
|
|
586
|
+ return whline ( stdscr, ch, n );
|
|
587
|
+}
|
|
588
|
+
|
585
|
589
|
static inline int move ( int y, int x ) {
|
586
|
590
|
return wmove ( stdscr, y, x );
|
587
|
591
|
}
|
588
|
592
|
|
589
|
593
|
static inline int mvaddch ( int y, int x, const chtype ch ) {
|
590
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
591
|
|
- ? ERR : waddch( stdscr, ch ) );
|
|
594
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
595
|
+ ? waddch( stdscr, ch ) : ERR );
|
592
|
596
|
}
|
593
|
597
|
|
594
|
598
|
static inline int mvaddchnstr ( int y, int x, const chtype *chstr, int n ) {
|
595
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
596
|
|
- ? ERR : waddchnstr ( stdscr, chstr, n ) );
|
|
599
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
600
|
+ ? waddchnstr ( stdscr, chstr, n ) : ERR );
|
597
|
601
|
}
|
598
|
602
|
|
599
|
603
|
static inline int mvaddchstr ( int y, int x, const chtype *chstr ) {
|
600
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
601
|
|
- ? ERR : waddchnstr ( stdscr, chstr, -1 ) );
|
|
604
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
605
|
+ ? waddchnstr ( stdscr, chstr, -1 ) : ERR );
|
602
|
606
|
}
|
603
|
607
|
|
604
|
608
|
static inline int mvaddnstr ( int y, int x, const char *str, int n ) {
|
605
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
606
|
|
- ? ERR : waddnstr ( stdscr, str, n ) );
|
|
609
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
610
|
+ ? waddnstr ( stdscr, str, n ) : ERR );
|
607
|
611
|
}
|
608
|
612
|
|
609
|
613
|
static inline int mvaddstr ( int y, int x, const char *str ) {
|
610
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
611
|
|
- ? ERR : waddnstr ( stdscr, str, -1 ) );
|
|
614
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
615
|
+ ? waddnstr ( stdscr, str, -1 ) : ERR );
|
612
|
616
|
}
|
613
|
617
|
|
614
|
618
|
static inline int mvdelch ( int y, int x ) {
|
615
|
|
- return ( wmove ( stdscr, y, x ) == ERR
|
616
|
|
- ? ERR : wdelch ( stdscr ) );
|
|
619
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
620
|
+ ? wdelch ( stdscr ) : ERR );
|
|
621
|
+}
|
|
622
|
+
|
|
623
|
+static inline int mvhline ( int y, int x, chtype ch, int n ) {
|
|
624
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
625
|
+ ? whline ( stdscr, ch, n ) : ERR );
|
|
626
|
+}
|
|
627
|
+
|
|
628
|
+// OK, so maybe a few I did with macros...
|
|
629
|
+#define mvprintw( y, x, fmt, ... ) \
|
|
630
|
+ ( wmove(stdscr,(y),(x)) == OK \
|
|
631
|
+ ? wprintw(stdscr,(fmt), ## __VA_ARGS__ : ERR )
|
|
632
|
+
|
|
633
|
+static inline int mvvline ( int y, int x, chtype ch, int n ) {
|
|
634
|
+ return ( wmove ( stdscr, y, x ) == OK
|
|
635
|
+ ? wvline ( stdscr, ch, n ) : ERR );
|
617
|
636
|
}
|
618
|
637
|
|
619
|
638
|
static inline int mvwaddch ( WINDOW *win, int y, int x, const chtype ch ) {
|
620
|
|
- return ( wmove( win, y, x ) == ERR
|
621
|
|
- ? ERR : waddch ( win, ch ) );
|
|
639
|
+ return ( wmove( win, y, x ) == OK
|
|
640
|
+ ? waddch ( win, ch ) : ERR );
|
622
|
641
|
}
|
623
|
642
|
|
624
|
643
|
static inline int mvwaddchnstr ( WINDOW *win, int y, int x, const chtype *chstr, int n ) {
|
625
|
|
- return ( wmove ( win, y, x ) == ERR
|
626
|
|
- ? ERR : waddchnstr ( win, chstr, n ) );
|
|
644
|
+ return ( wmove ( win, y, x ) == OK
|
|
645
|
+ ? waddchnstr ( win, chstr, n ) : ERR );
|
627
|
646
|
}
|
628
|
647
|
|
629
|
648
|
static inline int mvwaddchstr ( WINDOW *win, int y, int x, const chtype *chstr ) {
|
630
|
|
- return ( wmove ( win, y, x ) == ERR
|
631
|
|
- ? ERR : waddchnstr ( win, chstr, -1 ) );
|
|
649
|
+ return ( wmove ( win, y, x ) == OK
|
|
650
|
+ ? waddchnstr ( win, chstr, -1 ) : ERR );
|
632
|
651
|
}
|
633
|
652
|
|
634
|
653
|
static inline int mvwaddnstr ( WINDOW *win, int y, int x, const char *str, int n ) {
|
635
|
|
- return ( wmove ( win, y, x ) == ERR
|
636
|
|
- ? ERR : waddnstr ( win, str, n ) );
|
|
654
|
+ return ( wmove ( win, y, x ) == OK
|
|
655
|
+ ? waddnstr ( win, str, n ) : ERR );
|
637
|
656
|
}
|
638
|
657
|
|
639
|
658
|
static inline int mvwaddstr ( WINDOW *win, int y, int x, const char *str ) {
|
640
|
|
- return ( wmove ( win, y, x ) == ERR
|
641
|
|
- ? ERR : waddnstr ( win, str, -1 ) );
|
|
659
|
+ return ( wmove ( win, y, x ) == OK
|
|
660
|
+ ? waddnstr ( win, str, -1 ) : ERR );
|
642
|
661
|
}
|
643
|
662
|
|
644
|
663
|
static inline int mvwdelch ( WINDOW *win, int y, int x ) {
|
645
|
|
- return ( wmove ( win, y, x ) == ERR
|
646
|
|
- ? ERR : wdelch ( win ) );
|
|
664
|
+ return ( wmove ( win, y, x ) == OK
|
|
665
|
+ ? wdelch ( win ) : ERR );
|
|
666
|
+}
|
|
667
|
+
|
|
668
|
+static inline int mvwhline ( WINDOW *win, int y, int x, chtype ch, int n ) {
|
|
669
|
+ return ( wmove ( win, y, x ) == OK
|
|
670
|
+ ? whline ( win, ch, n ) : ERR );
|
|
671
|
+}
|
|
672
|
+
|
|
673
|
+#define mvwprintw( win, y, x, fmt, ... ) \
|
|
674
|
+ ( wmove((win),(y),(x)) == OK \
|
|
675
|
+ ? wprintw((win),(fmt), ## __VA_ARGS__) : ERR )
|
|
676
|
+
|
|
677
|
+static inline int mvwvline ( WINDOW *win, int y, int x, chtype ch, int n ) {
|
|
678
|
+ return ( wmove ( win, y, x ) == OK
|
|
679
|
+ ? wvline ( win, ch, n ) : ERR );
|
|
680
|
+}
|
|
681
|
+
|
|
682
|
+#define printw( fmt, ... ) wprintw(stdscr,(fmt), ## __VA_ARGS__ )
|
|
683
|
+
|
|
684
|
+static inline int vline ( chtype ch, int n ) {
|
|
685
|
+ return wvline ( stdscr, ch, n );
|
|
686
|
+}
|
|
687
|
+
|
|
688
|
+// marked for removal
|
|
689
|
+static inline int vwprintw ( WINDOW *win, const char *fmt, va_list varglist ) {
|
|
690
|
+ return vw_printw ( win, fmt, varglist );
|
647
|
691
|
}
|
648
|
692
|
|
649
|
693
|
static inline int waddchstr ( WINDOW *win, const chtype *chstr ) {
|