home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / OS2 / DWNSRT47.ZIP / DOWNSORT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-01  |  6.6 KB  |  184 lines

  1. /*
  2.  
  3.   header file for DOWNSORT.C */
  4.  
  5. #define bit   unsigned
  6. #define sword signed int
  7. #define word  unsigned int
  8. #define dword long int
  9. #define byte  unsigned char
  10.  
  11. #include "..\maximus\area_max.h"        // AREA.DAT layout union
  12.  
  13. /*----------------------------*/
  14. /* MAXIMUS user Access levels */
  15. /*----------------------------*/
  16. #define TWIT        (-2)
  17. #define DISGRACE     0
  18. #define LIMITED      1
  19. #define NORMAL       2
  20. #define WORTHY       3
  21. #define PRIVIL       4
  22. #define FAVORED      5
  23. #define EXTRA        6
  24. #define CLERK        7
  25. #define ASSTSYSOP    8
  26. #define SYSOP       10
  27. #define HIDDEN      11
  28.  
  29. #define MAXFN       13
  30. #define MAXRCD     255
  31. #define MAXDESC    (MAXRCD-MAXFN-2)
  32. #define MAXPATH    128
  33. #define MAXTIT      10
  34.  
  35. #define TRUNC       'T'
  36. #define WRAP        'W'
  37. #define QUIET       'Q'
  38. #define VERBOSE     'V'
  39. #define HELP        'H'
  40. #define QMARK       '?'
  41. #define ALPHA       'A'
  42. #define TIMESTAMP   'D'
  43. #define FONT        'F'
  44.  
  45. #define DAYS_30     '+'
  46. #define DAYS_7      '*'
  47.  
  48. #define FONT0       0
  49. #define FONT1       1
  50. #define FONT2       2
  51. #define FONT3       3
  52. #define FONT4       4
  53. #define LINE1       0
  54. #define LINE2       1
  55. #define LINE3       2
  56. #define LINE4       3
  57. #define LINE5       4
  58.  
  59. /* (foreground) COLORS */
  60.  
  61. #define O_BLINK   0x80
  62. #define O_BRIGHT  0x08
  63. #define O_LIGHT   0x08
  64.  
  65. #define O_BLACK   0x00
  66. #define O_BLUE    0x01
  67. #define O_GREEN   0x02
  68. #define O_CYAN    0x03
  69. #define O_RED     0x04
  70. #define O_MAGENTA 0x05
  71. #define O_BROWN   0x06
  72. #define O_GRAY    0x07
  73. #define O_YELLOW  (O_BRIGHT+O_BROWN)
  74. #define O_WHITE   (O_BRIGHT+O_GRAY)
  75.  
  76.  
  77. struct _filechain {                     // file information
  78.         struct _filechain *next_element; // to next element
  79.         struct _downpath *parea;        // pointer to area-structure
  80.         struct _FDATE wdate;            // file date (last write)
  81.         struct _FTIME wtime;            // file time (last write)
  82.         struct _FDATE cdate;            // file date (creation)
  83.         struct _FTIME ctime;            // file time (creation)
  84.         ULONG  size;                    // file size
  85.         USHORT attr;                    // attribute
  86.         int    priv;                    // privilege
  87.         char   fname[MAXFN];            // filename
  88.         char   *fdesc;                  // ptr to file description
  89.           };
  90.  
  91. struct _downpath {                      // download area information
  92.         int  priv;                      // Area Privilege integer
  93.         char name[40];                  // Area name
  94.         USHORT file_count;              // Area file count for area summary
  95.         ULONG  byte_count;              // Area byte count for area summary
  96.         char pname[80];                 // Download-pathname
  97.         char filesbbs[80];              // Path to FILES.BBS
  98.         char adesc[80];                 // Filearea description
  99.           };
  100.  
  101. #define P_BBS  0                        // Symbolic parameter table
  102. #define P_FIL  1                        // entry index values
  103. #define P_GBL  2                        // for the different lists
  104. #define P_NEW  3
  105. #define P_ALL  4
  106. #define P_ORP  5
  107. #define P_MAX  5                        // indicates highest index!
  108.  
  109. struct _listparm {                      // list parameters
  110.         int  priv[10];                  // max file priv to list
  111.         int  tfont;                     // title font
  112.         unsigned int max_fil;           // maximum # of files to list
  113.         char sortflag;                  // file sequence (name/date)
  114.         char wrapflag;                  // wrap or truncate
  115.         char name[9];                   // list filename
  116.         char ext[4];                    // list filename
  117.           };
  118.  
  119. /* externs for global variables */
  120.  
  121. extern char   PROGNAME[],PROGDESC[],AUTHOR[],CITY[],PHONE[],FIDO[];
  122. extern char   VERSION,SUBVERS,SUFFIX;
  123. extern char   MAX[],MSG_MEM[],MSG_SRT[],MSG_RST[],MSG_TRL[],MSG_REC[],
  124.               OPEN_FAIL[],HS[],HD[],FN[],AC[],DT[],SZ[],DS[],FP[],NDS[],
  125.               ORPHAN[],BAK[],EMPTY[];
  126. extern char   today[],list_title[],
  127.               filesbbs_path[],areadat_path[],cfg_path[],
  128.               all_fname[],new_fname[],bbs_fname[],gbl_fname[],orp_fname[];
  129. extern char   *priv_name[],*pre_title[],*sub_title[],*bot_lines[];
  130. extern char   wrap_flag,oper_mode,sort_mode;
  131. extern USHORT area_count,file_count,title_font;
  132. extern USHORT title_lines[];
  133. extern int    MAX_level,
  134.               bbs_priv[],gbl_priv[],new_priv[],all_priv[],fil_priv[];
  135. extern ULONG  byte_count;
  136. extern struct _filechain *first_element;
  137. extern struct _listparm lp[];
  138. extern struct _COUNTRYCODE c_code;
  139. extern struct _COUNTRYINFO c_info;
  140.  
  141. /*  function prototypes */
  142.  
  143. char    *asciiz(char *);
  144. USHORT   collect_down(struct _downpath **);
  145. USHORT   collect_file(USHORT, struct _downpath *);
  146. int      conv_priv(char *, int *, USHORT);
  147. char    *f_date(struct _FDATE);
  148. char    *f_time(struct _FTIME);
  149. char     file_age_ind(struct _FDATE, struct _FTIME);
  150. long     file_time(struct _FDATE, struct _FTIME);
  151. USHORT   fill_chn(struct _downpath *,
  152.                   struct _filechain **,struct _filechain **);
  153. void     get_desc(int, struct _filechain *, struct _downpath *);
  154. void     get_parm(int,char *[]);
  155. void     list_parm(int, char *, int);
  156. void     make_all(struct _filechain **,struct _downpath *, int);
  157. void     make_bbs(struct _filechain **, USHORT, int);
  158. void     make_fil(struct _filechain **, int);
  159. void     make_gbl(struct _filechain **, int);
  160. void     make_new(struct _filechain **, USHORT, int);
  161. void     make_orp(struct _filechain **);
  162. char    *next_word(char *);
  163. struct _filechain *new_acq(struct _filechain *, struct _filechain *);
  164. int     parse_keyword(char *,char **);
  165. struct _filechain **prep_sort(USHORT, struct _filechain *);
  166. void     psort(struct _filechain **, int, int, int (*)());
  167. void     read_cfg(char *);
  168. void     show_help(void);
  169. void     show_welcome(void);
  170. void     signature(void *, char *);
  171. int      sort_all(struct _filechain **, struct _filechain **);
  172. int      sort_al2(struct _filechain **, struct _filechain **);
  173. int      sort_fil(struct _filechain **, struct _filechain **);
  174. int      sort_gbl(struct _filechain **, struct _filechain **);
  175. int      sort_new(struct _filechain **, struct _filechain **);
  176. int      sort_summ(struct _downpath *, struct _downpath *);
  177. char    *strnblk(char *, int, int, int);
  178. int      strsubw(char *, char **, int);
  179. char    *sys_date(char *);
  180. int      non_wild_init(int, char *, char *);
  181. void     title_line(char *, char *[]);
  182. int      wild_init(int, char *, char *);
  183. int      wild_comp(int, char *,char *);
  184.