$Log$
+ 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)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
#endif
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
arg_screen = RC_DEFAULT;
#endif
#endif
}
if (!strcmp(argv[a], "-s")) {
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
arg_screen = RC_NO;
#endif
argc = shift(argc, argv, a, 1);
}
if (!strcmp(argv[a], "-S")) {
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
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
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
extern char rc_screen;
extern char arg_screen;
#endif
&& ((a < 32) || (a > 126)))
a = 0;
+#ifndef DISABLE_CURSES
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
if (a == ERR)
a = 0;
+#endif
#endif
} while (a == 0);
#ifdef HAVE_OPENSSL
rc_encrypt = RC_DEFAULT;
#endif
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
rc_screen = RC_DEFAULT;
#endif
rc_alt_semantics = 0;
#endif
}
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (!strncasecmp(buf, "fullscreen=", 11)) {
if (!strcasecmp(&buf[11], "yes"))
rc_screen = RC_YES;
current_color = colornum;
if (enable_color) {
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (scr_color(colornum))
return;
#endif
*-*-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*)
#include "citadel_decls.h"
#include "commands.h"
-#ifdef HAVE_CURSES_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;
+#endif
extern int screenheight;
extern int screenwidth;
extern int rc_ansi_color;
extern void check_screen_dims(void);
-#endif
void do_keepalive(void);
int is_curses_enabled(void) {
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
return mainwindow != NULL;
#else
return 0;
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow) {
if (secure) {
sln_printf("Encrypted ");
*/
void screen_new(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (arg_screen != RC_NO && rc_screen != RC_NO)
myscreen = newterm(NULL, stdout, stdin);
if (myscreen) {
{
windows_delete();
screen_reset();
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen)
delscreen(myscreen);
myscreen = NULL;
*/
int screen_set(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen) {
set_term(myscreen);
wrefresh(curscr);
*/
int screen_reset(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (myscreen) {
endwin();
return 1;
register int retval;
va_start(ap, fmt);
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
retval = _vwprintw(mainwindow, fmt, ap);
} else
register int retval;
va_start(ap, fmt);
-#ifdef HAVE_CURSES_H
+#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')
{
va_list ap;
register int retval;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
static char buf[4096];
#endif
va_start(ap, fmt);
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow) {
register char *i;
int sln_printf_if(char *fmt, ...)
{
register int retval = 1;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
static char buf[4096];
va_list ap;
{
unsigned char buf;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
wtimeout(mainwindow, delay);
return wgetch(mainwindow);
int scr_blockread(void)
{
int a = 0;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
wtimeout(mainwindow, S_KEEPALIVE);
while (1)
{
*/
int scr_putc(int c)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
if (c == 7) beep();
return ((waddch(mainwindow, c) == OK) ? c : EOF);
int sln_putc(int c)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
int sln_putc_if(int c)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
return ((waddch(statuswindow, c) == OK) ? c : EOF);
#endif
*/
int scr_color(int colornum)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) {
#ifdef HAVE_WCOLOR_SET
wcolor_set(mainwindow, (colornum & 7), NULL);
void scr_flush(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow)
wrefresh(mainwindow);
else
void err_flush(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow) /* FIXME: error status window needed */
wrefresh(mainwindow);
else
void sln_flush(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (statuswindow)
wrefresh(statuswindow);
else
*/
int scr_set_windowsize()
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow && caught_sigwinch) {
caught_sigwinch = 0;
#ifdef HAVE_RESIZETERM
*/
void windows_new(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
register int x, y;
if (myscreen) {
*/
void windows_delete(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (mainwindow)
delwin(mainwindow);
mainwindow = NULL;
/* client code may need the ERR define: */
+#ifndef DISABLE_CURSES
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#elif defined(HAVE_CURSES_H)
#include <curses.h>
#endif
+#endif
void status_line(const char *humannode, const char *bbs_city,
const char *room_name, int secure, int newmailcount);
#include "config.h"
#include "tools.h"
+#ifndef DISABLE_CURSES
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
-
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif
-
+#endif
#endif
#define MAXSETUP 3 /* How many setup questions to ask */
void cleanup(int exitcode)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
clear();
refresh();
/* Where on the screen to start */
/* Pointer to string buffer */
/* Maximum length - if negative, no-show */
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
void getlin(int yp, int xp, char *string, int lim) {
int a, b;
char flag;
{
char junk[5];
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
mvprintw(20, 0, "Press any key to continue... ");
refresh();
} while ((answer < 0) || (answer > 1));
break;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
do {
clear();
hit_any_key();
break;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
clear();
move(1, 20);
}
break;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
if (curr == 0) {
clear();
if (strlen(buf) != 0)
strcpy(str, buf);
break;
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
case UI_CURSES:
clear();
move(1, ((80 - strlen(setup_titles[msgpos])) / 2));
int discover_ui(void)
{
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
return UI_CURSES;
#endif
return UI_TEXT;
if (setup_type < 0) {
setup_type = discover_ui();
}
-#ifdef HAVE_CURSES_H
+#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
if (setup_type == UI_CURSES) {
initscr();
raw();