data
.depend
import
+config.status
+configure
+config.log
+config.cache
+sysdep.h.in
+1998-09-28 Nathan Bryant <bryant@cs.usm.maine.edu>
+ * configure.in, acconfig.h: new files; partially functional GNU
+ autoconf configure script. Run autoheader; autoconf; ./configure
+ --prefix=`pwd` to test.
+ * Makefile.tmpl: new file; this is what Makefile.in used to be. Used by
+ Configure.
+ * Makefile.in: modified to work with autoconf-style configure script
+ * Configure: modified to use Makefile.tmpl and generate autoconf-style
+ macros. Removed procfs detection. Pass -O2 to gcc, -O to other
+ compilers. Removed mknod/mkfifo detection; code should use mkfifo(3).
+ * citmail.c, msgform.c, netproc.c, routines.c, support.c, userlist.c,
+ whobbs.c: use HAVE_STRERROR macro rather than NO_STRERROR
+ * commands.c: use HAVE_TERMIOS_H macro rather than POSIX_TERMIO
+ * netproc.c: remove procfs stuff. simply attempt to kill the target
+ process with signal zero instead; this checks whether the process
+ exists.
+ * setup.c, useradmin.c: use HAVE_CURSES_H macro
+
Sun Sep 27 23:41:29 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* BOTH the old and new generation systems are being written to at
this point. Code that reads stuff is still using the old system.
#
########################################################################
+all: client server utils serv_modules
+
CLIENT_TARGETS=citadel whobbs
SERVER_TARGETS=citserver setup
-SERV_MODULES=$(MODDIR)/serv_chat.so $(MODDIR)/serv_test.so
+SERV_MODULES=modules/serv_chat.so modules/serv_test.so
UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
readlog rcit stats citmail netpoll mailinglist userlist
PROXY_TARGETS=proxy
+CFLAGS=@CFLAGS@ @DEFS@
+CC=@CC@
+SERVER_LFLAGS=@LIBS@
+CURSES=@CURSES@
client: $(CLIENT_TARGETS)
$(CC) $(CFLAGS) -c ipc_c_tcp.c
citadel.o: citadel.c
- $(CC) -O $(CFLAGS) -c citadel.c
+ $(CC) $(CFLAGS) -c citadel.c
rooms.o: rooms.c
- $(CC) -O $(CFLAGS) -c rooms.c
+ $(CC) $(CFLAGS) -c rooms.c
messages.o: messages.c
- $(CC) -O $(CFLAGS) -c messages.c
+ $(CC) $(CFLAGS) -c messages.c
commands.o: commands.c
- $(CC) -O $(CFLAGS) -c commands.c
+ $(CC) $(CFLAGS) -c commands.c
routines.o: routines.c
- $(CC) -O $(CFLAGS) -c routines.c
+ $(CC) $(CFLAGS) -c routines.c
routines2.o: routines2.c
- $(CC) -O $(CFLAGS) -c routines2.c
+ $(CC) $(CFLAGS) -c routines2.c
client_chat.o: client_chat.c
- $(CC) -O $(CFLAGS) -c client_chat.c
+ $(CC) $(CFLAGS) -c client_chat.c
serv_info.o: serv_info.c
- $(CC) -O $(CFLAGS) -c serv_info.c
+ $(CC) $(CFLAGS) -c serv_info.c
#
locate_host.o: locate_host.c
$(CC) $(CFLAGS) -D_REENTRANT -c locate_host.c
-$(MODDIR)/serv_chat.so: serv_chat.o
- $(CC) -shared -o $(MODDIR)/serv_chat.so serv_chat.o
+modules/serv_chat.so: serv_chat.o
+ $(CC) -shared -o modules/serv_chat.so serv_chat.o
serv_chat.o: serv_chat.c
$(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_chat.c
-$(MODDIR)/serv_test.so: serv_test.o
- $(CC) -shared -o $(MODDIR)/serv_test.so serv_test.o
+modules/serv_test.so: serv_test.o
+ $(CC) -shared -o modules/serv_test.so serv_test.o
serv_test.o: serv_test.c
$(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_test.c
$(CC) $(CFLAGS) -D_REENTRANT -c logging.c
config.o: config.c
- $(CC) -O $(CFLAGS) -D_REENTRANT -c config.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c config.c
sysdep.o: sysdep.c
- $(CC) -O $(CFLAGS) -D_REENTRANT -c sysdep.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c sysdep.c
aidepost: aidepost.o config.o
$(CC) $(CFLAGS) aidepost.o config.o $(LFLAGS) -o aidepost
aidepost.o: aidepost.c
- $(CC) -O $(CFLAGS) -c aidepost.c
+ $(CC) $(CFLAGS) -c aidepost.c
#
# 'netmailer' needs to run setuid because it generates headers for Internet
chmod 4755 netmailer
netmailer.o: netmailer.c
- $(CC) -O $(CFLAGS) -c netmailer.c
+ $(CC) $(CFLAGS) -c netmailer.c
internetmail.o: internetmail.c
- $(CC) -O $(CFLAGS) -c internetmail.c
+ $(CC) $(CFLAGS) -c internetmail.c
netproc: netproc.o config.o ipc_c_tcp.o
- $(CC) -O $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
+ $(CC) $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
$(LFLAGS) -o netproc
netproc.o: netproc.c
- $(CC) -O $(CFLAGS) -c netproc.c
+ $(CC) $(CFLAGS) -c netproc.c
citmail: citmail.o config.o internetmail.o
#
chmod 4755 citmail
citmail.o: citmail.c
- $(CC) -O $(CFLAGS) -c citmail.c
+ $(CC) $(CFLAGS) -c citmail.c
mailinglist: mailinglist.o config.o internetmail.o
$(CC) $(CFLAGS) mailinglist.o config.o internetmail.o \
$(LFLAGS) -o mailinglist
mailinglist.o: mailinglist.c
- $(CC) -O $(CFLAGS) -c mailinglist.c
+ $(CC) $(CFLAGS) -c mailinglist.c
setup: setup.o
$(CC) $(CFLAGS) setup.o $(CURSES) $(LFLAGS) -o setup
setup.o: setup.c
- $(CC) -O $(CFLAGS) -c setup.c
+ $(CC) $(CFLAGS) -c setup.c
netsetup: netsetup.o config.o
$(CC) $(CFLAGS) netsetup.o config.o $(LFLAGS) -o netsetup
netsetup.o: netsetup.c
- $(CC) -O $(CFLAGS) -c netsetup.c
+ $(CC) $(CFLAGS) -c netsetup.c
proxy: proxy.o ipc_c_tcp.o
$(CC) $(CFLAGS) proxy.o ipc_c_tcp.o $(LFLAGS) -o proxy
proxy.o: proxy.c
- $(CC) -O $(CFLAGS) -c proxy.c
+ $(CC) $(CFLAGS) -c proxy.c
whobbs: whobbs.o ipc_c_tcp.o
$(CC) $(CFLAGS) whobbs.o ipc_c_tcp.o $(LFLAGS) -o whobbs
whobbs.o: whobbs.c
- $(CC) -O $(CFLAGS) -c whobbs.c
+ $(CC) $(CFLAGS) -c whobbs.c
userlist: userlist.o ipc_c_tcp.o
$(CC) $(CFLAGS) userlist.o ipc_c_tcp.o $(LFLAGS) -o userlist
userlist.o: userlist.c
- $(CC) -O $(CFLAGS) -c userlist.c
+ $(CC) $(CFLAGS) -c userlist.c
msgform: msgform.o
$(CC) $(CFLAGS) msgform.o $(LFLAGS) -o msgform
msgform.o: msgform.c
- $(CC) -O $(CFLAGS) -c msgform.c
+ $(CC) $(CFLAGS) -c msgform.c
readlog: readlog.o config.o
$(CC) $(CFLAGS) readlog.o config.o $(LFLAGS) -o readlog
readlog.o: readlog.c
- $(CC) -O $(CFLAGS) -c readlog.c
+ $(CC) $(CFLAGS) -c readlog.c
rcit: rcit.o config.o
$(CC) $(CFLAGS) rcit.o config.o $(LFLAGS) -o rcit
#
rcit.o: rcit.c
- $(CC) -O $(CFLAGS) -c rcit.c
+ $(CC) $(CFLAGS) -c rcit.c
stats: stats.o config.o
$(CC) $(CFLAGS) stats.o config.o $(LFLAGS) -o stats
stats.o: stats.c
- $(CC) -O $(CFLAGS) -c stats.c
+ $(CC) $(CFLAGS) -c stats.c
clean:
find . -name \*.[o] -print -exec rm -f {} \;
rm -f Makefile sysdep.h
.depend: $(wildcard *.c) $(wildcard *.h)
- gcc -MM *.c > .depend
+ $(CC) -MM *.c > .depend
--- /dev/null
+# Makefile for Citadel/UX
+#
+# NOTE: normally you should not have to modify the Makefile. All
+# system-dependent configuration is in the "Configure" script, which
+# uses "Makefile.tmpl" to generate a "Makefile". In the rare instance
+# that you have to modify something here, please take note:
+# 1. Edit Makefile.tmpl, -not- Makefile.
+# 2. Send e-mail to ajc@uncnsrd.mt-kisco.ny.us and let me know what you
+# did, so any necessary changes can be put into the next release.
+#
+########################################################################
+
+CLIENT_TARGETS=citadel whobbs
+SERVER_TARGETS=citserver setup
+SERV_MODULES=$(MODDIR)/serv_chat.so $(MODDIR)/serv_test.so
+UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
+ readlog rcit stats citmail netpoll mailinglist userlist
+PROXY_TARGETS=proxy
+
+client: $(CLIENT_TARGETS)
+
+server: $(SERVER_TARGETS)
+
+utils: $(UTIL_TARGETS)
+
+serv_modules: $(SERV_MODULES)
+
+#
+#
+
+citadel: ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
+ commands.o client_chat.o serv_info.o
+ $(CC) $(CFLAGS) ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o \
+ messages.o commands.o client_chat.o serv_info.o $(LFLAGS) -o citadel
+
+netpoll: netpoll.o config.o ipc_c_tcp.o
+ $(CC) $(CFLAGS) netpoll.o config.o ipc_c_tcp.o $(LFLAGS) -o netpoll
+
+netpoll.o: netpoll.c
+ $(CC) $(CFLAGS) -c netpoll.c
+
+ipc_c_tcp.o: ipc_c_tcp.c
+ $(CC) $(CFLAGS) -c ipc_c_tcp.c
+
+citadel.o: citadel.c
+ $(CC) $(CFLAGS) -c citadel.c
+
+rooms.o: rooms.c
+ $(CC) $(CFLAGS) -c rooms.c
+
+messages.o: messages.c
+ $(CC) $(CFLAGS) -c messages.c
+
+commands.o: commands.c
+ $(CC) $(CFLAGS) -c commands.c
+
+routines.o: routines.c
+ $(CC) $(CFLAGS) -c routines.c
+
+routines2.o: routines2.c
+ $(CC) $(CFLAGS) -c routines2.c
+
+client_chat.o: client_chat.c
+ $(CC) $(CFLAGS) -c client_chat.c
+
+serv_info.o: serv_info.c
+ $(CC) $(CFLAGS) -c serv_info.c
+
+
+#
+#
+
+citserver: citserver.o user_ops.o support.o room_ops.o file_ops.o \
+ msgbase.o config.o sysdep.o locate_host.o \
+ housekeeping.o database.o control.o logging.o \
+ dynloader.o
+ $(CC) $(CFLAGS) -rdynamic \
+ citserver.o user_ops.o room_ops.o file_ops.o support.o \
+ msgbase.o config.o sysdep.o locate_host.o \
+ housekeeping.o database.o control.o logging.o \
+ dynloader.o \
+ $(LFLAGS) $(SERVER_LFLAGS) -o citserver
+
+citserver.o: citserver.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c citserver.c
+
+user_ops.o: user_ops.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c user_ops.c
+
+room_ops.o: room_ops.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c room_ops.c
+
+dynloader.o: dynloader.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c dynloader.c
+
+file_ops.o: file_ops.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c file_ops.c
+
+support.o: support.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c support.c
+
+msgbase.o: msgbase.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c msgbase.c
+
+locate_host.o: locate_host.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c locate_host.c
+
+$(MODDIR)/serv_chat.so: serv_chat.o
+ $(CC) -shared -o $(MODDIR)/serv_chat.so serv_chat.o
+
+serv_chat.o: serv_chat.c
+ $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_chat.c
+
+$(MODDIR)/serv_test.so: serv_test.o
+ $(CC) -shared -o $(MODDIR)/serv_test.so serv_test.o
+
+serv_test.o: serv_test.c
+ $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_test.c
+
+housekeeping.o: housekeeping.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c housekeeping.c
+
+database.o: database.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c database.c
+
+control.o: control.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c control.c
+
+logging.o: logging.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c logging.c
+
+config.o: config.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c config.c
+
+sysdep.o: sysdep.c
+ $(CC) $(CFLAGS) -D_REENTRANT -c sysdep.c
+
+aidepost: aidepost.o config.o
+ $(CC) $(CFLAGS) aidepost.o config.o $(LFLAGS) -o aidepost
+
+aidepost.o: aidepost.c
+ $(CC) $(CFLAGS) -c aidepost.c
+
+#
+# 'netmailer' needs to run setuid because it generates headers for Internet
+# mail. If it is not run setuid, all outgoing mail may always show as coming
+# from your BBSUID rather than the actual sending user.
+#
+netmailer: netmailer.o internetmail.o config.o
+ $(CC) $(CFLAGS) netmailer.o config.o internetmail.o $(LFLAGS) -o netmailer
+ chmod 4755 netmailer
+
+netmailer.o: netmailer.c
+ $(CC) $(CFLAGS) -c netmailer.c
+
+internetmail.o: internetmail.c
+ $(CC) $(CFLAGS) -c internetmail.c
+
+netproc: netproc.o config.o ipc_c_tcp.o
+ $(CC) $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
+ $(LFLAGS) -o netproc
+
+netproc.o: netproc.c
+ $(CC) $(CFLAGS) -c netproc.c
+
+citmail: citmail.o config.o internetmail.o
+ #
+ # ###### IMPORTANT ######
+ # To allow Citadel users to receive Internet mail, you must
+ # set this program to be your local mail delivery agent.
+ #
+ $(CC) $(CFLAGS) citmail.o config.o internetmail.o $(LFLAGS) -o citmail
+ chmod 4755 citmail
+
+citmail.o: citmail.c
+ $(CC) $(CFLAGS) -c citmail.c
+
+mailinglist: mailinglist.o config.o internetmail.o
+ $(CC) $(CFLAGS) mailinglist.o config.o internetmail.o \
+ $(LFLAGS) -o mailinglist
+
+mailinglist.o: mailinglist.c
+ $(CC) $(CFLAGS) -c mailinglist.c
+
+setup: setup.o
+ $(CC) $(CFLAGS) setup.o $(CURSES) $(LFLAGS) -o setup
+
+setup.o: setup.c
+ $(CC) $(CFLAGS) $(CURSES_INC) -c setup.c
+
+netsetup: netsetup.o config.o
+ $(CC) $(CFLAGS) netsetup.o config.o $(LFLAGS) -o netsetup
+
+netsetup.o: netsetup.c
+ $(CC) $(CFLAGS) -c netsetup.c
+
+proxy: proxy.o ipc_c_tcp.o
+ $(CC) $(CFLAGS) proxy.o ipc_c_tcp.o $(LFLAGS) -o proxy
+
+proxy.o: proxy.c
+ $(CC) $(CFLAGS) -c proxy.c
+
+whobbs: whobbs.o ipc_c_tcp.o
+ $(CC) $(CFLAGS) whobbs.o ipc_c_tcp.o $(LFLAGS) -o whobbs
+
+whobbs.o: whobbs.c
+ $(CC) $(CFLAGS) -c whobbs.c
+
+userlist: userlist.o ipc_c_tcp.o
+ $(CC) $(CFLAGS) userlist.o ipc_c_tcp.o $(LFLAGS) -o userlist
+
+userlist.o: userlist.c
+ $(CC) $(CFLAGS) -c userlist.c
+
+msgform: msgform.o
+ $(CC) $(CFLAGS) msgform.o $(LFLAGS) -o msgform
+
+msgform.o: msgform.c
+ $(CC) $(CFLAGS) -c msgform.c
+
+readlog: readlog.o config.o
+ $(CC) $(CFLAGS) readlog.o config.o $(LFLAGS) -o readlog
+
+readlog.o: readlog.c
+ $(CC) $(CFLAGS) -c readlog.c
+
+rcit: rcit.o config.o
+ $(CC) $(CFLAGS) rcit.o config.o $(LFLAGS) -o rcit
+ #
+ # NOTE: TO RECEIVE CITADEL TRAFFIC VIA THE RCIT PROGRAM (ESPECIALLY
+ # IF YOU ARE GATEWAYING TO USENET) YOU MUST LINK RNEWS TO RCIT:
+ #ln -s rcit /usr/bin/rnews
+ #
+
+rcit.o: rcit.c
+ $(CC) $(CFLAGS) -c rcit.c
+
+stats: stats.o config.o
+ $(CC) $(CFLAGS) stats.o config.o $(LFLAGS) -o stats
+
+stats.o: stats.c
+ $(CC) $(CFLAGS) -c stats.c
+
+clean:
+ find . -name \*.[o] -print -exec rm -f {} \;
+
+cleaner: clean
+ rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
+ $(SERV_MODULES) $(PROXY_TARGETS)
+
+realclean: cleaner
+ rm -f Makefile sysdep.h
+
+.depend: $(wildcard *.c) $(wildcard *.h)
+ gcc -MM *.c > .depend
--- /dev/null
+/* define this to the bbs home directory */
+#undef BBSDIR
+
+/* define this to enable the autologin feature */
+#undef ENABLE_AUTOLOGIN
+
+/* define this to enable ANSI color */
+#undef ANSI_COLOR
}
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
#include <sys/types.h>
#include <sys/time.h>
-#ifdef POSIX_TERMIO
+#ifdef HAVE_TERMIOS_H
#include <termios.h>
#else
#include <sgtty.h>
* 2 - save current settings for later restoral
* 3 - restore saved settings
*/
-#ifdef POSIX_TERMIO
+#ifdef HAVE_TERMIOS_H
void sttybbs(int cmd) /* SysV version of sttybbs() */
{
struct termios live;
--- /dev/null
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.12)
+AC_INIT(citserver.c)
+AC_PREFIX_DEFAULT(/usr/local/citadel)
+if test "$prefix" = NONE; then
+ AC_DEFINE_UNQUOTED(BBSDIR, "$ac_default_prefix")
+else
+ AC_DEFINE_UNQUOTED(BBSDIR, "$prefix")
+fi
+
+AC_ARG_ENABLE(autologin, [ --disable-autologin disable autologin (default is enabled)],[if test "$enableval" = yes; then
+ AC_DEFINE(ENABLE_AUTOLOGIN)
+fi],AC_DEFINE(ENABLE_AUTOLOGIN))
+
+AC_ARG_ENABLE(ansi-color, [ --enable-ansi-color enable ANSI color (default is disabled)],[if test "$enableval" = yes; then
+ AC_DEFINE(ANSI_COLOR)
+fi])
+
+dnl Checks for programs.
+AC_PROG_CC
+if test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
+fi
+AC_PROG_RANLIB
+
+dnl Checks for libraries.
+AC_CHECK_LIB(crypt, crypt)
+AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_LIB(gdbm, gdbm_open)
+AC_CHECK_LIB(curses, initscr, CURSES=-lcurses)
+AC_CHECK_LIB(pthread, pthread_create)
+AC_CHECK_LIB(pthreads, pthread_create)
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(curses.h fcntl.h limits.h termios.h strings.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+
+dnl Checks for library functions.
+AC_FUNC_GETPGRP
+AC_PROG_GCC_TRADITIONAL
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(mkdir mktime rmdir select socket strerror)
+
+AC_SUBST(CURSES)
+AC_CONFIG_HEADER(sysdep.h)
+AC_OUTPUT(Makefile)
int fmout(int width, FILE *fp);
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
extern int home_specified;
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
*/
int set_lockfile(void) {
FILE *lfp;
- int ok = 1;
int onppid;
- char buf[64];
- if (access(LOCKFILE,0)==0) {
-
- /*
- * if the /proc filesystem is available, we can further check to
- * make sure that the process that wrote the lock file is actually
- * running, and didn't simply terminate and not clean up after itself
- */
-#ifdef HAVE_PROC_FS
- lfp = fopen(LOCKFILE,"r");
- fscanf(lfp,"%d",&onppid);
- fclose(lfp);
- sprintf(buf,"/proc/%d/cmdline",onppid);
- if (access(buf,0)==0) ok = 0;
-#else
- ok = 0;
-#endif
+ if ((lfp = fopen(LOCKFILE,"r")) != NULL) {
+ fscanf(lfp,"%d",&onppid);
+ fclose(lfp);
+ if (!kill(onppid, 0) || errno == EPERM) return 1;
}
- if (ok == 0) return(1);
lfp=fopen(LOCKFILE,"w");
fprintf(lfp,"%d\n",getpid());
fclose(lfp);
}
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
#include "sysdep.h"
#include "config.h"
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
# ifdef OK
# undef OK
# endif
-#include CURSES_INC
+#include <curses.h>
#endif
#define MAXSETUP 19
int direction;
void cleanup(int exitcode) {
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
if (setup_type == UI_CURSES) {
clear();
refresh();
}
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
void getlin(int yp, int xp, char *string, int lim) /* Gets a line from the terminal */
/* Where on the screen to start */
/* Pointer to string buffer */
void hit_any_key(void) {
char junk[5];
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
if (setup_type == UI_CURSES) {
mvprintw(20, 0, "Press any key to continue... ");
refresh();
sprintf(buf, "dialog --yesno \"%s\" 7 80", question);
answer = ( (system(buf)==0) ? 1 : 0);
break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
case UI_CURSES:
do {
clear();
title, msgtext);
system(buf);
break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
case UI_CURSES:
clear();
move(1, 20);
}
break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
case UI_CURSES:
if (curr==0) {
clear();
str[strlen(str)-1]=0;
}
break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
case UI_CURSES:
clear();
move(1, ((80-strlen(setup_titles[msgpos]))/2) );
*/
int discover_ui(void) {
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
return UI_CURSES;
#endif
setup_type = discover_ui();
}
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
if (setup_type == UI_CURSES) {
initscr();
raw();
}
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
-char *strerror(e)
-int e; {
+char *strerror(int e)
+{
static char buf[32];
sprintf(buf,"errno = %d",e);
}
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/
}
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
/*
* replacement strerror() for systems that don't have it
*/