home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / com / bbs / downsrt / source / downsort.h < prev    next >
C/C++ Source or Header  |  1991-06-07  |  7KB  |  197 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     256
  31. #define MAXDESC    (MAXRCD-MAXFN-3)
  32. #define MAXPATH    128
  33. #define MAXTIT      20
  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 KEEPSEQ     'K'
  44. #define FONT        'F'
  45. #define EXCLPRIV    'X'
  46. #define INCLUDE     'I'
  47.  
  48. #define DAYS_30     '+'
  49. #define DAYS_7      '*'
  50.  
  51. #define FONT0       0
  52. #define FONT1       1
  53. #define FONT2       2
  54. #define FONT3       3
  55. #define FONT4       4
  56. #define LINE1       0
  57. #define LINE2       1
  58. #define LINE3       2
  59. #define LINE4       3
  60. #define LINE5       4
  61.  
  62. /* (foreground) COLORS */
  63.  
  64. #define O_BLINK   0x80
  65. #define O_BRIGHT  0x08
  66. #define O_LIGHT   0x08
  67.  
  68. #define O_BLACK   0x00
  69. #define O_BLUE    0x01
  70. #define O_GREEN   0x02
  71. #define O_CYAN    0x03
  72. #define O_RED     0x04
  73. #define O_MAGENTA 0x05
  74. #define O_BROWN   0x06
  75. #define O_GRAY    0x07
  76. #define O_YELLOW  (O_BRIGHT+O_BROWN)
  77. #define O_WHITE   (O_BRIGHT+O_GRAY)
  78.  
  79.  
  80. struct _filechain {                     // file information
  81.         struct _filechain *next_element; // to next element
  82.         struct _downpath *parea;        // pointer to area-structure
  83.         struct _FDATE wdate;            // file date (last write)
  84.         struct _FTIME wtime;            // file time (last write)
  85.         struct _FDATE cdate;            // file date (creation)
  86.         struct _FTIME ctime;            // file time (creation)
  87.         ULONG  size;                    // file size
  88.         USHORT attr;                    // attribute
  89.         USHORT fseq;                    // FILES.BBS sequence number
  90.         int    priv;                    // privilege
  91.         char   fname[MAXFN];            // filename
  92.         char   *fdesc;                  // ptr to file description
  93.           };
  94.  
  95. struct _downpath {                      // download area information
  96.         int  priv;                      // Area Privilege integer
  97.         char name[40];                  // Area name
  98.         USHORT file_count;              // Area file count for area summary
  99.         ULONG  byte_count;              // Area byte count for area summary
  100.         char pname[80];                 // Download-pathname
  101.         char filesbbs[80];              // Path to FILES.BBS
  102.         char adesc[80];                 // Filearea description
  103.           };
  104.  
  105. #define P_BBS  0                        // Symbolic parameter table
  106. #define P_FIL  1                        // entry index values
  107. #define P_GBL  2                        // for the different lists
  108. #define P_NEW  3
  109. #define P_ALL  4
  110. #define P_IPF  5
  111. #define P_ORP  6
  112. #define P_MAX  6                        // indicates highest index!
  113.  
  114. struct _listparm {                      // list parameters
  115.         int  priv[10];                  // max file priv to list
  116.         int  tfont;                     // title font
  117.         unsigned int max_fil;           // maximum # of files to list
  118.         char sortflag;                  // file sequence (name/date)
  119.         char wrapflag;                  // wrap or truncate
  120.         char exclflag;                  // privilege indication flag
  121.         char name[9];                   // list filename
  122.         char ext[4];                    // list extension
  123.         char *incl_fspec;               // ptr to include-filespec
  124.           };
  125.  
  126. /* externs for global variables */
  127.  
  128. extern char   PROGNAME[],PROGDESC[],AUTHOR[],CITY[],PHONE[],FIDO[];
  129. extern char   VERSION,SUBVERS,SUFFIX;
  130. extern char   MAX[],MSG_MEM[],MSG_SRT[],MSG_RST[],MSG_TRL[],MSG_REC[],
  131.               OPEN_FAIL[],DESC_MISS[],
  132.               HS[],HD[],FN[],AC[],DT[],SZ[],DS[],FP[],NDS[],ORPHAN[],
  133.               BAK[],EMPTY[];
  134. extern char   today[],list_title[],
  135.               filesbbs_path[],areadat_path[],cfg_path[];
  136. extern char   *priv_name[],*pre_title[],*sub_title[],*bot_lines[];
  137. extern char   wrap_flag,oper_mode,sort_mode;
  138. extern USHORT area_count,file_count,title_font;
  139. extern USHORT title_lines[];
  140. extern int    MAX_level,ABS_MAX_priv;
  141. extern ULONG  byte_count;
  142. extern struct _filechain *first_element;
  143. extern struct _listparm lp[];
  144. extern struct _COUNTRYCODE c_code;
  145. extern struct _COUNTRYINFO c_info;
  146.  
  147. /*  function prototypes */
  148.  
  149. char    *asciiz(char *);
  150. USHORT   collect_down(struct _downpath **);
  151. USHORT   collect_file(USHORT, struct _downpath *);
  152. void     file_incl(FILE *, char[]);
  153. int      conv_priv(char *, int *, USHORT);
  154. USHORT   count_areas(struct _downpath *, int);
  155. ULONG    count_bytes(struct _filechain **, int);
  156. USHORT   count_files(struct _filechain **, int);
  157. char    *f_date(struct _FDATE);
  158. char    *f_time(struct _FTIME);
  159. char     file_age_ind(struct _FDATE, struct _FTIME);
  160. long     file_time(struct _FDATE, struct _FTIME);
  161. USHORT   fill_chn(struct _downpath *, struct _filechain **);
  162. USHORT   free_orphan(struct _filechain *);
  163. void     get_desc(USHORT, struct _filechain *, struct _downpath *);
  164. void     get_parm(int,char *[]);
  165. void     list_parm(int, char *, int);
  166. void     make_all(struct _filechain **, struct _downpath *, int);
  167. void     make_bbs(struct _filechain **, USHORT, int);
  168. void     make_fil(struct _filechain **, int);
  169. void     make_gbl(struct _filechain **, int);
  170. void     make_ipf(struct _filechain **, struct _downpath *, int);
  171. void     make_new(struct _filechain **, USHORT, int);
  172. void     make_orp(struct _filechain **);
  173. char    *next_word(char *);
  174. struct _filechain *new_acq(struct _filechain *, struct _filechain *);
  175. int     parse_keyword(char *,char **);
  176. struct _filechain **prep_sort(USHORT, struct _filechain *);
  177. void     psort(struct _filechain **, int, int, int (*)(void *, void *));
  178. void     read_cfg(char *);
  179. void     show_help(void);
  180. void     show_welcome(void);
  181. void     signature(void *, char *);
  182. int      sort_all(struct _filechain **, struct _filechain **);
  183. int      sort_al2(struct _filechain **, struct _filechain **);
  184. int      sort_akp(struct _filechain **, struct _filechain **);
  185. int      sort_fil(struct _filechain **, struct _filechain **);
  186. int      sort_gbl(struct _filechain **, struct _filechain **);
  187. int      sort_new(struct _filechain **, struct _filechain **);
  188. int      sort_summ(struct _downpath *, struct _downpath *);
  189. char    *stripf(char *);
  190. char    *strnblk(char *, int, int, int);
  191. int      strsubw(char *, char **, int);
  192. char    *sys_date(char *);
  193. int      non_wild_init(int, char *, char *);
  194. void     title_line(char *, char *[]);
  195. int      wild_init(int, char *, char *);
  196. int      wild_comp(int, char *,char *);
  197.