Separated tty drivers for mbsebbs and mbnewusr
This commit is contained in:
@@ -7,7 +7,7 @@ include ../Makefile.global
|
||||
SRCS = signature.c filesub.c language.c mbtoberep.c \
|
||||
msgutil.c oneline.c bbslist.c morefile.c \
|
||||
email.c fsedit.c lineedit.c mblang.c mbuser.c page.c \
|
||||
bye.c funcs.c mail.c \
|
||||
bye.c funcs.c mail.c term.c \
|
||||
newuser.c pinfo.c timecheck.c change.c \
|
||||
exitinfo.c mball.c mbsebbs.c menu.c pop3.c lastcallers.c \
|
||||
timeout.c chat.c file.c mbstat.c misc.c \
|
||||
@@ -16,7 +16,7 @@ SRCS = signature.c filesub.c language.c mbtoberep.c \
|
||||
HDRS = signature.h filesub.h language.h mbsebbs.h misc.h offline.h \
|
||||
timeout.h bbslist.h email.h fsedit.h lineedit.h \
|
||||
mbstat.h msgutil.h oneline.h user.h bye.h morefile.h \
|
||||
funcs.h mail.h mbuser.h page.h \
|
||||
funcs.h mail.h mbuser.h page.h term.h \
|
||||
change.h exitinfo.h mball.h newuser.h \
|
||||
pinfo.h chat.h file.h menu.h \
|
||||
pop3.h timecheck.h mbnewusr.h input.h whoson.h \
|
||||
@@ -26,10 +26,10 @@ MBSEBBS_OBJS = signature.o bbslist.o chat.o file.o funcs.o mail.o menu.o \
|
||||
bye.o change.o mbsebbs.o timeout.o user.o timecheck.o \
|
||||
exitinfo.o filesub.o lineedit.o offline.o language.o msgutil.o \
|
||||
pop3.o email.o input.o whoson.o door.o dispfile.o userlist.o timestats.o \
|
||||
logentry.o morefile.o lastcallers.o
|
||||
logentry.o morefile.o lastcallers.o term.o
|
||||
MBSEBBS_LIBS = ../lib/libmbse.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a
|
||||
MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o \
|
||||
timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o \
|
||||
timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o term.o \
|
||||
filesub.o mail.o email.o msgutil.o pop3.o lineedit.o fsedit.o whoson.o
|
||||
MBNEWUSR_LIBS = ../lib/libmbse.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a
|
||||
MBALL_OBJS = mball.o
|
||||
@@ -118,46 +118,47 @@ depend:
|
||||
|
||||
# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
|
||||
# Dependencies generated by make depend
|
||||
signature.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h signature.h funcs.h input.h language.h timeout.h
|
||||
filesub.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h funcs.h language.h input.h misc.h timeout.h exitinfo.h change.h
|
||||
language.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h
|
||||
signature.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h signature.h funcs.h input.h language.h timeout.h term.h
|
||||
filesub.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h funcs.h language.h input.h misc.h timeout.h exitinfo.h change.h term.h
|
||||
language.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h term.h
|
||||
mbtoberep.o: ../config.h ../lib/mbselib.h
|
||||
msgutil.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h oneline.h msgutil.h
|
||||
oneline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h funcs.h input.h language.h
|
||||
bbslist.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h bbslist.h funcs.h input.h language.h
|
||||
oneline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h funcs.h input.h language.h term.h
|
||||
bbslist.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h bbslist.h funcs.h input.h language.h term.h
|
||||
morefile.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h morefile.h timeout.h
|
||||
email.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h
|
||||
fsedit.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mail.h input.h language.h timeout.h pinfo.h fsedit.h
|
||||
lineedit.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mail.h input.h language.h timeout.h lineedit.h
|
||||
email.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h term.h
|
||||
fsedit.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mail.h input.h language.h timeout.h pinfo.h fsedit.h term.h
|
||||
lineedit.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mail.h input.h language.h timeout.h lineedit.h term.h
|
||||
mblang.o: ../config.h ../lib/mbselib.h
|
||||
mbuser.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h mbuser.h
|
||||
page.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h
|
||||
bye.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/nodelist.h dispfile.h misc.h language.h bye.h
|
||||
page.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h term.h
|
||||
bye.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/nodelist.h dispfile.h misc.h language.h bye.h term.h
|
||||
funcs.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h funcs.h
|
||||
mail.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/nodelist.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h
|
||||
newuser.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h
|
||||
pinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h pinfo.h input.h
|
||||
timecheck.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h
|
||||
change.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h
|
||||
mail.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/nodelist.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h term.h
|
||||
term.o: ../config.h ../lib/mbselib.h ../lib/users.h term.h
|
||||
newuser.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h term.h
|
||||
pinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h pinfo.h input.h term.h
|
||||
timecheck.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h term.h
|
||||
change.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h term.h
|
||||
exitinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h language.h oneline.h misc.h bye.h timeout.h timecheck.h exitinfo.h
|
||||
mball.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h mball.h
|
||||
mbsebbs.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h
|
||||
menu.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h
|
||||
pop3.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbinet.h ../lib/msgtext.h ../lib/msg.h msgutil.h pop3.h
|
||||
lastcallers.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h lastcallers.h
|
||||
timeout.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h
|
||||
chat.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h chat.h funcs.h input.h language.h misc.h whoson.h
|
||||
file.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h
|
||||
mbsebbs.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h term.h
|
||||
menu.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h term.h
|
||||
pop3.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbinet.h ../lib/msgtext.h ../lib/msg.h msgutil.h pop3.h term.h
|
||||
lastcallers.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h lastcallers.h term.h
|
||||
timeout.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h term.h
|
||||
chat.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h chat.h funcs.h input.h language.h misc.h whoson.h term.h
|
||||
file.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h term.h
|
||||
mbstat.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h mbstat.h
|
||||
misc.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h language.h misc.h timeout.h exitinfo.h
|
||||
offline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/bluewave.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h
|
||||
user.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h
|
||||
mbnewusr.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h
|
||||
input.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h timeout.h language.h
|
||||
whoson.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h exitinfo.h whoson.h
|
||||
door.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h language.h input.h timeout.h exitinfo.h whoson.h door.h
|
||||
dispfile.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h funcs.h language.h oneline.h misc.h timeout.h timecheck.h exitinfo.h mail.h email.h input.h dispfile.h filesub.h
|
||||
userlist.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h userlist.h language.h input.h timeout.h
|
||||
timestats.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timestats.h funcs.h language.h input.h exitinfo.h
|
||||
offline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/bluewave.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h term.h
|
||||
user.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h term.h
|
||||
mbnewusr.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h term.h
|
||||
input.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h timeout.h language.h term.h
|
||||
whoson.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h exitinfo.h whoson.h term.h
|
||||
door.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h language.h input.h timeout.h exitinfo.h whoson.h door.h term.h
|
||||
dispfile.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msgtext.h ../lib/msg.h funcs.h language.h oneline.h misc.h timeout.h timecheck.h exitinfo.h mail.h email.h input.h dispfile.h filesub.h term.h
|
||||
userlist.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h userlist.h language.h input.h timeout.h term.h
|
||||
timestats.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timestats.h funcs.h language.h input.h exitinfo.h term.h
|
||||
logentry.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h logentry.h
|
||||
# End of generated dependencies
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include "funcs.h"
|
||||
#include "input.h"
|
||||
#include "language.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void BBS_Add(void)
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "misc.h"
|
||||
#include "language.h"
|
||||
#include "bye.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern pid_t mypid;
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "timeout.h"
|
||||
#include "exitinfo.h"
|
||||
#include "bye.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
int Chg_Language(int NewMode)
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "language.h"
|
||||
#include "misc.h"
|
||||
#include "whoson.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
int chat_with_sysop = FALSE; /* Global sysop chat flag */
|
||||
|
@@ -46,7 +46,7 @@
|
||||
#include "input.h"
|
||||
#include "dispfile.h"
|
||||
#include "filesub.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "exitinfo.h"
|
||||
#include "whoson.h"
|
||||
#include "door.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern time_t t_start;
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#include "input.h"
|
||||
#include "email.h"
|
||||
#include "whoson.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
extern unsigned long LastNum;
|
||||
extern int Kludges;
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include "whoson.h"
|
||||
#include "change.h"
|
||||
#include "dispfile.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern long arecno; /* File area number in xxxScan() functions */
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "timeout.h"
|
||||
#include "exitinfo.h"
|
||||
#include "change.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern pid_t mypid;
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include "timeout.h"
|
||||
#include "pinfo.h"
|
||||
#include "fsedit.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void Show_Ins(void)
|
||||
{
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "input.h"
|
||||
#include "timeout.h"
|
||||
#include "language.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "../lib/users.h"
|
||||
#include "input.h"
|
||||
#include "language.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "input.h"
|
||||
#include "language.h"
|
||||
#include "lastcallers.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "language.h"
|
||||
#include "timeout.h"
|
||||
#include "lineedit.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern int Line;
|
||||
|
@@ -58,7 +58,7 @@
|
||||
#include "email.h"
|
||||
#include "door.h"
|
||||
#include "whoson.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -51,9 +51,9 @@ void ProgName()
|
||||
if (do_quiet)
|
||||
return;
|
||||
|
||||
colour(15, 0);
|
||||
mbse_colour(15, 0);
|
||||
printf("\nMBALL: MBSE BBS %s Allfiles Listing Creator\n", VERSION);
|
||||
colour(14, 0);
|
||||
mbse_colour(14, 0);
|
||||
printf(" %s\n", COPYRIGHT);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ void die(int onsig)
|
||||
Syslog(' ', "MBALL finished in %s", t_elapsed(t_start, t_end));
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
printf("\n");
|
||||
}
|
||||
ExitClient(onsig);
|
||||
@@ -107,18 +107,18 @@ void Help()
|
||||
do_quiet = FALSE;
|
||||
ProgName();
|
||||
|
||||
colour(11, 0);
|
||||
mbse_colour(11, 0);
|
||||
printf("\nUsage: mball [command] <options>\n\n");
|
||||
colour(9, 0);
|
||||
mbse_colour(9, 0);
|
||||
printf(" Commands are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" l list Create allfiles and newfiles lists\n");
|
||||
colour(9, 0);
|
||||
mbse_colour(9, 0);
|
||||
printf("\n Options are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" -q -quiet Quiet mode\n");
|
||||
printf(" -z -zip Create .zip archives\n");
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
printf("\n");
|
||||
die(MBERR_COMMANDLINE);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
|
||||
struct passwd *pw;
|
||||
|
||||
InitConfig();
|
||||
TermInit(1, 80, 24);
|
||||
mbse_TermInit(1, 80, 24);
|
||||
t_start = time(NULL);
|
||||
umask(000);
|
||||
|
||||
@@ -180,7 +180,7 @@ int main(int argc, char **argv)
|
||||
free(cmd);
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ void Masterlist()
|
||||
|
||||
if(( pAreas = fopen (sAreas, "r")) == NULL) {
|
||||
WriteError("Can't open File Areas File: %s", sAreas);
|
||||
colour(7,0);
|
||||
mbse_colour(7,0);
|
||||
die(MBERR_GENERAL);
|
||||
}
|
||||
fread(&areahdr, sizeof(areahdr), 1, pAreas);
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "misc.h"
|
||||
#include "timeout.h"
|
||||
#include "newuser.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "bye.h"
|
||||
#include "timeout.h"
|
||||
#include "funcs.h"
|
||||
#include "term.h"
|
||||
|
||||
#include <locale.h>
|
||||
#include <langinfo.h>
|
||||
|
@@ -44,20 +44,20 @@ void Help(void)
|
||||
do_quiet = FALSE;
|
||||
ProgName();
|
||||
|
||||
colour(11, 0);
|
||||
mbse_colour(11, 0);
|
||||
printf("\nUsage: mbstat [command] <options>\n\n");
|
||||
colour(9, 0);
|
||||
mbse_colour(9, 0);
|
||||
printf(" Commands are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" c close Close the BBS for users\n");
|
||||
printf(" o open Open the BBS for users\n");
|
||||
printf(" s set semafore Set named semafore\n");
|
||||
printf(" w wait Wait until the BBS is free\n\n");
|
||||
colour(9,0);
|
||||
mbse_colour(9,0);
|
||||
printf(" Options are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" -q -quiet Quiet, no screen output\n");
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
die(MBERR_COMMANDLINE);
|
||||
}
|
||||
|
||||
@@ -68,11 +68,11 @@ void ProgName(void)
|
||||
if (do_quiet)
|
||||
return;
|
||||
|
||||
colour(15, 0);
|
||||
mbse_colour(15, 0);
|
||||
printf("\nMBSTAT: MBSE BBS %s Status Changer\n", VERSION);
|
||||
colour(14, 0);
|
||||
mbse_colour(14, 0);
|
||||
printf(" %s\n", COPYRIGHT);
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void die(int onsig)
|
||||
WriteError("Terminated on signal %d", onsig);
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
|
||||
struct passwd *pw;
|
||||
|
||||
InitConfig();
|
||||
TermInit(1, 80, 24);
|
||||
mbse_TermInit(1, 80, 24);
|
||||
t_start = time(NULL);
|
||||
|
||||
/*
|
||||
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
|
||||
free(cmd);
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
|
||||
struct passwd *pw;
|
||||
|
||||
InitConfig();
|
||||
TermInit(1, 80, 24);
|
||||
mbse_TermInit(1, 80, 24);
|
||||
Days = 0;
|
||||
Level = 0;
|
||||
|
||||
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
|
||||
|
||||
oldmask = umask(027);
|
||||
if (!do_quiet)
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
UserPack(Days, Level, pack);
|
||||
umask(oldmask);
|
||||
|
||||
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
|
||||
Syslog(' ', "MBUSER finished in %s", t_elapsed(t_start, t_end));
|
||||
|
||||
if (!do_quiet)
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
ExitClient(MBERR_OK);
|
||||
return 0;
|
||||
}
|
||||
@@ -135,11 +135,11 @@ void ProgName(void)
|
||||
if (do_quiet)
|
||||
return;
|
||||
|
||||
colour(15, 0);
|
||||
mbse_colour(15, 0);
|
||||
printf("\nMBUSER: MBSE BBS %s - User maintenance utility\n", VERSION);
|
||||
colour(14, 0);
|
||||
mbse_colour(14, 0);
|
||||
printf(" %s\n\n", COPYRIGHT);
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,19 +149,19 @@ void Help(void)
|
||||
do_quiet = FALSE;
|
||||
ProgName();
|
||||
|
||||
colour(11, 0);
|
||||
mbse_colour(11, 0);
|
||||
printf("\nUsage: mbuser [commands] <options>\n\n");
|
||||
colour(9, 0);
|
||||
mbse_colour(9, 0);
|
||||
printf(" Commands are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" kill [n] [l] Kill users not called in \"n\" days below level \"l\"\n");
|
||||
printf(" pack Pack the userbase\n");
|
||||
colour(9, 0);
|
||||
mbse_colour(9, 0);
|
||||
printf("\n Options are:\n\n");
|
||||
colour(3, 0);
|
||||
mbse_colour(3, 0);
|
||||
printf(" -quiet Quiet mode, (no screen output)\n\n");
|
||||
|
||||
colour(7, 0);
|
||||
mbse_colour(7, 0);
|
||||
printf("\n");
|
||||
ExitClient(MBERR_COMMANDLINE);
|
||||
}
|
||||
|
@@ -59,6 +59,7 @@
|
||||
#include "morefile.h"
|
||||
#include "lastcallers.h"
|
||||
#include "signature.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern pid_t mypid;
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "timeout.h"
|
||||
#include "change.h"
|
||||
#include "dispfile.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -47,7 +47,7 @@
|
||||
#include "pop3.h"
|
||||
#include "offline.h"
|
||||
#include "whoson.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
long Total, TotalPersonal, Current, Personal;
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "funcs.h"
|
||||
#include "input.h"
|
||||
#include "language.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
char sOneliner[81];
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "timeout.h"
|
||||
#include "mail.h"
|
||||
#include "language.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern pid_t mypid;
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "../lib/users.h"
|
||||
#include "pinfo.h"
|
||||
#include "input.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void ls(int a)
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include "../lib/msg.h"
|
||||
#include "msgutil.h"
|
||||
#include "pop3.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void error_popmail(char *);
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "input.h"
|
||||
#include "language.h"
|
||||
#include "timeout.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
#define MAXSIGLINES 4
|
||||
|
249
mbsebbs/term.c
Normal file
249
mbsebbs/term.c
Normal file
@@ -0,0 +1,249 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
* Purpose ...............: Terminal output routines.
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2004
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
* 1971 BV IJmuiden
|
||||
* the Netherlands
|
||||
*
|
||||
* This file is part of MBSE BBS.
|
||||
*
|
||||
* This BBS is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* MBSE BBS is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with MBSE BBS; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "../config.h"
|
||||
#include "../lib/mbselib.h"
|
||||
#include "../lib/users.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
int termmode; /* 0 = tty, 1 = ANSI */
|
||||
int termx = 80;
|
||||
int termy = 24;
|
||||
|
||||
|
||||
void TermInit(int mode, int x, int y)
|
||||
{
|
||||
termmode = mode;
|
||||
termx = x;
|
||||
termy = y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Function will print about of enters specified
|
||||
*/
|
||||
void Enter(int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
fprintf(stdout, "\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void pout(int fg, int bg, char *Str)
|
||||
{
|
||||
colour(fg, bg);
|
||||
fprintf(stdout, Str);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void poutCenter(int fg, int bg, char *Str)
|
||||
{
|
||||
colour(fg, bg);
|
||||
Center(Str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void poutCR(int fg, int bg, char *Str)
|
||||
{
|
||||
colour(fg, bg);
|
||||
fputs(Str, stdout);
|
||||
fprintf(stdout, "\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Changes ansi background and foreground color
|
||||
*/
|
||||
void colour(int fg, int bg)
|
||||
{
|
||||
if (termmode == 1) {
|
||||
|
||||
int att=0, fore=37, back=40;
|
||||
|
||||
if (fg<0 || fg>31 || bg<0 || bg>7) {
|
||||
fprintf(stdout, "ANSI: Illegal colour specified: %i, %i\n", fg, bg);
|
||||
fflush(stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stdout, "[");
|
||||
if ( fg > WHITE) {
|
||||
fprintf(stdout, "5;");
|
||||
fg-= 16;
|
||||
}
|
||||
if (fg > LIGHTGRAY) {
|
||||
att=1;
|
||||
fg=fg-8;
|
||||
}
|
||||
|
||||
if (fg == BLACK) fore=30;
|
||||
else if (fg == BLUE) fore=34;
|
||||
else if (fg == GREEN) fore=32;
|
||||
else if (fg == CYAN) fore=36;
|
||||
else if (fg == RED) fore=31;
|
||||
else if (fg == MAGENTA) fore=35;
|
||||
else if (fg == BROWN) fore=33;
|
||||
else fore=37;
|
||||
|
||||
if (bg == BLUE) back=44;
|
||||
else if (bg == GREEN) back=42;
|
||||
else if (bg == CYAN) back=46;
|
||||
else if (bg == RED) back=41;
|
||||
else if (bg == MAGENTA) back=45;
|
||||
else if (bg == BROWN) back=43;
|
||||
else if (bg == LIGHTGRAY) back=47;
|
||||
else back=40;
|
||||
|
||||
fprintf(stdout, "%d;%d;%dm", att, fore, back);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Center(char *string)
|
||||
{
|
||||
int Strlen;
|
||||
int Maxlen = termx;
|
||||
int i, x, z;
|
||||
char *Str;
|
||||
|
||||
Str = calloc(1024, sizeof(char));
|
||||
Strlen = strlen(string);
|
||||
|
||||
if (Strlen == Maxlen)
|
||||
fprintf(stdout, "%s\n", string);
|
||||
else {
|
||||
x = Maxlen - Strlen;
|
||||
z = x / 2;
|
||||
for (i = 0; i < z; i++)
|
||||
strcat(Str, " ");
|
||||
strcat(Str, string);
|
||||
fprintf(stdout, "%s\n", Str);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
free(Str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void clear()
|
||||
{
|
||||
if (termmode == 1) {
|
||||
colour(LIGHTGRAY, BLACK);
|
||||
fprintf(stdout, ANSI_HOME);
|
||||
fprintf(stdout, ANSI_CLEAR);
|
||||
fflush(stdout);
|
||||
} else
|
||||
Enter(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Moves cursor to specified position
|
||||
*/
|
||||
void locate(int y, int x)
|
||||
{
|
||||
if (termmode > 0) {
|
||||
if (y > termy || x > termx) {
|
||||
fprintf(stdout, "ANSI: Invalid screen coordinates: %i, %i\n", y, x);
|
||||
fflush(stdout);
|
||||
return;
|
||||
}
|
||||
fprintf(stdout, "\x1B[%i;%iH", y, x);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void fLine(int Len)
|
||||
{
|
||||
int x;
|
||||
|
||||
if (termmode == 0)
|
||||
for (x = 0; x < Len; x++)
|
||||
fprintf(stdout, "-");
|
||||
|
||||
if (termmode == 1)
|
||||
for (x = 0; x < Len; x++)
|
||||
fprintf(stdout, "%c", 196);
|
||||
|
||||
fprintf(stdout, " \n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void sLine()
|
||||
{
|
||||
fLine(termx -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* curses compatible functions
|
||||
*/
|
||||
void mvprintw(int y, int x, const char *format, ...)
|
||||
{
|
||||
char *outputstr;
|
||||
va_list va_ptr;
|
||||
|
||||
outputstr = calloc(2048, sizeof(char));
|
||||
|
||||
va_start(va_ptr, format);
|
||||
vsprintf(outputstr, format, va_ptr);
|
||||
va_end(va_ptr);
|
||||
|
||||
locate(y, x);
|
||||
fprintf(stdout, outputstr);
|
||||
free(outputstr);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
18
mbsebbs/term.h
Normal file
18
mbsebbs/term.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _TERM_H
|
||||
#define _TERM_H
|
||||
|
||||
void TermInit(int, int, int);
|
||||
void Enter(int);
|
||||
void pout(int, int, char *);
|
||||
void poutCR(int, int, char *);
|
||||
void poutCenter(int,int,char *);
|
||||
void colour(int, int);
|
||||
void Center(char *);
|
||||
void clear(void);
|
||||
void locate(int, int);
|
||||
void fLine(int);
|
||||
void sLine(void);
|
||||
void mvprintw(int, int, const char *, ...);
|
||||
|
||||
|
||||
#endif
|
@@ -38,6 +38,7 @@
|
||||
#include "exitinfo.h"
|
||||
#include "language.h"
|
||||
#include "input.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern pid_t mypid; /* Pid of this program */
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "bye.h"
|
||||
#include "filesub.h"
|
||||
#include "language.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern int e_pid; /* Pid of external program */
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include "language.h"
|
||||
#include "input.h"
|
||||
#include "exitinfo.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void TimeStats()
|
||||
|
@@ -49,7 +49,7 @@
|
||||
#include "language.h"
|
||||
#include "offline.h"
|
||||
#include "email.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern int sock;
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include "language.h"
|
||||
#include "input.h"
|
||||
#include "timeout.h"
|
||||
|
||||
#include "term.h"
|
||||
|
||||
|
||||
void UserList(char *OpData)
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "language.h"
|
||||
#include "exitinfo.h"
|
||||
#include "whoson.h"
|
||||
#include "term.h"
|
||||
|
||||
|
||||
extern int LC_Download, LC_Upload, LC_Read, LC_Chat, LC_Olr, LC_Door;
|
||||
|
Reference in New Issue
Block a user