home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / DWNSRS56.ZIP / DOWNVARS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-09  |  8.4 KB  |  177 lines

  1. /* ============================================================= */
  2. /*  Rob Hamerling's MAXIMUS download file scan and sort utility  */
  3. /*  -> DOWNVARS.C                                                */
  4. /*  -> Global data: variables and tables                         */
  5. /* ============================================================= */
  6.  
  7. #define INCL_BASE
  8. #include <os2.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <time.h>
  12.  
  13. #include "..\max\mstruct.h"
  14. #include "downsort.h"
  15.  
  16. char VERSION      = '5';                // current version
  17. char SUBVERS      = '6';                // current release
  18. char SUFFIX       = 'h';                // development suffix
  19.  
  20. char AC[]         = "Area";
  21. char AUTHOR[]     = "Rob Hamerling";    // program author
  22. char BAK[]        = "BAK";              // backup file extension
  23. char BY[]         = "Bytes";
  24. char CFG[]        = "CFG";              // config file extension
  25. char CITY[]       = "Vianen, The Netherlands";
  26. char DAYS[]       = "days ";
  27. char DF[]         = "Date flag: new on this system since:";
  28. char DOT[]        = ".";
  29. char DS[]         = "Description";
  30. char DT[]         = "Date";
  31. char EMPTY[]      = "";                 // empty string
  32. char FIDO[]       = "Fido-net 2:512/4.1098";
  33. char FN[]         = "Filename";
  34. char FP[]         = "FilePath";
  35. char FS[]         = "Files";
  36. char MAX[]        = "MAXIMUS CBCS";
  37. char MO[]         = " = 1 month";
  38. char MONTHS[]     = "months ";
  39. char MP[]         = "Maximum privilege shown: ";
  40. char MSG_MEM[]    = "\nInsufficient memory, %s terminated\n";
  41. char MSG_SRT[]    = "\nSorting %u files from %u areas for %s";
  42. char MSG_RST[]    = "\nRe-sorting first %u entries on filename";
  43. char MSG_TRL[]    = "\n       Warning: Include-file - %s - not found!";
  44. char MSG_REC[]    = "\n       File entries written";
  45. char MSG_REP[]    = "\nWriting %s";     // progress msg
  46. char MSG_ZF[]     = "\nNot a single list%s falls withing report criteria, or";
  47. char MSG_ZY[]     = "\nMaximum supported files (%u) exceeded, %s terminated\n";
  48. char MSG_ZP[]     = "\nno download paths found at all, %s terminated\n";
  49. char NDS[46]      = "--- no description available ---";
  50. char OFFLINE[16]  = " -- OFFLINE -- ";
  51. char OPEN_FAIL[]  = "\n       Open failed for: %s, rc=%d";
  52. char OPEN_ACTN[]  = "\n       Open Action code for %s is: %d";
  53. char ORPHAN[46]   = "************ ORPHAN ************";
  54. char PHONE[]      = "Phone 31.3473.72136 (voice)";
  55. char PROGDESC[]   = "DOWNload file SORT and list utility";
  56. char PROGNAME[]   = "DOWNSORT";         // program name (and list-fnames)
  57. char SZ[]         = "Size";
  58. char SUMM[]       = " Summary";
  59. char TM[]         = "Time";
  60. char WEEKS[]      = "weeks ";
  61. char WK[]         = " = 1 week";
  62. char WRITE[]      = "w";
  63.  
  64. char *priv_name[] = {"Twit",
  65.                      " ",               // not used
  66.                      "Disgrace",
  67.                      "Limited",
  68.                      "Normal",
  69.                      "Worthy",
  70.                      "Privil",
  71.                      "Favored",
  72.                      "Extra",
  73.                      "Clerk",
  74.                      "AsstSysop",
  75.                      " ",               // not used
  76.                      "Sysop",
  77.                      "Hidden"};
  78.  
  79. char today[26];                         // output timestamp
  80. char list_title[21]    = "";            // ALL/IPF/NEW/GBL BLOCK title
  81.  
  82. char *pre_title[MAXTIT]= {NULL,NULL,NULL,NULL,NULL,  // pretitles
  83.                           NULL,NULL,NULL,NULL,NULL,
  84.                           NULL,NULL,NULL,NULL,NULL,
  85.                           NULL,NULL,NULL,NULL,NULL};
  86. char *sub_title[MAXTIT]= {NULL,NULL,NULL,NULL,NULL,  // subtitles
  87.                           NULL,NULL,NULL,NULL,NULL,
  88.                           NULL,NULL,NULL,NULL,NULL,
  89.                           NULL,NULL,NULL,NULL,NULL};
  90. char *bot_lines[MAXTIT]= {NULL,NULL,NULL,NULL,NULL,  // bottomlines
  91.                           NULL,NULL,NULL,NULL,NULL,
  92.                           NULL,NULL,NULL,NULL,NULL,
  93.                           NULL,NULL,NULL,NULL,NULL};
  94.  
  95. char selected_area[201][MAXANAME] = { '\0' }; // + last entry indicator
  96. char areadat_path[128] = "AREA.DAT";    // (default) AREA.DAT filespec
  97. char cfg_path[128]     = "DOWNSORT.CFG";// (default) config filespec
  98. char buf2[MAXRCD]      = "";            // text manipulation buffer
  99. char filesbbs_path[128]= "";            // path to FILES.bbs output
  100. char oper_mode         = ' ';           // V: verbose: talk a lot
  101.                                         // Q: only error messages
  102.                                         // H: display help-screen
  103. int   area_IN_EX       = 0;             // area selection (+1 = INclude)
  104.                                         //                (-1 = EXclude)
  105. char  area_seq         = GROUP;         // area sort sequence
  106. char  strip_ava        = 'Y';           // default: strip AVATAR graphics
  107. unsigned short int title_lines[] = {0,3,5,4,5};  // # of lines per title-font
  108.                                         // See DOWNFNT.C for 'real' table.
  109. unsigned int max_aname = 0;             // actual maximum length of areaname
  110. unsigned int area_total_count  = 0;     // number of area's with files
  111. unsigned int file_total_count  = 0;     // counter for number of files
  112. unsigned long byte_count = 0;           // counter for file sizes
  113. int    MAX_level       = 0;             // version of MAX from AREA.DAT
  114. int    ABS_MAX_priv    = TWIT;          // overall max report-privilege
  115. struct _filechain *first_element = NULL; // ptr first chain element
  116. struct _COUNTRYCODE c_code;             // country code buffer
  117. struct _COUNTRYINFO c_info;             // country information buffer
  118.  
  119. struct _listparm lp[]  = {
  120.       {                                 // BBS-list (P_BBS)
  121.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  122.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  123.         FONT2, 65535, "DOWNSORT.HDR", ' ', TIMESTAMP, TRUNC, ' ', ' ',
  124.         "DOWNSORT", "BBS"},
  125.       {                                 // FILES.BBS (P_FIL)
  126.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  127.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  128.         FONT2, 65535, NULL, ' ', KEEPSEQ, TRUNC, ' ', ' ',
  129.         "FILES", "BBS"},
  130.       {                                 // GBL-list (P_GBL)
  131.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  132.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  133.         FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
  134.         "DOWNSORT", "G~"},
  135.       {                                 // NEW-list (P_NEW)
  136.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  137.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  138.         FONT2, 65535, NULL, ' ', TIMESTAMP, TRUNC, ' ', ' ',
  139.         "DOWNSORT", "N~"},
  140.       {                                 // ALL-list (P_ALL)
  141.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  142.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  143.         FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
  144.         "DOWNSORT", "A~"},
  145.       {                                 // IPF-list (P_IPF)
  146.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  147.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  148.         FONT2, 250, NULL, ' ', ALPHA, WRAP, ' ', ' ',
  149.         "DOWNSORT", "I~"},
  150.       {                                 // DUP-list (P_DUP)
  151.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  152.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  153.         FONT2, 65535, NULL, ' ', ALPHA, WRAP, ' ', ' ',
  154.         "DOWNSORT", "DUP"},
  155.       {                                 // ORP-list (P_ORP)
  156.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  157.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  158.         FONT2, 65535, NULL, ' ', ALPHA, TRUNC, ' ', ' ',
  159.         "DOWNSORT", "ORP"},
  160.       {                                 // OK-file (P_OK)
  161.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  162.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  163.         FONT2, 65535, NULL, ' ', ALPHA, TRUNC, ' ', ' ',
  164.         "DOWNSORT", "O~"},
  165.       {                                 // IPF2-file (P_IP2)
  166.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  167.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  168.         FONT2, 250, NULL, ' ', ALPHA, WRAP, ' ', ' ',
  169.         "DOWNSORT", "I~"},
  170.       {                                 // EMI-file (P_EMI)
  171.        {HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,
  172.         HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1,HIDDEN+1},
  173.         FONT2, 65535, NULL, ' ', TIMESTAMP, WRAP, ' ', ' ',
  174.         "DOWNSORT", "E~"},
  175.          };
  176.  
  177.