Apple's bizarre linker into submission)
+ Revision 601.37 2002/10/19 08:18:06 error
+ * Disable any use of curses on Darwin (this is temporary until I beat
+ Apple's bizarre linker into submission)
+
Revision 601.36 2002/10/18 10:33:09 error
* More signed/unsigned fixes (for the new progress gauge)
Revision 601.36 2002/10/18 10:33:09 error
* More signed/unsigned fixes (for the new progress gauge)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
#endif
#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
#endif
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
arg_screen = RC_DEFAULT;
#endif
arg_screen = RC_DEFAULT;
#endif
#endif
}
if (!strcmp(argv[a], "-s")) {
#endif
}
if (!strcmp(argv[a], "-s")) {
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
arg_screen = RC_NO;
#endif
argc = shift(argc, argv, a, 1);
}
if (!strcmp(argv[a], "-S")) {
arg_screen = RC_NO;
#endif
argc = shift(argc, argv, a, 1);
}
if (!strcmp(argv[a], "-S")) {
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
arg_screen = RC_YES;
#endif
argc = shift(argc, argv, a, 1);
arg_screen = RC_YES;
#endif
argc = shift(argc, argv, a, 1);
extern char rc_encrypt; /* from the citadel.rc file */
extern char arg_encrypt; /* from the command line */
#endif
extern char rc_encrypt; /* from the citadel.rc file */
extern char arg_encrypt; /* from the command line */
#endif
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
extern char rc_screen;
extern char arg_screen;
#endif
extern char rc_screen;
extern char arg_screen;
#endif
&& ((a < 32) || (a > 126)))
a = 0;
&& ((a < 32) || (a > 126)))
a = 0;
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
if (a == ERR)
a = 0;
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
if (a == ERR)
a = 0;
#ifdef HAVE_OPENSSL
rc_encrypt = RC_DEFAULT;
#endif
#ifdef HAVE_OPENSSL
rc_encrypt = RC_DEFAULT;
#endif
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
rc_screen = RC_DEFAULT;
#endif
rc_alt_semantics = 0;
rc_screen = RC_DEFAULT;
#endif
rc_alt_semantics = 0;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (!strncasecmp(buf, "fullscreen=", 11)) {
if (!strcasecmp(&buf[11], "yes"))
rc_screen = RC_YES;
if (!strncasecmp(buf, "fullscreen=", 11)) {
if (!strcasecmp(&buf[11], "yes"))
rc_screen = RC_YES;
current_color = colornum;
if (enable_color) {
current_color = colornum;
if (enable_color) {
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (scr_color(colornum))
return;
#endif
if (scr_color(colornum))
return;
#endif
*-*-bsdi*)
AC_DEFINE(HAVE_NONREENTRANT_NETDB)
;;
*-*-bsdi*)
AC_DEFINE(HAVE_NONREENTRANT_NETDB)
;;
+ dnl Curses support on Mac OS X is kind of screwed at the moment.
+ *-*-darwin*)
+ AC_DEFINE(DISABLE_CURSES)
+ ;;
dnl Digital Unix has an odd way to build for pthreads, and we can't
dnl build pthreads programs with gcc due to header problems.
alpha*-dec-osf*)
dnl Digital Unix has an odd way to build for pthreads, and we can't
dnl build pthreads programs with gcc due to header problems.
alpha*-dec-osf*)
#include "citadel_decls.h"
#include "commands.h"
#include "citadel_decls.h"
#include "commands.h"
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
static SCREEN *myscreen = NULL;
static WINDOW *mainwindow = NULL;
static WINDOW *statuswindow = NULL;
char rc_screen;
char arg_screen;
static SCREEN *myscreen = NULL;
static WINDOW *mainwindow = NULL;
static WINDOW *statuswindow = NULL;
char rc_screen;
char arg_screen;
extern int screenheight;
extern int screenwidth;
extern int rc_ansi_color;
extern void check_screen_dims(void);
extern int screenheight;
extern int screenwidth;
extern int rc_ansi_color;
extern void check_screen_dims(void);
void do_keepalive(void);
int is_curses_enabled(void) {
void do_keepalive(void);
int is_curses_enabled(void) {
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
return mainwindow != NULL;
#else
return 0;
return mainwindow != NULL;
#else
return 0;
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount)
{
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow) {
if (secure) {
sln_printf("Encrypted ");
if (statuswindow) {
if (secure) {
sln_printf("Encrypted ");
*/
void screen_new(void)
{
*/
void screen_new(void)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (arg_screen != RC_NO && rc_screen != RC_NO)
myscreen = newterm(NULL, stdout, stdin);
if (myscreen) {
if (arg_screen != RC_NO && rc_screen != RC_NO)
myscreen = newterm(NULL, stdout, stdin);
if (myscreen) {
{
windows_delete();
screen_reset();
{
windows_delete();
screen_reset();
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen)
delscreen(myscreen);
myscreen = NULL;
if (myscreen)
delscreen(myscreen);
myscreen = NULL;
*/
int screen_set(void)
{
*/
int screen_set(void)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen) {
set_term(myscreen);
wrefresh(curscr);
if (myscreen) {
set_term(myscreen);
wrefresh(curscr);
*/
int screen_reset(void)
{
*/
int screen_reset(void)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen) {
endwin();
return 1;
if (myscreen) {
endwin();
return 1;
register int retval;
va_start(ap, fmt);
register int retval;
va_start(ap, fmt);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
retval = _vwprintw(mainwindow, fmt, ap);
} else
if (mainwindow) {
retval = _vwprintw(mainwindow, fmt, ap);
} else
register int retval;
va_start(ap, fmt);
register int retval;
va_start(ap, fmt);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) { /* FIXME: direct to error window */
retval = _vwprintw(mainwindow, fmt, ap);
if (fmt[strlen(fmt) - 1] == '\n')
if (mainwindow) { /* FIXME: direct to error window */
retval = _vwprintw(mainwindow, fmt, ap);
if (fmt[strlen(fmt) - 1] == '\n')
{
va_list ap;
register int retval;
{
va_list ap;
register int retval;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
static char buf[4096];
#endif
va_start(ap, fmt);
static char buf[4096];
#endif
va_start(ap, fmt);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow) {
register char *i;
if (statuswindow) {
register char *i;
int sln_printf_if(char *fmt, ...)
{
register int retval = 1;
int sln_printf_if(char *fmt, ...)
{
register int retval = 1;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
static char buf[4096];
va_list ap;
static char buf[4096];
va_list ap;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
wtimeout(mainwindow, delay);
return wgetch(mainwindow);
if (mainwindow) {
wtimeout(mainwindow, delay);
return wgetch(mainwindow);
int scr_blockread(void)
{
int a = 0;
int scr_blockread(void)
{
int a = 0;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
wtimeout(mainwindow, S_KEEPALIVE);
while (1)
{
wtimeout(mainwindow, S_KEEPALIVE);
while (1)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
if (c == 7) beep();
return ((waddch(mainwindow, c) == OK) ? c : EOF);
if (mainwindow) {
if (c == 7) beep();
return ((waddch(mainwindow, c) == OK) ? c : EOF);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
*/
int scr_color(int colornum)
{
*/
int scr_color(int colornum)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
#ifdef HAVE_WCOLOR_SET
wcolor_set(mainwindow, (colornum & 7), NULL);
if (mainwindow) {
#ifdef HAVE_WCOLOR_SET
wcolor_set(mainwindow, (colornum & 7), NULL);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow)
wrefresh(mainwindow);
else
if (mainwindow)
wrefresh(mainwindow);
else
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) /* FIXME: error status window needed */
wrefresh(mainwindow);
else
if (mainwindow) /* FIXME: error status window needed */
wrefresh(mainwindow);
else
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
wrefresh(statuswindow);
else
if (statuswindow)
wrefresh(statuswindow);
else
*/
int scr_set_windowsize()
{
*/
int scr_set_windowsize()
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow && caught_sigwinch) {
caught_sigwinch = 0;
#ifdef HAVE_RESIZETERM
if (mainwindow && caught_sigwinch) {
caught_sigwinch = 0;
#ifdef HAVE_RESIZETERM
*/
void windows_new(void)
{
*/
void windows_new(void)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
register int x, y;
if (myscreen) {
register int x, y;
if (myscreen) {
*/
void windows_delete(void)
{
*/
void windows_delete(void)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow)
delwin(mainwindow);
mainwindow = NULL;
if (mainwindow)
delwin(mainwindow);
mainwindow = NULL;
/* client code may need the ERR define: */
/* client code may need the ERR define: */
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#elif defined(HAVE_CURSES_H)
#include <curses.h>
#endif
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#elif defined(HAVE_CURSES_H)
#include <curses.h>
#endif
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount);
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount);
#include "config.h"
#include "tools.h"
#include "config.h"
#include "tools.h"
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif
#endif
#define MAXSETUP 3 /* How many setup questions to ask */
#endif
#define MAXSETUP 3 /* How many setup questions to ask */
void cleanup(int exitcode)
{
void cleanup(int exitcode)
{
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
clear();
refresh();
if (setup_type == UI_CURSES) {
clear();
refresh();
/* Where on the screen to start */
/* Pointer to string buffer */
/* Maximum length - if negative, no-show */
/* Where on the screen to start */
/* Pointer to string buffer */
/* Maximum length - if negative, no-show */
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
void getlin(int yp, int xp, char *string, int lim) {
int a, b;
char flag;
void getlin(int yp, int xp, char *string, int lim) {
int a, b;
char flag;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
mvprintw(20, 0, "Press any key to continue... ");
refresh();
if (setup_type == UI_CURSES) {
mvprintw(20, 0, "Press any key to continue... ");
refresh();
} while ((answer < 0) || (answer > 1));
break;
} while ((answer < 0) || (answer > 1));
break;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
do {
clear();
case UI_CURSES:
do {
clear();
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
clear();
move(1, 20);
case UI_CURSES:
clear();
move(1, 20);
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
if (curr == 0) {
clear();
case UI_CURSES:
if (curr == 0) {
clear();
if (strlen(buf) != 0)
strcpy(str, buf);
break;
if (strlen(buf) != 0)
strcpy(str, buf);
break;
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
clear();
move(1, ((80 - strlen(setup_titles[msgpos])) / 2));
case UI_CURSES:
clear();
move(1, ((80 - strlen(setup_titles[msgpos])) / 2));
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
return UI_CURSES;
#endif
return UI_TEXT;
return UI_CURSES;
#endif
return UI_TEXT;
if (setup_type < 0) {
setup_type = discover_ui();
}
if (setup_type < 0) {
setup_type = discover_ui();
}
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
initscr();
raw();
if (setup_type == UI_CURSES) {
initscr();
raw();