Implemented bbs view archive/textfile

This commit is contained in:
Michiel Broek 2003-04-12 11:12:26 +00:00
parent cad87472f1
commit b3b4b5dcb5
18 changed files with 557 additions and 346 deletions

View File

@ -7,6 +7,23 @@ $Id$
v0.37.3 09-Apr-2003.
upgrade:
Remove ~/etc/archiver.data, start mbsetup menu 3, leave and
save. This updates the archiver view contents commands.
mbsetup:
The edit archiver has now an edit line for the view archive
commands.
mbsebbs:
Fixed recognition of tar.gz files.
Added menu function display file.
Display ascii textfiles now uses the More Y/n/= prompt.
lang:
New language prompt number 17.
Erased language prompts 18..36.
v0.37.2 23-Feb-2003 - 09-Apr-2003

4
TODO
View File

@ -1,6 +1,6 @@
$Id$
MBSE BBS V0.37.01 TODO list.
MBSE BBS V0.37.03 TODO list.
----------------------------
These are a list of things that must be implemented one way or
@ -24,8 +24,6 @@ libdiesel.a:
mbsebbs:
N: Implement session and time/day limits.
N: Display archives.
L: Better word wrapping or paragraph justification in editor.
L: E-mail downloads with e-mail verification.

View File

@ -15,7 +15,7 @@
14 mail.c |You are not allowed to delete that message
15 change.c |Offline Reader: Extended Info turned ON
16 change.c |Offline Reader: Extended Info turned OFF
17 .c |
17 file.c |This is not a plain textfile.
18 .c |
19 .c |
20 .c |
@ -59,7 +59,7 @@
58 newuser.c |Please enter the correct date format
59 chat.c |*** Sysop is starting chat ***
60 chat.c |*** Sysop has terminated chat ***
61 mail.c misc.c YN=|More (Y/n/=)
61 mail.c misc.c file.c YN=|More (Y/n/=)
62 newuser.c YN|Would you like Hot-Keyed menus? [Y/n]:
63 newuser.c |Please answer Y or N
64 change.c |Please enter your Screen Length? [24]:
@ -84,27 +84,27 @@
83 change.c |Please enter the correct date format
84 misc.c |Todays Callers to
85 misc.c |# User Name Device TimeOn Calls Location
86 safe.c |Safe Cracker Door
87 safe.c |Please press a key to continue:
88 safe.c |In the safe lies ...
89 safe.c |Please enter three numbers consisting from 1 to
90 safe.c |Please enter three combinations.
91 safe.c |1st digit:
92 safe.c |Please try again! You must input a number greater than Zero and less than
93 safe.c |2nd digit:
94 safe.c |3rd digit:
95 safe.c | Left:
96 safe.c |Right:
97 safe.c YN|Attempt to open safe with this combination [Y/n]:
98 safe.c |You have won the following...
99 safe.c |Sorry - You didn't open the safe!
100 safe.c |The safe code was:
101 safe.c YN|Do you want to try again ? [Y/n]:
102 safe.c YN|Do you want to open the safe ? [Y/n]:
103 safe.c |THE SAFE IS CURRENTLY LOCKED
104 safe.c |has cracked the safe.
105 safe.c |The safe will remain locked until the sysop rewards the user.
106 safe.c |Maximum trys per day Exceeded!
86 .c |
87 .c |
88 .c |
89 .c |
90 .c |
91 .c |
92 .c |
93 .c |
94 .c |
95 .c |
96 .c |
97 .c |
98 .c |
99 .c |
100 .c |
101 .c |
102 .c |
103 .c |
104 .c |
105 .c |
106 .c |
107 signature.c |Edit message signature
108 .c |The FROM, TO and SUBJECT fields are optional.
109 .c | From:
@ -440,7 +440,7 @@
439 offline.c |Offline Reader Upload
440 offline.c |Invalid packet received
441 offline.c |Unknown compression type
442 offline.c |Archiver not available
442 offline.c file.c |Archiver not available
443 offline.c |Unknown type mailpacket
444 offline.c |BlueWave Offline download
445 offline.c |Preparing packet

View File

@ -15,26 +15,26 @@ HR|Exporteer naar (H)ome of (R)egels directory:
|Je mag dit bericht niet verwijderen
|Offline Reader: Uitgebreide Informatie is nu AAN
|Offline Reader: Uitgebreide Informatie is nu UIT
|Tijd opgenomen vandaag
|Bytes opgenomen vandaag
SOE|(S)torten, (O)pnemen, (E)inde:
|Bank >
TBE|(T)ijd, (B)ytes, (E)inde:
|U moet minstens 5 minuten tijd over hebben om te storten
|Hoeveel tijd. Aantal minuten beschikbaars is
|U heeft geprobeerd meer dan de dagelijkse limiet te storten.
|Maximaal aantal te storten minuten per dag:
|U heeft Uw rekening balans overschreden.
|Maximaal aantal minuten op de bankrekening is:
|U mag storten:
|U heeft geprobeerd meer dan de dagelijkse limiet op te nemen.
|Maximaal per dag op te nemen:
|U heeft geprobeert meer tijd op te nemen dan op de rekening staat.
|Huidige bank balans:
|Maximaal aantal kilobytes te storten per dag:
|U heeft Uw bank balans overschreden.
|Maximaal aantal kilobytes op de bankrekening is:
|Hoeveel kilobytes. Aantal Kilobytes beschikbaar is
|Dit is geen normaal tekst bestand
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSE Bulletin Board Systeem - NIEUWE GEBRUIKER REGISTRATIE
|Gebruik deze naam:
|Geef een nieuw wachtwoord :

View File

@ -15,26 +15,26 @@ HR|Export to (H)ome or (R)ules directory:
|You are not allowed to delete that message
|Offline Reader: Extended Info turned ON
|Offline Reader: Extended Info turned OFF
|Time withdrawn today
|Bytes withdrawn today
DWQ|(D)eposit, (W)ithdraw, (Q)uit:
|Bank >
TBQ|(T)ime, (B)ytes, (Q)uit :
|You must have at least 5 minutes remaining to deposit
|How much time. Minutes available to you is
|You have tried to deposit more than the maximum limit today.
|Maximum allowed minutes to deposit per day:
|You have exeeded your account balance.
|Maximum allowable minutes in bank account is:
|You are allowed to deposit:
|You have tried to withdraw more than the maximum limit today.
|Maximum allowed to withdraw per day:
|You have tried to withdraw more time than is in your bank account.
|Current bank balance:
|Maximum allowed kilobytes to deposit per day:
|You have exeeded your account balance.
|Maximum allowable kilobytes in bank account is:
|How many kilobytes. KBytes available to you is
|This is not a plain textfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSE Bulletin Board System - NEW USER REGISTRATION
|Use this name:
|Please enter new password :

View File

@ -15,26 +15,26 @@ HR|Exportar
|No podes borrar esta mensaxe.
|Lector Offline: Informaci¢n extendida ACTIVADA
|Lector Offline: Informaci¢n extendida DESACTIVADA
|Tempo retirado hoxe :
|Bytes retirados hoxe :
DRS|(D)epositar, (R)etirar, (S)air :
|Banco >
TBS|(T)empo, (B)ytes, (S)air :
|Debes ter polo menos 5 minutos para poder depositar
|¨Canto tempo?. Dispo¤ible en minutos :
|Tentaches depositar m is do m ximo permitido para hoxe.
|M ximo tempo diario que se pode depositar:
|Excedeche-lo saldo da tua conta.
|Minutos dispo¤ibles na tua conta :
|Perm¡techese depositar:
|Tentaches retirar m is do l¡mite m ximo diario.
|M ximo permitido diario para retirar:
|Tentaches retirar m is tempo do que tes na tua conta.
|O saldo da tua conta :
|M ximo de Kb que se permite depositar diariamente:
|Excedeche-lo saldo da tua conta.
|Kilobytes dispo¤ible na tua conta :
|¨Cantos kilobytes. Podes dispo¤er de
|This is not a plain textfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSE BBS - REXISTRO DE NOVO USUARIO
|Use este nome:
|Por favor teclee o novo password :

View File

@ -15,26 +15,26 @@ HR|Export in (H)ome oder (R)ules Direktorie:
|Keine Berechtigung zum loeschen der Message
|Offline Reader: Extended Info turned ON
|Offline Reader: Extended Info turned OFF
|Heute abgehobene Zeit . . . . . . :
|Heute abgehobene KBytes . . . . . :
SAE|(S)paren, (A)bheben, (E)nde:
|Bank >
ZKE|(Z)eit, (K)Bytes, (E)nde :
|Zum Sparen muessen Sie mindestens 5 Minuten uebrig haben
|Wieviel Zeit? Verfuegbare Minuten fuer Sie:
|Sie versuchten mehr als das maximale Limit fuer heute zu sparen.
|Maximal zu sparende Minuten pro Tag:
|Sie haben Ihr Konto ueberzogen.
|Die maximal verfuegbaren Minuten auf dem Konto sind:
|Sie koennen sparen:
|Sie versuchten mehr als das maximale Limit fuer heute abzuheben.
|Maximum pro Tag abzuheben:
|Sie versuchten Ihr Zeitkonto zu ueberziehen.
|Aktueller Kontostand:
|Maximal zu sparende Kilobytes pro Tag:
|Sie haben Ihr Konto ueberzogen.
|Die maximal verfuegbaren Kilobytes auf dem Konto sind:
|Wieviele Kilobytes? Verfuegbare KBytes fuer Sie sind:
|This is not a plain textfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSE Bulletin Board System - Anlegen eines neuen Benutzerkontos
|Diesen Namen verwenden:
|Bitte das neue Passwort eingeben :

View File

@ -15,26 +15,26 @@ HR|Export to (H)ome or (R)ules directory:
|You are not allowed to delete that message
|Offline Reader: Extended Info turned ON
|Offline Reader: Extended Info turned OFF
|Tempo prelevato oggi :
|Byte prelevati oggi :
DPE|(D)eposita, (P)releva, (E)sci:
|Banca >
TBE|(T)empo, (B)yte, (E)sci :
|Devi avere almeno 5 minuti restanti per poter depositare
|Scegli la quantita di tempo. Hai a disposizione minuti
|Hai cercato di depositare piu del limite massimo oggi.
|Massimo numero di minuti che puoi depositare ogni giorno:
|Hai superato il limite per il tuo account.
|Massimo numero di minuti disponibili nel tuo account:
|Puoi depositare:
|Hai cercato di prelevare piu del limite massimo oggi.
|Massimo numero di minuti che puoi prelevare ogni giorno:
|You have tried to withdraw more time than is in your bank account.
|Stato attuale del tuo account:
|Numero massimo di KB che puoi depositare ogni giorno:
|Hai superato il limite per il tuo account.
|Numero massimo di KB che puoi tenere nel tuo account:
|Scegli la quantita di KB. KB disponibili:
|This is not a plain textfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSE Bulletin Board System - REGISTRAZIONE DEI NUOVI UTENTI
|Usa questo nome:
|Inserisci una nuova password:

View File

@ -15,26 +15,26 @@ PR|Exportar al directorio (P)ersonal o de (R)eglas:
|No puedes borrar este Mensaje.
|Lector Offline: Informaci¢n extendida ACTIVADA
|Lector Offline: Informaci¢n extendida DESACTIVADA
|Tiempo retirado hoy :
|Bytes retirados hoy :
DRS|(D)epositar, (R)etirar, (S)alir :
|Banco >
TBS|(T)iempo, (B)ytes, (S)alir :
|Debes tener al menos 5 minutos para poder depositar
|¨Cuanto tiempo?. Disponible en minutos :
|Has intentado depositar mas del m ximo permitido para hoy.
|M ximo tiempo diario que se puede depositar:
|Has excedido el saldo de tu cuenta.
|Minutos disponibles en tu cuenta :
|Se te permite depositar:
|Has intentado retirar m s del l¡mite m ximo diario.
|M ximo permitido diario para retirar:
|Has intentado retirar m s tiempo del que tienes en tu cuenta.
|El saldo de tu cuenta es :
|M ximo de Kb permitido depositar diariamente:
|Has excedido el saldo de tu cuenta.
|Kilobytes disponible en tu cuenta :
|¨Cuantos kilobytes. Dispones de
|This is not a plain textfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|MBSEBBS - REGISTRO DE NUEVO USUARIO
|Use este nombre:
|Por favor teclee el nuevo password :

View File

@ -8,7 +8,7 @@ CLCOMM_SRCS = clcomm.c client.c crc.c semafore.c signame.c
CLCOMM_OBJS = clcomm.o client.o crc.o semafore.o signame.o
CLCOMM_HDRS = clcomm.h
COMMON_SRCS = attach.c falists.c hdr.c parsedate.c rfcmsg.c unpacker.c \
batchrd.c charset.c ftn.c pktname.c mangle.c sectest.c \
batchrd.c ftn.c pktname.c mangle.c sectest.c \
dostran.c ftnmsg.c mbfile.c nodelock.c rawio.c strcasestr.c \
execute.c expipe.c getheader.c noderecord.c rfcaddr.c strutil.c \
faddr.c gmtoffset.c packet.c rfcdate.c term.c endian.c
@ -136,7 +136,6 @@ parsedate.o: ../config.h libs.h memwatch.h structs.h common.h
rfcmsg.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h
unpacker.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h
batchrd.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h
charset.o:
ftn.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h dbftn.h common.h
pktname.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h
mangle.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h

View File

@ -1008,6 +1008,7 @@ struct _archiver {
char funarc[65]; /* Unarc files */
char munarc[65]; /* Unarc mail */
char iunarc[65]; /* Unarc FILE_ID.DIZ */
char varc[65]; /* View archive */
};

View File

@ -156,7 +156,7 @@ pop3.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs
lastcallers.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h lastcallers.h
timeout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h
chat.o: ../config.h ../lib/libs.h ../lib/ansi.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h chat.h funcs.h input.h language.h misc.h whoson.h
file.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h
file.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h
mbstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbstat.h
misc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h language.h misc.h timeout.h exitinfo.h
offline.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.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
@ -165,7 +165,7 @@ mbnewusr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/str
input.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h input.h timeout.h language.h
whoson.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h input.h language.h exitinfo.h whoson.h
door.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h input.h timeout.h exitinfo.h whoson.h door.h
dispfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h funcs.h language.h oneline.h misc.h timeout.h timecheck.h exitinfo.h mail.h email.h input.h dispfile.h
dispfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.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/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h userlist.h language.h input.h timeout.h
timestats.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h timestats.h funcs.h language.h input.h exitinfo.h
logentry.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h logentry.h

View File

@ -4,7 +4,7 @@
* Purpose ...............: Display ANSI/ASCII textfiles
*
*****************************************************************************
* Copyright (C) 1997-2002
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -50,7 +50,7 @@
#include "email.h"
#include "input.h"
#include "dispfile.h"
#include "filesub.h"
@ -162,7 +162,7 @@ int DisplayTextFile(char *filename)
{
FILE *fp;
char *buf;
int i, x, c, lc = 0;
int i, x, c, z, lc = 0;
if ((fp = fopen(filename, "r")) == NULL) {
WriteError("$DisplayTextFile(%s) failed");
@ -186,9 +186,26 @@ int DisplayTextFile(char *filename)
fflush(stdout);
lc++;
if (lc == exitinfo.iScreenLen) {
Pause();
if ((lc >= exitinfo.iScreenLen) && (lc < 1000)) {
lc = 0;
/* More (Y/n/=) */
pout(CFG.MoreF, CFG.MoreB, (char *) Language(61));
fflush(stdout);
alarm_on();
z = toupper(Getone());
if (z == Keystroke(61, 1)) {
printf("\n");
fflush(stdout);
fclose(fp);
free(buf);
return TRUE;
}
if (z == Keystroke(61, 2))
lc = 50000;
Blanker(strlen(Language(61)));
colour(CFG.TextColourF, CFG.TextColourB);
}
}
@ -198,7 +215,7 @@ int DisplayTextFile(char *filename)
Enter(1);
/* Press ENTER to continue */
language(LIGHTMAGENTA, BLACK, 436);
language(CFG.MoreF, CFG.MoreB, 436);
fflush(stdout);
fflush(stdin);
alarm_on();
@ -216,129 +233,121 @@ int DisplayTextFile(char *filename)
*/
int DisplayFile(char *filename)
{
FILE *pFileName;
long iSec = 0;
char *sFileName, *tmp, *tmp1;
char newfile[PATH_MAX];
int i, x;
FILE *pFileName;
long iSec = 0;
char *sFileName, *tmp, *tmp1, newfile[PATH_MAX];
int i, x;
sFileName = calloc(16385, sizeof(char));
tmp = calloc(PATH_MAX, sizeof(char));
tmp1 = calloc(PATH_MAX, sizeof(char));
sFileName = calloc(16385, sizeof(char));
tmp = calloc(PATH_MAX, sizeof(char));
tmp1 = calloc(PATH_MAX, sizeof(char));
/*
* Open the file in the following search order:
* 1 - if GraphMode -> users language .ans
* 2 - if GraphMode -> default language .ans
* 3 - users language .asc
* 4 - default language .asc
* 5 - Abort, there is no file to show.
*/
pFileName = NULL;
if (exitinfo.GraphMode) {
sprintf(newfile, "%s/%s.ans", lang.TextPath, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
sprintf(newfile, "%s/%s.ans", CFG.bbs_txtfiles, filename);
pFileName = fopen(newfile, "rb");
}
/*
* Open the file in the following search order:
* 1 - if GraphMode -> users language .ans
* 2 - if GraphMode -> default language .ans
* 3 - users language .asc
* 4 - default language .asc
* 5 - Abort, there is no file to show.
*/
pFileName = NULL;
if (exitinfo.GraphMode) {
sprintf(newfile, "%s/%s.ans", lang.TextPath, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
sprintf(newfile, "%s/%s.ans", CFG.bbs_txtfiles, filename);
pFileName = fopen(newfile, "rb");
}
if (pFileName == NULL) {
sprintf(newfile, "%s/%s.asc", lang.TextPath, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
sprintf(newfile, "%s/%s.asc", CFG.bbs_txtfiles, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
free(sFileName);
free(tmp);
free(tmp1);
return FALSE;
}
}
}
if (pFileName == NULL) {
sprintf(newfile, "%s/%s.asc", lang.TextPath, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
sprintf(newfile, "%s/%s.asc", CFG.bbs_txtfiles, filename);
if ((pFileName = fopen(newfile, "rb")) == NULL) {
free(sFileName);
free(tmp);
free(tmp1);
return FALSE;
}
}
}
Syslog('B', "Displayfile %s", newfile);
Syslog('B', "Displayfile %s", newfile);
while (!feof(pFileName)) {
i = fread(sFileName, sizeof(char), 16384, pFileName);
while (!feof(pFileName)) {
i = fread(sFileName, sizeof(char), 16384, pFileName);
for(x = 0; x < i; x++) {
switch(*(sFileName + x)) {
case '':
ControlCodeU(sFileName[++x]);
break;
for (x = 0; x < i; x++) {
switch(*(sFileName + x)) {
case '': ControlCodeU(sFileName[++x]);
break;
case '':
ControlCodeF(sFileName[++x]);
break;
case '': ControlCodeF(sFileName[++x]);
break;
case ' ':
ControlCodeK(sFileName[++x]);
break;
case ' ': ControlCodeK(sFileName[++x]);
break;
case '':
fflush(stdout);
fflush(stdin);
alarm_on();
Getone();
break;
case '': fflush(stdout);
fflush(stdin);
alarm_on();
Getone();
break;
case '':
/*
* This code will allow you to specify a security level
* in front of the text, ie ^B32000^Bthis is a test^B
* will print this is a test only if you have security
* above 32000. Only one set of control chars per line.
* You cannot have multiple securitys etc
*/
x++;
strcpy(tmp1, "");
while (*(sFileName + x) != '') {
sprintf(tmp, "%c", *(sFileName + x));
strcat(tmp1, tmp);
x++;
}
x++;
iSec = atoi(tmp1);
while ((x <= i) && (*(sFileName + x) != '')) {
if (exitinfo.Security.level >= iSec)
printf("%c", *(sFileName + x));
x++;
}
break;
case '': /*
* This code will allow you to specify a security level
* in front of the text, ie ^B32000^Bthis is a test^B
* will print this is a test only if you have security
* above 32000. Only one set of control chars per line.
* You cannot have multiple securitys etc
*/
x++;
strcpy(tmp1, "");
while (*(sFileName + x) != '') {
sprintf(tmp, "%c", *(sFileName + x));
strcat(tmp1, tmp);
x++;
}
x++;
iSec = atoi(tmp1);
while ((x <= i) && (*(sFileName + x) != '')) {
if (exitinfo.Security.level >= iSec)
printf("%c", *(sFileName + x));
x++;
}
break;
case '':
fflush(stdout);
sleep(1);
break;
case '': fflush(stdout);
sleep(1);
break;
default:
printf("%c", *(sFileName + x));
default: printf("%c", *(sFileName + x));
} /* switch */
} /* for */
} /* while !eof */
} /* switch */
} /* for */
} /* while !eof */
fclose(pFileName);
free(sFileName);
free(tmp);
free(tmp1);
return TRUE;
fclose(pFileName);
free(sFileName);
free(tmp);
free(tmp1);
return TRUE;
}
int DisplayFileEnter(char *File)
{
int rc;
int rc;
rc = DisplayFile(File);
Enter(1);
/* Press ENTER to continue */
language(13, 0, 436);
fflush(stdout);
fflush(stdin);
alarm_on();
Getone();
return rc;
rc = DisplayFile(File);
Enter(1);
/* Press ENTER to continue */
language(13, 0, 436);
fflush(stdout);
fflush(stdin);
alarm_on();
Getone();
return rc;
}

View File

@ -4,7 +4,7 @@
* Purpose ...............: All the file functions.
*
*****************************************************************************
* Copyright (C) 1997-2002
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -47,6 +47,7 @@
#include "exitinfo.h"
#include "whoson.h"
#include "change.h"
#include "dispfile.h"
@ -2214,9 +2215,166 @@ void EditTaglist()
/*
* View a file in the current area, menu 103.
* If a file name is given, display direct,
* else ask for filename to view.
*/
void ViewFile()
void ViewFile(char *name)
{
char *File, *temp, *arc;
int count, total, rc, found = FALSE;
FILE *fp, *pFile;
Syslog('+', "ViewFile(%s)", printable(name, 0));
if (Access(exitinfo.Security, area.LTSec) == FALSE) {
colour(YELLOW, BLACK);
/* You don't have enough security to list this area */
printf("\n%s\n", (char *) Language(236));
Pause();
return;
}
File = calloc(PATH_MAX, sizeof(char));
if ((name != NULL) && strlen(name)) {
strcpy(File, name);
} else {
Enter(2);
/* Please enter filename: */
pout(YELLOW, BLACK, (char *) Language(245));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(File, 80);
if ((strcmp(File, "")) == 0) {
free(File);
return;
}
if (*(File) == '.' || *(File) == '*' || *(File) == ' ' || *(File) == '/') {
colour(CFG.HiliteF, CFG.HiliteB);
/* Illegal Filename! */
printf("\n%s\n\n", (char *) Language(247));
Pause();
free(File);
return;
}
Strlen = strlen(File);
Strlen--;
if (*(File + Strlen) == '.' || *(File + Strlen) == '/' || *(File + Strlen) == ' ') {
colour(CFG.HiliteF, CFG.HiliteB);
/* Illegal Filename! */
printf("\n%s\n\n", (char *) Language(247));
Pause();
free(File);
return;
}
if ((!strcmp(File, "files.bbs")) || (!strcmp(File, "00index")) || (strstr(File, (char *)".html"))) {
colour(CFG.HiliteF, CFG.HiliteB);
/* Illegal Filename! */
printf("\n%s\n\n", (char *) Language(247));
Pause();
free(File);
return;
}
}
/*
* Now check if this file is present
*/
if ((pFile = OpenFileBase(iAreaNumber, FALSE)) == NULL) {
free(File);
return;
}
while (fread(&file, sizeof(file), 1, pFile) == 1) {
if (((strcasecmp(File, file.Name) == 0) || (strcasecmp(File, file.LName) == 0)) && (!file.Deleted) && (!file.Missing)) {
found = TRUE;
break;
}
}
fclose(pFile);
if (!found) {
colour(YELLOW, BLACK);
/* File does not exist, please try again ... */
printf("\n%s\n\n", (char *) Language(296));
free(File);
Pause();
return;
}
sprintf(File, "%s/%s", sAreaPath, file.LName);
arc = GetFileType(File);
Syslog('+', "File to view: %s, type %s", file.LName, printable(arc, 0));
if (arc != NULL) {
found = FALSE;
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/archiver.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r")) != NULL) {
fread(&archiverhdr, sizeof(archiverhdr), 1, fp);
while (fread(&archiver, archiverhdr.recsize, 1, fp) == 1) {
if ((strcmp(arc, archiver.name) == 0) && (archiver.available)) {
found = TRUE;
break;
}
}
fclose(fp);
}
if (!found || (strlen(archiver.varc) == 0)) {
Syslog('+', "No archiver view for %s available", File);
colour(YELLOW, BLACK);
/* Archiver not available */
printf("\n%s\n\n", Language(442));
free(File);
free(temp);
Pause();
return;
}
/*
* Archiver viewer is available. Make a temp file which we will
* display to the user.
*/
sprintf(temp, "%s/%s/temptxt", CFG.bbs_usersdir, exitinfo.Name);
rc = execute(archiver.varc, File, NULL, (char *)"/dev/null", temp, (char *)"/dev/null");
Syslog('+', "Display temp file %s", temp);
DisplayTextFile(temp);
unlink(temp);
free(temp);
} else {
/*
* Most likely a textfile, first check.
*/
total = count = 0;
if ((fp = fopen(File, "r"))) {
while (TRUE) {
rc = fgetc(fp);
if (rc == EOF)
break;
total++;
if (isascii(rc))
count++;
}
fclose(fp);
}
if (((count * 10) / total) < 8) {
Syslog('+', "This is not a ASCII textfile");
printf("\n%s\n\n", Language(17));
Pause();
free(File);
return;
}
Syslog('+', "Display text file %s", File);
DisplayTextFile(File);
}
free(File);
}

View File

@ -1,6 +1,7 @@
#ifndef _FILE_H
#define _FILE_H
/* $Id$ */
void File_RawDir(char *); /* Raw Directory List of a Directory */
void File_List(void); /* List files in current Area */
@ -18,7 +19,7 @@ void Delete_Home(void); /* Delete file from home directory */
int Download_Home(void); /* Allows user to download from home dir */
int Upload_Home(void); /* Allows user to upload to home directory */
void Copy_Home(void); /* Copy a file to home directory */
void ViewFile(void); /* View a file in the current area. */
void ViewFile(char *); /* View a file in the current area. */
#endif

View File

@ -732,7 +732,7 @@ char *GetFileType(char *fn)
if (memcmp(buf, "MTM", 3) == 0) return (char *)"MTM";
if (memcmp(buf, "#!/bin/", 7) == 0) return (char *)"UNIX script";
if (memcmp(buf, "\037\235", 2) == 0) return (char *)"Compressed data";
if (memcmp(buf, "\037\213", 2) == 0) return (char *)"gzip compress";
if (memcmp(buf, "\037\213", 2) == 0) return (char *)"GZIP";
if (memcmp(buf, "\177ELF", 4) == 0) return (char *)"ELF";
if (memcmp(buf, "%!", 2) == 0) return (char *)"PostScript";
if (memcmp(buf, "GIF8", 4) == 0) return (char *)"GIF";

View File

@ -429,7 +429,7 @@ void DoMenu(int Type)
break;
case 103:
ViewFile();
ViewFile(NULL);
break;
case 104:

View File

@ -82,12 +82,14 @@ int CountArchive(void)
archiver.available = TRUE;
sprintf(archiver.marc, "%s anw", _PATH_ARC);
sprintf(archiver.tarc, "%s tnw", _PATH_ARC);
sprintf(archiver.varc, "%s l", _PATH_ARC);
sprintf(archiver.funarc, "%s xnw", _PATH_ARC);
sprintf(archiver.munarc, "%s enw", _PATH_ARC);
sprintf(archiver.iunarc, "%s enw", _PATH_ARC);
} else {
sprintf(archiver.marc, "/usr/bin/arc anw");
sprintf(archiver.tarc, "/usr/bin/arc tnw");
sprintf(archiver.varc, "/usr/bin/arc l");
sprintf(archiver.funarc, "/usr/bin/arc xnw");
sprintf(archiver.munarc, "/usr/bin/arc enw");
sprintf(archiver.iunarc, "/usr/bin/arc enw");
@ -99,6 +101,7 @@ int CountArchive(void)
sprintf(archiver.funarc, "%s -U", _PATH_NOMARCH);
sprintf(archiver.munarc, "%s", _PATH_NOMARCH);
sprintf(archiver.iunarc, "%s", _PATH_NOMARCH);
sprintf(archiver.varc, "%s -l", _PATH_NOMARCH);
}
fwrite(&archiver, sizeof(archiver), 1, fil);
@ -109,6 +112,7 @@ int CountArchive(void)
archiver.available = TRUE;
sprintf(archiver.marc, "%s aq", _PATH_LHA);
sprintf(archiver.tarc, "%s tq", _PATH_LHA);
sprintf(archiver.varc, "%s l", _PATH_LHA);
sprintf(archiver.funarc, "%s xqf", _PATH_LHA);
sprintf(archiver.munarc, "%s eqf", _PATH_LHA);
sprintf(archiver.iunarc, "%s eqf", _PATH_LHA);
@ -116,6 +120,7 @@ int CountArchive(void)
archiver.available = FALSE;
sprintf(archiver.marc, "/usr/bin/lha aq");
sprintf(archiver.tarc, "/usr/bin/lha tq");
sprintf(archiver.varc, "/usr/bin/lha l");
sprintf(archiver.funarc, "/usr/bin/lha xqf");
sprintf(archiver.munarc, "/usr/bin/lha eqf");
sprintf(archiver.iunarc, "/usr/bin/lha eqf");
@ -131,6 +136,7 @@ int CountArchive(void)
sprintf(archiver.marc, "%s a -y", _PATH_RAR);
sprintf(archiver.barc, "%s c -y", _PATH_RAR);
sprintf(archiver.tarc, "%s t -y", _PATH_RAR);
sprintf(archiver.varc, "%s l", _PATH_RAR);
sprintf(archiver.funarc, "%s x -o+ -y -r", _PATH_RAR);
sprintf(archiver.munarc, "%s e -o+ -y", _PATH_RAR);
sprintf(archiver.iunarc, "%s e", _PATH_RAR);
@ -139,12 +145,14 @@ int CountArchive(void)
sprintf(archiver.funarc, "%s x -o+ -y -r", _PATH_UNRAR);
sprintf(archiver.munarc, "%s e -o+ -y", _PATH_UNRAR);
sprintf(archiver.iunarc, "%s e", _PATH_UNRAR);
sprintf(archiver.varc, "%s l", _PATH_UNRAR);
} else {
archiver.available = FALSE;
sprintf(archiver.farc, "/usr/bin/rar a -y -r");
sprintf(archiver.marc, "/usr/bin/rar a -y");
sprintf(archiver.barc, "/usr/bin/rar c -y");
sprintf(archiver.tarc, "/usr/bin/rar t -y");
sprintf(archiver.varc, "/usr/bin/rar l");
sprintf(archiver.funarc, "/usr/bin/unrar x -o+ -y -r");
sprintf(archiver.munarc, "/usr/bin/unrar e -o+ -y");
sprintf(archiver.iunarc, "/usr/bin/unrar e");
@ -159,6 +167,7 @@ int CountArchive(void)
sprintf(archiver.farc, "%s cfz", _PATH_TAR);
sprintf(archiver.marc, "%s Afz", _PATH_TAR);
sprintf(archiver.tarc, "%s tfz", _PATH_TAR);
sprintf(archiver.varc, "%s tfz", _PATH_TAR);
sprintf(archiver.funarc, "%s xfz", _PATH_TAR);
sprintf(archiver.munarc, "%s xfz", _PATH_TAR);
sprintf(archiver.iunarc, "%s xfz", _PATH_TAR);
@ -167,6 +176,7 @@ int CountArchive(void)
sprintf(archiver.farc, "/bin/tar cfz");
sprintf(archiver.marc, "/bin/tar Afz");
sprintf(archiver.tarc, "/bin/tar tfz");
sprintf(archiver.varc, "/bin/tar tfz");
sprintf(archiver.funarc, "/bin/tar xfz");
sprintf(archiver.munarc, "/bin/tar xfz");
sprintf(archiver.iunarc, "/bin/tar xfz");
@ -181,6 +191,7 @@ int CountArchive(void)
sprintf(archiver.farc, "%s cfj", _PATH_TAR);
sprintf(archiver.marc, "%s Afj", _PATH_TAR);
sprintf(archiver.tarc, "%s tfj", _PATH_TAR);
sprintf(archiver.varc, "%s tfj", _PATH_TAR);
sprintf(archiver.funarc, "%s xfj", _PATH_TAR);
sprintf(archiver.munarc, "%s xfj", _PATH_TAR);
sprintf(archiver.iunarc, "%s xfj", _PATH_TAR);
@ -189,6 +200,7 @@ int CountArchive(void)
sprintf(archiver.farc, "/bin/tar cfj");
sprintf(archiver.marc, "/bin/tar Afj");
sprintf(archiver.tarc, "/bin/tar tfj");
sprintf(archiver.varc, "/bin/tar tfj");
sprintf(archiver.funarc, "/bin/tar xfj");
sprintf(archiver.munarc, "/bin/tar xfj");
sprintf(archiver.iunarc, "/bin/tar xfj");
@ -203,6 +215,7 @@ int CountArchive(void)
sprintf(archiver.farc, "%s cf", _PATH_TAR);
sprintf(archiver.marc, "%s Af", _PATH_TAR);
sprintf(archiver.tarc, "%s tf", _PATH_TAR);
sprintf(archiver.varc, "%s tf", _PATH_TAR);
sprintf(archiver.funarc, "%s xf", _PATH_TAR);
sprintf(archiver.munarc, "%s xf", _PATH_TAR);
sprintf(archiver.iunarc, "%s xf", _PATH_TAR);
@ -211,6 +224,7 @@ int CountArchive(void)
sprintf(archiver.farc, "/bin/tar cf");
sprintf(archiver.marc, "/bin/tar Af");
sprintf(archiver.tarc, "/bin/tar tf");
sprintf(archiver.varc, "/bin/tar tf");
sprintf(archiver.funarc, "/bin/tar xf");
sprintf(archiver.munarc, "/bin/tar xf");
sprintf(archiver.iunarc, "/bin/tar xf");
@ -230,11 +244,13 @@ int CountArchive(void)
archiver.available = FALSE;
if (strlen(_PATH_UNARJ)) {
sprintf(archiver.tarc, "%s t", _PATH_UNARJ);
sprintf(archiver.varc, "%s l", _PATH_UNARJ);
sprintf(archiver.funarc, "%s x", _PATH_UNARJ);
sprintf(archiver.munarc, "%s e", _PATH_UNARJ);
sprintf(archiver.iunarc, "%s e", _PATH_UNARJ);
} else {
sprintf(archiver.tarc, "/usr/bin/unarj t");
sprintf(archiver.varc, "/usr/bin/unarj l");
sprintf(archiver.funarc, "/usr/bin/unarj x");
sprintf(archiver.munarc, "/usr/bin/unarj e");
sprintf(archiver.iunarc, "/usr/bin/unarj e");
@ -250,6 +266,7 @@ int CountArchive(void)
sprintf(archiver.marc, "%s -2d -y -e a", _PATH_ARJ);
sprintf(archiver.barc, "%s -2d -y c", _PATH_ARJ);
sprintf(archiver.tarc, "%s -y t", _PATH_ARJ);
sprintf(archiver.varc, "%s l", _PATH_ARJ);
sprintf(archiver.funarc, "%s -y x", _PATH_ARJ);
sprintf(archiver.munarc, "%s -y e", _PATH_ARJ);
sprintf(archiver.iunarc, "%s -y e", _PATH_ARJ);
@ -259,6 +276,7 @@ int CountArchive(void)
sprintf(archiver.marc, "/usr/bin/arj -2d -y -e a");
sprintf(archiver.barc, "/usr/bin/arj -2d -y c");
sprintf(archiver.tarc, "/usr/bin/arj -y t");
sprintf(archiver.varc, "/usr/bin/arj l");
sprintf(archiver.funarc, "/usr/bin/arj -y x");
sprintf(archiver.munarc, "/usr/bin/arj -y e");
sprintf(archiver.iunarc, "/usr/bin/arj -y e");
@ -287,10 +305,12 @@ int CountArchive(void)
sprintf(archiver.funarc, "%s -o -q", _PATH_UNZIP);
sprintf(archiver.munarc, "%s -o -j -L", _PATH_UNZIP);
sprintf(archiver.iunarc, "%s -o -j", _PATH_UNZIP);
sprintf(archiver.varc, "%s -l", _PATH_UNZIP);
} else {
sprintf(archiver.funarc, "/usr/bin/unzip -o -q");
sprintf(archiver.munarc, "/usr/bin/unzip -o -j -L");
sprintf(archiver.iunarc, "/usr/bin/unzip -o -j");
sprintf(archiver.varc, "/usr/bin/unzip -l");
}
fwrite(&archiver, sizeof(archiver), 1, fil);
@ -302,6 +322,7 @@ int CountArchive(void)
sprintf(archiver.farc, "%s aq", _PATH_ZOO);
sprintf(archiver.marc, "%s aq:O", _PATH_ZOO);
sprintf(archiver.barc, "%s aqC", _PATH_ZOO);
sprintf(archiver.varc, "%s -list", _PATH_ZOO);
sprintf(archiver.funarc, "%s xqO", _PATH_ZOO);
sprintf(archiver.munarc, "%s eq:O", _PATH_ZOO);
sprintf(archiver.iunarc, "%s eqO", _PATH_ZOO);
@ -310,6 +331,7 @@ int CountArchive(void)
sprintf(archiver.farc, "/usr/bin/zoo aq");
sprintf(archiver.marc, "/usr/bin/zoo aq:O");
sprintf(archiver.barc, "/usr/bin/zoo aqC");
sprintf(archiver.varc, "/usr/bin/zoo -list");
sprintf(archiver.funarc, "/usr/bin/zoo xqO");
sprintf(archiver.munarc, "/usr/bin/zoo eq:O");
sprintf(archiver.iunarc, "/usr/bin/zoo eqO");
@ -324,6 +346,7 @@ int CountArchive(void)
sprintf(archiver.farc, "%s a21rq", _PATH_HA);
sprintf(archiver.marc, "%s a21q", _PATH_HA);
sprintf(archiver.tarc, "%s t", _PATH_HA);
sprintf(archiver.varc, "%s l", _PATH_HA);
sprintf(archiver.funarc, "%s eyq", _PATH_HA);
sprintf(archiver.munarc, "%s eyq", _PATH_HA);
sprintf(archiver.iunarc, "%s eyq", _PATH_HA);
@ -332,6 +355,7 @@ int CountArchive(void)
sprintf(archiver.farc, "/usr/bin/ha a21rq");
sprintf(archiver.marc, "/usr/bin/ha a21q");
sprintf(archiver.tarc, "/usr/bin/ha t");
sprintf(archiver.varc, "/usr/bin/ha l");
sprintf(archiver.funarc, "/usr/bin/ha eyq");
sprintf(archiver.munarc, "/usr/bin/ha eyq");
sprintf(archiver.iunarc, "/usr/bin/ha eyq");
@ -477,99 +501,102 @@ int AppendArchive(void)
*/
int EditArchRec(int Area)
{
FILE *fil;
char mfile[PATH_MAX];
long offset;
int j;
unsigned long crc, crc1;
FILE *fil;
char mfile[PATH_MAX];
long offset;
int j;
unsigned long crc, crc1;
clr_index();
working(1, 0, 0);
IsDoing("Edit Archiver");
clr_index();
working(1, 0, 0);
IsDoing("Edit Archiver");
sprintf(mfile, "%s/etc/archiver.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(mfile, "r")) == NULL) {
working(2, 0, 0);
return -1;
}
sprintf(mfile, "%s/etc/archiver.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(mfile, "r")) == NULL) {
working(2, 0, 0);
return -1;
}
offset = sizeof(archiverhdr) + ((Area -1) * sizeof(archiver));
if (fseek(fil, offset, 0) != 0) {
working(2, 0, 0);
return -1;
}
offset = sizeof(archiverhdr) + ((Area -1) * sizeof(archiver));
if (fseek(fil, offset, 0) != 0) {
working(2, 0, 0);
return -1;
}
fread(&archiver, sizeof(archiver), 1, fil);
fclose(fil);
crc = 0xffffffff;
crc = upd_crc32((char *)&archiver, crc, sizeof(archiver));
working(0, 0, 0);
fread(&archiver, sizeof(archiver), 1, fil);
fclose(fil);
crc = 0xffffffff;
crc = upd_crc32((char *)&archiver, crc, sizeof(archiver));
working(0, 0, 0);
set_color(WHITE, BLACK);
mvprintw( 5, 2, "3. EDIT ARCHIVER");
set_color(CYAN, BLACK);
mvprintw( 7, 2, "1. Comment");
mvprintw( 8, 2, "2. Name");
mvprintw( 9, 2, "3. Available");
mvprintw(10, 2, "4. Deleted");
mvprintw(11, 2, "5. Arc files");
mvprintw(12, 2, "6. Arc mail");
mvprintw(13, 2, "7. Banners");
mvprintw(14, 2, "8. Arc test");
mvprintw(15, 2, "9. Un. files");
mvprintw(16, 2, "10. Un. mail");
mvprintw(17, 2, "11. FILE_ID");
mvprintw(18, 2, "12. List arc");
for (;;) {
set_color(WHITE, BLACK);
mvprintw( 5, 2, "3. EDIT ARCHIVER");
set_color(CYAN, BLACK);
mvprintw( 7, 2, "1. Comment");
mvprintw( 8, 2, "2. Name");
mvprintw( 9, 2, "3. Available");
mvprintw(10, 2, "4. Deleted");
mvprintw(11, 2, "5. Arc files");
mvprintw(12, 2, "6. Arc mail");
mvprintw(13, 2, "7. Banners");
mvprintw(14, 2, "8. Arc test");
mvprintw(15, 2, "9. Un. files");
mvprintw(16, 2, "10. Un. mail");
mvprintw(17, 2, "11. FILE_ID");
show_str( 7,16,40, archiver.comment);
show_str( 8,16, 5, archiver.name);
show_bool(9,16, archiver.available);
show_bool(10,16, archiver.deleted);
show_str(11,16,64, archiver.farc);
show_str(12,16,64, archiver.marc);
show_str(13,16,64, archiver.barc);
show_str(14,16,64, archiver.tarc);
show_str(15,16,64, archiver.funarc);
show_str(16,16,64, archiver.munarc);
show_str(17,16,64, archiver.iunarc);
show_str(18,16,64, archiver.varc);
for (;;) {
set_color(WHITE, BLACK);
show_str( 7,16,40, archiver.comment);
show_str( 8,16, 5, archiver.name);
show_bool(9,16, archiver.available);
show_bool(10,16, archiver.deleted);
show_str(11,16,64, archiver.farc);
show_str(12,16,64, archiver.marc);
show_str(13,16,64, archiver.barc);
show_str(14,16,64, archiver.tarc);
show_str(15,16,64, archiver.funarc);
show_str(16,16,64, archiver.munarc);
show_str(17,16,64, archiver.iunarc);
j = select_menu(11);
switch(j) {
case 0: crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&archiver, crc1, sizeof(archiver));
if (crc != crc1) {
if (yes_no((char *)"Record is changed, save") == 1) {
working(1, 0, 0);
if ((fil = fopen(mfile, "r+")) == NULL) {
working(2, 0, 0);
return -1;
}
fseek(fil, offset, 0);
fwrite(&archiver, sizeof(archiver), 1, fil);
fclose(fil);
ArchUpdated = 1;
working(1, 0, 0);
working(0, 0, 0);
}
j = select_menu(12);
switch(j) {
case 0: crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&archiver, crc1, sizeof(archiver));
if (crc != crc1) {
if (yes_no((char *)"Record is changed, save") == 1) {
working(1, 0, 0);
if ((fil = fopen(mfile, "r+")) == NULL) {
working(2, 0, 0);
return -1;
}
fseek(fil, offset, 0);
fwrite(&archiver, sizeof(archiver), 1, fil);
fclose(fil);
ArchUpdated = 1;
working(1, 0, 0);
working(0, 0, 0);
}
IsDoing("Browsing Menu");
return 0;
case 1: E_STR( 7,16,40,archiver.comment, "The ^Comment^ for this record")
case 2: E_STR( 8,16,5, archiver.name, "The ^name^ of this archiver")
case 3: E_BOOL( 9,16, archiver.available,"Switch if this archiver is ^Available^ for use.")
case 4: E_BOOL(10,16, archiver.deleted, "Is this archiver ^deleted^")
case 5: E_STR( 11,16,64,archiver.farc, "The ^Archive^ command for files")
case 6: E_STR( 12,16,64,archiver.marc, "The ^Archive^ command for mail packets")
case 7: E_STR( 13,16,64,archiver.barc, "The ^Archive^ command to insert/replace banners")
case 8: E_STR( 14,16,64,archiver.tarc, "The ^Archive^ command to test an archive")
case 9: E_STR( 15,16,64,archiver.funarc, "The ^Unarchive^ command for files")
case 10:E_STR( 16,16,64,archiver.munarc, "The ^Unarchive^ command for mail packets")
case 11:E_STR( 17,16,64,archiver.iunarc, "The ^Unarchive^ command to extract the FILE_ID.DIZ file")
}
}
IsDoing("Browsing Menu");
return 0;
case 1: E_STR( 7,16,40,archiver.comment, "The ^Comment^ for this record")
case 2: E_STR( 8,16,5, archiver.name, "The ^name^ of this archiver")
case 3: E_BOOL( 9,16, archiver.available,"Switch if this archiver is ^Available^ for use.")
case 4: E_BOOL(10,16, archiver.deleted, "Is this archiver ^deleted^")
case 5: E_STR( 11,16,64,archiver.farc, "The ^Archive^ command for files")
case 6: E_STR( 12,16,64,archiver.marc, "The ^Archive^ command for mail packets")
case 7: E_STR( 13,16,64,archiver.barc, "The ^Archive^ command to insert/replace banners")
case 8: E_STR( 14,16,64,archiver.tarc, "The ^Archive^ command to test an archive")
case 9: E_STR( 15,16,64,archiver.funarc, "The ^Unarchive^ command for files")
case 10:E_STR( 16,16,64,archiver.munarc, "The ^Unarchive^ command for mail packets")
case 11:E_STR( 17,16,64,archiver.iunarc, "The ^Unarchive^ command to extract the FILE_ID.DIZ file")
case 12:E_STR( 18,16,64,archiver.varc, "The ^List^ command to show the archive contents")
}
}
return 0;
return 0;
}
@ -784,6 +811,7 @@ int archive_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Unpack files %s\n", archiver.funarc);
fprintf(fp, " Unpack mail %s\n", archiver.munarc);
fprintf(fp, " Get FILE_ID.DIZ %s\n", archiver.iunarc);
fprintf(fp, " List archive %s\n", archiver.varc);
fprintf(fp, "\n\n");
j++;
}