Updated lines/cols definitions

This commit is contained in:
Michiel Broek 2001-12-02 17:10:49 +00:00
parent 48a59cf71a
commit b3e75eb94c
5 changed files with 63 additions and 14 deletions

View File

@ -4343,6 +4343,9 @@ v0.33.19 26-Oct-2001
The tic file import function now sorts and tests on long file- The tic file import function now sorts and tests on long file-
names, with the new mangle function an DOS 8.3 filename is names, with the new mangle function an DOS 8.3 filename is
also stored in the file database. also stored in the file database.
For all files received in tic area, the crc of the tic area
name is stored in the filerecord. This is for the future
rescan option.
mbfile: mbfile:
During check the file databases are reset to filemode 0660. During check the file databases are reset to filemode 0660.
@ -4364,6 +4367,8 @@ v0.33.19 26-Oct-2001
The mbfile check function now converts the short filenames The mbfile check function now converts the short filenames
to DOS 8.3 filenames. (The first time this logs lots of to DOS 8.3 filenames. (The first time this logs lots of
errors). errors).
The mbfile list function now gives a listing of the contents
of a file area if the area number is given as argument.
mball: mball:
The index function is now obsolete, this is added to mbfile. The index function is now obsolete, this is added to mbfile.

View File

@ -151,8 +151,12 @@
#define KEY_PGDN 209 #define KEY_PGDN 209
#ifndef LINES
#define LINES 24 #define LINES 24
#endif
#ifndef COLS
#define COLS 80 #define COLS 80
#endif
/* /*

View File

@ -31,7 +31,6 @@
#ifndef _MBSE_H #ifndef _MBSE_H
#define _MBSE_H #define _MBSE_H
#define LINES 24 /* Lines for MoreFile */
#define LANG 500 /* Amount of Language Entries */ #define LANG 500 /* Amount of Language Entries */

View File

@ -44,11 +44,11 @@ extern int do_quiet; /* Supress screen output */
void ListFileAreas(int Area) void ListFileAreas(int Area)
{ {
FILE *pAreas, *pFile; FILE *pAreas, *pFile, *pTic;
int i, iAreas, fcount, tcount = 0; int i, iAreas, fcount, tcount = 0;
int iTotal = 0; int iTotal = 0;
long fsize, tsize = 0; long fsize, tsize = 0;
char *sAreas, *fAreas, flags[6]; char *sAreas, *fAreas, *sTic, flags[6], *ticarea;
/* /*
* If nothing to display allowed, return at once. * If nothing to display allowed, return at once.
@ -57,11 +57,12 @@ void ListFileAreas(int Area)
return; return;
colour(LIGHTRED, BLACK); colour(LIGHTRED, BLACK);
sAreas = calloc(PATH_MAX, sizeof(char)); sAreas = calloc(PATH_MAX, sizeof(char));
fAreas = calloc(PATH_MAX, sizeof(char)); fAreas = calloc(PATH_MAX, sizeof(char));
sTic = calloc(PATH_MAX, sizeof(char));
ticarea = calloc(21, sizeof(char));
sprintf(sAreas, "%s/etc/fareas.data", getenv("MBSE_ROOT")); sprintf(sAreas, "%s/etc/fareas.data", getenv("MBSE_ROOT"));
if ((pAreas = fopen (sAreas, "r")) == NULL) { if ((pAreas = fopen (sAreas, "r")) == NULL) {
WriteError("Can't open %s", sAreas); WriteError("Can't open %s", sAreas);
printf("Can't open %s\n", sAreas); printf("Can't open %s\n", sAreas);
@ -75,6 +76,14 @@ void ListFileAreas(int Area)
if (Area) { if (Area) {
IsDoing("List area %d", Area); IsDoing("List area %d", Area);
sprintf(sTic, "%s/etc/tic.data", getenv("MBSE_ROOT"));
if ((pTic = fopen(sTic, "r")) == NULL) {
WriteError("Can't open %s", sTic);
printf("Can't open %s\n", sTic);
die(0);
}
fread(&tichdr, sizeof(tichdr), 1, pTic);
if (fseek(pAreas, ((Area - 1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET)) { if (fseek(pAreas, ((Area - 1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET)) {
WriteError("$Can't seek area %d", Area); WriteError("$Can't seek area %d", Area);
printf("Can't seek area %d\n", Area); printf("Can't seek area %d\n", Area);
@ -104,8 +113,12 @@ void ListFileAreas(int Area)
fsize = 0L; fsize = 0L;
colour(CYAN, BLACK); colour(CYAN, BLACK);
printf("File listing of area %d, %s\n\n", Area, area.Name); printf("File listing of area %d, %s\n\n", Area, area.Name);
printf("File name Kbytes File date Dnlds Flags Description\n"); printf("Short name Kb. File date Down Flags TIC Area Long name\n");
printf("------------ ------ ---------- ----- ----- ------------------------------------\n"); printf("------------ ----- ---------- ---- ----- -------------------- ");
for (i = 63; i < COLS; i++)
printf("-");
printf("\n");
colour(LIGHTGRAY, BLACK); colour(LIGHTGRAY, BLACK);
while (fread(&file, sizeof(file), 1, pFile) == 1) { while (fread(&file, sizeof(file), 1, pFile) == 1) {
@ -121,18 +134,37 @@ void ListFileAreas(int Area)
if (file.Announced) if (file.Announced)
flags[4] = 'A'; flags[4] = 'A';
if (strlen(file.Desc[0]) > 36) if (file.TicAreaCRC) {
file.Desc[0][36] = '\0'; /*
printf("%-12s %6ld %s %5ld %s %s\n", * Fill the default answer
*/
sprintf(ticarea, "Not found");
fseek(pTic, tichdr.hdrsize, SEEK_SET);
while (fread(&tic, tichdr.recsize, 1, pTic)) {
if (StringCRC32(tic.Name) == file.TicAreaCRC) {
sprintf(ticarea, "%s", tic.Name);
break;
}
fseek(pTic, tichdr.syssize, SEEK_CUR);
}
} else {
sprintf(ticarea, "N/A");
}
file.LName[COLS - 63] = '\0';
printf("%-12s %5ld %s %4ld %s %-20s %s\n",
file.Name, (long)(file.Size / 1024), StrDateDMY(file.FileDate), file.Name, (long)(file.Size / 1024), StrDateDMY(file.FileDate),
(long)(file.TimesDL + file.TimesFTP + file.TimesReq), flags, file.Desc[0]); (long)(file.TimesDL + file.TimesFTP + file.TimesReq), flags, ticarea, file.LName);
fcount++; fcount++;
fsize = fsize + file.Size; fsize = fsize + file.Size;
} }
fsize = fsize / 1024; fsize = fsize / 1024;
colour(CYAN, BLACK); colour(CYAN, BLACK);
printf("-------------------------------------------------------------------------------\n"); printf("--------------------------------------------------------------");
for (i = 63; i < COLS; i++)
printf("-");
printf("\n");
printf("%d file%s, %ld Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize); printf("%d file%s, %ld Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize);
} else { } else {
@ -141,8 +173,11 @@ void ListFileAreas(int Area)
return; return;
} }
fclose(pTic);
free(ticarea);
free(sAreas); free(sAreas);
free(fAreas); free(fAreas);
free(sTic);
return; return;
} }
@ -189,7 +224,9 @@ void ListFileAreas(int Area)
printf("----- ----- ----- ---------------------------------------------------------\n"); printf("----- ----- ----- ---------------------------------------------------------\n");
printf("%5d %5d %5ld \n", iTotal, tcount, tsize); printf("%5d %5d %5ld \n", iTotal, tcount, tsize);
fclose(pAreas); fclose(pAreas);
free(ticarea);
free(sAreas); free(sAreas);
free(fAreas); free(fAreas);
free(sTic);
} }

View File

@ -28,8 +28,12 @@
#define KEY_PGDN 209 #define KEY_PGDN 209
#ifndef LINES
#define LINES 24 #define LINES 24
#endif
#ifndef COLS
#define COLS 80 #define COLS 80
#endif
/* /*