home *** CD-ROM | disk | FTP | other *** search
- /* ============================================================= */
- /* Rob Hamerling's MAXIMUS download file scan and sort utility */
- /* -> DOWNVARS.C */
- /* -> Global data: variables and tables */
- /* ============================================================= */
-
- #define INCL_BASE
- #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 = '6'; // current release
- char SUFFIX = 'h'; // 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 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_MEM[] = "\nInsufficient memory, %s terminated\n";
- char MSG_SRT[] = "\nSorting %u files from %u areas for %s";
- char MSG_RST[] = "\nRe-sorting first %u entries on filename";
- char MSG_TRL[] = "\n Warning: Include-file - %s - not found!";
- char MSG_REC[] = "\n File entries written";
- char MSG_REP[] = "\nWriting %s"; // progress msg
- char MSG_ZF[] = "\nNot a single list%s falls withing report criteria, or";
- char MSG_ZY[] = "\nMaximum supported files (%u) exceeded, %s terminated\n";
- char MSG_ZP[] = "\nno download paths found at all, %s terminated\n";
- char NDS[46] = "--- no description available ---";
- char OFFLINE[16] = " -- OFFLINE -- ";
- char OPEN_FAIL[] = "\n Open failed for: %s, rc=%d";
- char OPEN_ACTN[] = "\n Open Action code for %s is: %d";
- 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 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 = ' '; // V: verbose: talk a lot
- // Q: 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 title-font
- // See DOWNFNT.C for 'real' table.
- unsigned int max_aname = 0; // actual maximum length of 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
- struct _filechain *first_element = NULL; // ptr first chain element
- struct _COUNTRYCODE c_code; // country code buffer
- struct _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},
- FONT2, 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~"},
- };
-
-