Removed all build script references to curses and ncurses.
I want all output to go through a single path.
./configure \
--with-db=/opt/csw/bdb44 \
--with-ical=/usr/local/ \
- --without-curses \
--with-prefix=/opt/csw/ \
--with-datadir=/opt/csw/var/lib/citadel \
--with-sysconfdir=/opt/csw/etc/citadel \
fi
]
)
-AC_ARG_WITH(ncurses, [ --without-ncurses don't use ncurses])
-
AC_ARG_WITH(with_ldap, [ --with-ldap use OpenLDAP client library])
dnl AC_ARG_WITH(with_libdspam, [ --with-libdspam use libdspam mail spam scanning library])
AC_ARG_WITH(with_gc, [ --with-gc use the Boehm-Demers-Weiser garbage collection library])
dnl TCP buffering isn't ideal under OS X. This define should also be
dnl checked in other cases of OS X-Linux differences.
*-*-darwin*)
- AC_DEFINE(DISABLE_CURSES,[],[define this to disable use of curses])
AC_DEFINE(HAVE_DARWIN, [], [define if using OS X/Darwin])
AC_MSG_RESULT([Mac OS X])
;;
fi
fi
-if test "x$with_ncurses" != "xno"; then
- AC_SEARCH_LIBS(tgetent, [ncurses curses termcap])
- AC_SEARCH_LIBS(scrollok, [ncurses curses])
- AC_SEARCH_LIBS(initscr, [ncurses curses])
-else
- AC_SEARCH_LIBS(tgetent, [curses termcap])
- AC_SEARCH_LIBS(initscr, [curses])
-fi
AC_CHECK_FUNCS(vw_printw wcolor_set resizeterm wresize)
dnl Check for libpthread(s) if we're not using Digital UNIX or FreeBSD. (On
dnl TODO: for the DB header checks, we should check whether the headers
dnl define db_env_create, somehow
dnl
-AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h malloc.h termios.h sys/ioctl.h sys/select.h sys/stat.h sys/time.h sys/prctl.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db4/db.h pthread.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h syscall.h sys/syscall.h)
-
-dnl
-dnl need to check if this is actually compilable, sometimes there are
-dnl conflicts with the system's headers (eg solaris xpg4 style headers)
-dnl
-if test "x$with_ncurses" != xno; then
- AC_CHECK_HEADERS(ncurses.h,,,[ ])
-fi
+AC_CHECK_HEADERS(dl.h fcntl.h limits.h malloc.h termios.h sys/ioctl.h sys/select.h sys/stat.h sys/time.h sys/prctl.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db4/db.h pthread.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h syscall.h sys/syscall.h)
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H, [], [define this if you have the resolv.h header file.]),,
[#ifdef HAVE_SYS_TYPES_H
Priority: extra
Maintainer: Wilfried Goesgens <w.goesgens@outgesourced.org>
Build-Depends: debhelper (>= 4), po-debconf, bison, autotools-dev,
- libdb-dev, libical-dev (>=0.43), libldap2-dev, libncurses5-dev,
+ libdb-dev, libical-dev (>=0.43), libldap2-dev,
libpam0g-dev, libsieve2-dev, libssl-dev, libexpat1-dev, libcitadel-dev (>= 7.42),
libcurl4-openssl-dev | libcurl3-openssl-dev, zlib1g-dev
Standards-Version: 3.8.0
}
static void statusHook(char *s) {
- sln_printf(s);
- sln_flush();
+ scr_printf(s);
+ scr_flush();
}
/*
eCrash_Init(¶ms);
#endif
setIPCDeathHook(screen_delete);
- setIPCErrorPrintf(err_printf);
+ setIPCErrorPrintf(scr_printf);
setCryptoStatusHook(statusHook);
/* Permissions sanity check - don't run citadel setuid/setgid */
if (getuid() != geteuid()) {
- err_printf("Please do not run citadel setuid!\n");
+ scr_printf("Please do not run citadel setuid!\n");
logoff(NULL, 3);
} else if (getgid() != getegid()) {
- err_printf("Please do not run citadel setgid!\n");
+ scr_printf("Please do not run citadel setgid!\n");
logoff(NULL, 3);
}
newprompt("Connect to (return for local server): ", hostbuf, 64);
#endif
- sln_printf("Attaching to server...\n");
+ scr_printf("Attaching to server...\n");
ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
if (!ipc) {
screen_delete();
}
if (!(ipc->isLocal)) {
- sln_printf("Connected to %s [%s].\n", ipc->ip_hostname, ipc->ip_address);
+ scr_printf("Connected to %s [%s].\n", ipc->ip_hostname, ipc->ip_address);
}
#if defined(HAVE_CURSES_H) && !defined(DISABLE_CURSES)
remove_march(marchptr->march_name, 0);
}
if (mcmd == 30) {
- sln_printf("\n\nType 'off' to disconnect, or next user...\n");
+ scr_printf("\n\nType 'off' to disconnect, or next user...\n");
}
CtdlIPCLogout(ipc);
if ((mcmd == 29) || (mcmd == 15)) {
strcpy(wbuf, "");
strcpy(last_user, "");
color(BRIGHT_YELLOW);
- sln_printf_if("\n");
- sln_printf("> ");
+ scr_printf("\n");
+ scr_printf("> ");
send_complete_line = 0;
while (1) {
- sln_flush();
+ scr_flush();
FD_ZERO(&rfds);
FD_SET(0, &rfds);
tv.tv_sec = 1;
} else if ((ch == 8) || (ch == 127)) {
if (!IsEmptyStr(wbuf)) {
wbuf[strlen(wbuf) - 1] = 0;
- sln_printf("%c %c", 8, 8);
+ scr_printf("%c %c", 8, 8);
}
} else {
- sln_putc(ch);
+ scr_putc(ch);
wbuf[strlen(wbuf) + 1] = 0;
wbuf[strlen(wbuf)] = ch;
}
CtdlIPC_chat_send(ipc, "RCHT exit");
CtdlIPC_chat_recv(ipc, response); /* don't care about the result */
color(BRIGHT_WHITE);
- sln_printf("\rExiting chat mode\n");
- sln_flush();
+ scr_printf("\rExiting chat mode\n");
+ scr_flush();
return;
}
seq = extract_int(&response[4], 0);
extract_token(c_user, &response[4], 2, '|', sizeof c_user);
while (CtdlIPC_chat_recv(ipc, c_text), strcmp(c_text, "000")) {
- sln_printf("\r%79s\r", "");
+ scr_printf("\r%79s\r", "");
if (!strcmp(c_user, fullname)) {
color(BRIGHT_YELLOW);
} else if (!strcmp(c_user, ":")) {
strcat(buf, " ");
}
if (strcmp(c_user, last_user)) {
- sln_printf("\r%79s\n", "");
+ scr_printf("\r%79s\n", "");
strcpy(last_user, c_user);
}
scr_printf("\r%s\n", buf);
}
}
color(BRIGHT_YELLOW);
- sln_printf("\r> %s", wbuf);
- sln_flush();
+ scr_printf("\r> %s", wbuf);
+ scr_flush();
strcpy(buf, "");
}
}
/* Space for a single word, which can be at most screenwidth */
word = (char *)calloc(1, width);
if (!word) {
- err_printf("Can't alloc memory to print message: %s!\n",
+ scr_printf("Can't alloc memory to print message: %s!\n",
strerror(errno));
logoff(NULL, 3);
}
if (fpin) {
buffer = load_message_from_file(fpin);
if (!buffer) {
- err_printf("Can't print message: %s!\n",
+ scr_printf("Can't print message: %s!\n",
strerror(errno));
logoff(NULL, 3);
}
r = CtdlIPCGetSingleMessage(ipc, num, (pagin == READ_HEADER ? 1 : 0), 4, &message, buf);
if (r / 100 != 1) {
- err_printf("*** msg #%ld: %d %s\n", num, r, buf);
+ scr_printf("*** msg #%ld: %d %s\n", num, r, buf);
++lines_printed;
lines_printed = checkpagin(lines_printed, pagin, screenheight);
stty_ctdl(0);
{
editor_path = editor_paths[0];
} else {
- err_printf("*** No editor available; using built-in editor.\n");
+ scr_printf("*** No editor available; using built-in editor.\n");
mode = 0;
}
}
} else {
fp = fopen(filename, "w");
if (fp == NULL) {
- err_printf("*** Error opening temp file!\n %s: %s\n",
+ scr_printf("*** Error opening temp file!\n %s: %s\n",
filename, strerror(errno)
);
return(1);
case 0:
fp = fopen(filename, "r+");
if (fp == NULL) {
- err_printf("*** Error opening temp file!\n %s: %s\n",
+ scr_printf("*** Error opening temp file!\n %s: %s\n",
filename, strerror(errno)
);
return(1);
case 1:
fp = fopen(filename, "a");
if (fp == NULL) {
- err_printf("*** Error opening temp file!\n"
+ scr_printf("*** Error opening temp file!\n"
" %s: %s\n",
filename, strerror(errno));
return(1);
MECR: if (mode >= 2) {
if (file_checksum(filename) == cksum) {
- err_printf("*** Aborted message.\n");
+ scr_printf("*** Aborted message.\n");
e_ex_code = 1;
}
if (e_ex_code == 0) {
fp = fopen(temp, "r");
if (!fp || !(message.text = load_message_from_file(fp))) {
- err_printf("*** Internal error while trying to save message!\n"
+ scr_printf("*** Internal error while trying to save message!\n"
"%s: %s\n",
temp, strerror(errno));
unlink(temp);
fp = fopen(pathname, "w");
if (!fp) {
- err_printf("Cannot open '%s': %s\n", pathname, strerror(errno));
+ scr_printf("Cannot open '%s': %s\n", pathname, strerror(errno));
return 0;
}
do {
fclose(fp);
if (bytes_written < filelen) {
- err_printf("Trouble saving '%s': %s\n", pathname,
+ scr_printf("Trouble saving '%s': %s\n", pathname,
strerror(errno));
return 0;
}
unsigned long a;
if (curr >= cmax) {
- sln_printf("\r%79s\r","");
+ scr_printf("\r%79s\r","");
} else {
/* a will be range 0-50 rather than 0-100 */
a=(curr * 50) / cmax;
sprintf(fmt, "[%%s%%%lds] %%3ld%%%% %%10ld/%%10ld\r", 50 - a);
strncpy(dots_printed, dots, a);
dots_printed[a] = 0;
- sln_printf(fmt, dots_printed, "",
+ scr_printf(fmt, dots_printed, "",
curr * 100 / cmax, curr, cmax);
- sln_flush();
+ scr_flush();
}
}
int ret;
ret = open(name, mode);
if (ret < 0) {
- err_printf("Cannot open file '%s', mode=%d, errno=%d\n",
+ scr_printf("Cannot open file '%s', mode=%d, errno=%d\n",
name, mode, errno);
interr(errno);
}
/* Can we upload this image? */
r = CtdlIPCImageUpload(ipc, 0, NULL, keyname, NULL, buf);
if (r / 100 != 2) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
return;
}
newprompt("Image file to be uploaded: ", flnm, 55);
r = CtdlIPCImageUpload(ipc, 1, flnm, keyname, progress, buf);
if (r / 100 == 5) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
} else if (r < 0) {
- err_printf("Cannot upload '%s': %s\n", flnm, strerror(errno));
+ scr_printf("Cannot upload '%s': %s\n", flnm, strerror(errno));
}
/* else upload succeeded */
}
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
execlp(getenv("SHELL"), getenv("SHELL"), NULL);
- err_printf("Could not open a shell: %s\n", strerror(errno));
+ scr_printf("Could not open a shell: %s\n", strerror(errno));
exit(errno);
}
do {
if (IsEmptyStr(filename))
return;
CtdlIPCDeleteFile(ipc, filename, buf);
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
return;
newprompt("Enter target room: ", newroom, ROOMNAMELEN - 1);
CtdlIPCMoveFile(ipc, filename, newroom, buf);
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
* scr_printf() outputs to the terminal
*/
int scr_printf(char *fmt, ...)
-{
- va_list ap;
- register int retval;
-
- va_start(ap, fmt);
- retval = vprintf(fmt, ap);
- va_end(ap);
- return retval;
-}
-
-
-/*
- * err_printf() outputs to error status window (or stderr if not in curses)
- */
-int err_printf(char *fmt, ...)
-{
- va_list ap;
- register int retval;
-
- va_start(ap, fmt);
- retval = vfprintf(stderr, fmt, ap);
- va_end(ap);
- return retval;
-}
-
-
-/*
- * sln_printf() outputs to error status window (or stderr if not in curses)
- */
-int sln_printf(char *fmt, ...)
{
va_list ap;
register int retval;
/*
- * sln_printf_if() outputs to status window, no output if not in curses
+ * Read one character from the terminal
*/
-int sln_printf_if(char *fmt, ...)
-{
- register int retval = 1;
- return retval;
-}
-
-
int scr_getc(int delay)
{
unsigned char buf;
}
/*
- * scr_putc() outputs a single character
+ * Output one character to the terminal
*/
int scr_putc(int c)
{
}
-int sln_putc(int c)
-{
- return putc(c, stdout);
-}
-
-
-int sln_putc_if(int c)
-{
- return 1;
-}
-
-
/*
* scr_color() sets the window color for mainwindow
*/
}
-void err_flush(void)
-{
- fflush(stderr);
-}
-
-
-void sln_flush(void)
-{
- fflush(stdout);
-}
-
static volatile int caught_sigwinch = 0;
/*
/* 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 *site_location,
- const char *room_name, int secure, int newmailcount);
void screen_new(void);
void screen_delete(void);
int screen_set(void);
int screen_reset(void);
int scr_printf(char *fmt, ...);
-int err_printf(char *fmt, ...);
-int sln_printf(char *fmt, ...);
-int sln_printf_if(char *fmt, ...);
#define SCR_NOBLOCK 0
#define SCR_BLOCK -1
int scr_getc(int delay);
int scr_putc(int c);
-int sln_putc(int c);
int scr_color(int colornum);
void scr_flush(void);
-void err_flush(void);
-void sln_flush(void);
int scr_set_windowsize(CtdlIPC* ipc);
-void windows_new(void);
-void windows_delete(void);
int scr_blockread(void);
-int is_curses_enabled(void);
RETSIGTYPE scr_winch(int signum);
void wait_indicator(int state);
void ctdl_beep(void);
r += 1 + strlen(sc[a]);
resp = (char *)calloc(1, r);
if (!resp) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
for (a = 0; a < NUM_CONFIGS; a++) {
}
r = CtdlIPCSetSystemConfig(ipc, resp, buf);
if (r / 100 != 4) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
free(resp);
r = CtdlIPCSetMessageExpirationPolicy(ipc, 2, site_expirepolicy, buf);
if (r / 100 != 2) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
r = CtdlIPCSetMessageExpirationPolicy(ipc, 3, mbx_expirepolicy, buf);
if (r / 100 != 2) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
}
r += 1 + strlen(recs[i]);
resp = (char *)calloc(1, r);
if (!resp) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; i++) {
}
r = CtdlIPCSetSystemConfigByType(ipc, INTERNETCFG, resp, buf);
if (r / 100 != 4) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
} else {
scr_printf("Wrote %d records.\n", num_recs);
modified = 0;
tempfp = fopen(filename, "w");
if (tempfp == NULL) {
- err_printf("Cannot open %s: %s\n", filename, strerror(errno));
+ scr_printf("Cannot open %s: %s\n", filename, strerror(errno));
return;
}
}
if (file_checksum(filename) == cksum) {
- err_printf("*** No changes to save.\n");
+ scr_printf("*** No changes to save.\n");
e_ex_code = 1;
}
r += 1 + strlen(recs[i]);
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
r += 1 + strlen(recs[i]);
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
}
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
}
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {