home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
os2
/
dwnsrs57.zip
/
DOWNVARS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-17
|
10KB
|
195 lines
/* ============================================================= */
/* Rob Hamerling's MAXIMUS download file scan and sort utility */
/* -> DOWNVARS.C */
/* -> Global data: variables and tables */
/* ============================================================= */
#define INCL_BASE
#define INCL_NOPMAPI
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "..\max\mstruct.h"
#include "downsort.h"
char VERSION = '5'; /* current version */
char SUBVERS = '7'; /* current release */
char SUFFIX = 'd'; /* development suffix */
char AC[] = "Area";
char AUTHOR[] = "Rob Hamerling"; /* program author */
char BAK[] = "BAK"; /* backup file extension */
char BY[] = "Bytes";
char CFG[] = "CFG"; /* config file extension */
char CITY[] = "Vianen, The Netherlands";
char DAYS[] = "days ";
char DF[] = "Date flag: new on this system since:";
char DOT[] = ".";
char DS[] = "Description";
char DT[] = "Date";
char EMPTY[] = ""; /* empty string */
char FIDO[] = "Fido-net 2:512/4.1098";
char FILPREFX[] = "-δ";
char FN[] = "Filename";
char FP[] = "FilePath";
char FS[] = "Files";
char MAX[] = "MAXIMUS CBCS";
char MO[] = " = 1 month";
char MONTHS[] = "months ";
char MP[] = "Maximum privilege shown: ";
char MSG_ARE[] = "\tfiles in DL-dir %s (area %s)\r";
char MSG_CFG[] = "Reading configuration file: %s\n";
char MSG_COA[] = "Collecting file-area information from %s\n";
char MSG_COF[] = "Collecting file data\n";
char MSG_FNT[] = "Error: TitleFont out of range\n";
char MSG_IEC[] = "Internal error in data collection phase, "
"counted: %u entries, chainsize=%u\n";
char MSG_KWD[] = "Unknown keyword or missing parameter value in:"
"\n\t%-50.50s\n";
char MSG_MEM[] = "Insufficient memory, %s terminated\n";
char MSG_MX1[] = "Sorry, %s-file has unsupported AREA.DAT format!\n";
char MSG_MX2[] = "%s %c.%c%c works only for %s version 2.00 and up!\n";
char MSG_OPA[] = "\tOpen Action error for %s: %d\n";
char MSG_OPI[] = "\tCould not open inputfile: %s, rc=%d\n";
char MSG_OPO[] = "\tCould not open outputfile: %s, rc=%d\n";
char MSG_ORP[] = " %5u\torphans detected and dropped (in total)\n";
char MSG_REC[] = " \tFile entries written\r";
char MSG_REP[] = "Writing %s\n";
char MSG_RST[] = "Re-sorting first %u entries on filename\n";
char MSG_SRT[] = "Sorting %u files from %u areas for %s\n";
char MSG_TRL[] = " \tWarning: Include-file - %s - not found!\n";
char MSG_UNK[] = "Unknown Parameter: %-50.50s\n";
char MSG_ZF[] = "Not a single list%s falls withing report criteria, or\n";
char MSG_ZP[] = "no download paths found at all, %s terminated\n";
char MSG_ZY[] = "Maximum supported files (%u) exceeded, %s terminated\n";
char NDS[46] = "--- no description available ---";
char OFFLINE[16] = " -- OFFLINE -- ";
char ORPHAN[46] = "************ ORPHAN ************";
char PHONE[] = "Phone 31.3473.72136 (voice)";
char PROGDESC[] = "DOWNload file SORT and list utility";
char PROGNAME[] = "DOWNSORT"; /* program name (and list-fnames)*/
char SZ[] = "Size";
char SUMM[] = " Summary";
char TM[] = "Time";
char WEEKS[] = "weeks ";
char WK[] = " = 1 week";
char WRITE[] = "w";
char *priv_name[] = {"Twit",
" ", /* not used */
"Disgrace",
"Limited",
"Normal",
"Worthy",
"Privil",
"Favored",
"Extra",
"Clerk",
"AsstSysop",
" ", /* not used */
"Sysop",
"Hidden"};
char today[26]; /* output timestamp */
char list_title[21] = ""; /* ALL/IPF/NEW/GBL BLOCK title */
char *pre_title[MAXTIT]= {NULL,NULL,NULL,NULL,NULL, /* pretitles */
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL};
char *sub_title[MAXTIT]= {NULL,NULL,NULL,NULL,NULL, /* subtitles */
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL};
char *bot_lines[MAXTIT]= {NULL,NULL,NULL,NULL,NULL, /* bottomlines */
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL};
char non_dup_ext[201][4] = { "" }; /* non_dup extension pair array */
char selected_area[201][MAXANAME] = { '\0' }; /* + last entry indicator */
char areadat_path[128] = "AREA.DAT"; /* (default) AREA.DAT filespec */
char cfg_path[128] = "DOWNSORT.CFG";/* (default) config filespec */
char buf2[MAXRCD] = ""; /* text manipulation buffer */
char filesbbs_path[128]= ""; /* path to FILES.BBS output */
char oper_mode = ' '; /* blank: give some progress info*/
/* V=verbose: extensive reporting*/
/* Q=quit (only error messages) */
/* H: display help-screen */
int area_IN_EX = 0; /* area selection (+1 = INclude) */
/* (-1 = EXclude) */
char area_seq = GROUP; /* area sort sequence */
char strip_ava = 'Y'; /* default: strip AVATAR graphics*/
unsigned short int title_lines[] = {0,3,5,4,5}; /* # of lines per font */
/* See DOWNFNT.C for 'real' table*/
unsigned int max_aname = 0; /* actual maximum length areaname*/
unsigned int area_total_count = 0; /* number of area's with files */
unsigned int file_total_count = 0; /* counter for number of files */
unsigned long byte_count = 0; /* counter for file sizes */
int MAX_level = 0; /* version of MAX from AREA.DAT */
int ABS_MAX_priv = TWIT; /* overall max report-privilege */
FILECHAIN *first_element = NULL; /* ptr first chain element */
COUNTRYCODE c_code; /* country code buffer */
COUNTRYINFO c_info; /* country information buffer */
struct _listparm lp[] = {
{ /* BBS-list (P_BBS) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, "DOWNSORT.HDR", ' ', TIMESTAMP, TRUNC, ' ', ' ',
"DOWNSORT", "BBS"},
{ /* FILES.BBS (P_FIL) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT3, 65535, NULL, ' ', KEEPSEQ, TRUNC, ' ', ' ',
"FILES", "BBS"},
{ /* GBL-list (P_GBL) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
"DOWNSORT", "G~"},
{ /* NEW-list (P_NEW) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', TIMESTAMP, TRUNC, ' ', ' ',
"DOWNSORT", "N~"},
{ /* ALL-list (P_ALL) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
"DOWNSORT", "A~"},
{ /* IPF-list (P_IPF) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 250, NULL, ' ', ALPHA, WRAP, ' ', ' ',
"DOWNSORT", "I~"},
{ /* DUP-list (P_DUP) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
"DOWNSORT", "DUP"},
{ /* ORP-list (P_ORP) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', ALPHA, TRUNC, ' ', ' ',
"DOWNSORT", "ORP"},
{ /* OK-file (P_OK) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', ALPHA, TRUNC, ' ', ' ',
"DOWNSORT", "O~"},
{ /* IPF2-file (P_IP2) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 250, NULL, ' ', ALPHA, WRAP, ' ', ' ',
"DOWNSORT", "I~"},
{ /* EMI-file (P_EMI) */
{HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
FONT2, 65535, NULL, ' ', TIMESTAMP, WRAP, ' ', ' ',
"DOWNSORT", "E~"},
};