home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / OLS / Os2 / LHA2P205 / LHA2P205.LZH / lha2-2.05pre / source.lzh / src / lh.h < prev    next >
C/C++ Source or Header  |  1996-02-25  |  4KB  |  239 lines

  1. /*
  2.  * lh.h
  3.  *   Copyright (C) 1988-1992, Haruyasu YOSHIZAKI
  4.  *   Copyright (C) 1991-1995, Satoshi HIRAMATSU (OS/2 HPFS version)
  5.  *
  6.  * $Log$
  7.  */
  8.  
  9.  
  10. #ifndef __INCLUDED_LH_H
  11. #define __INCLUDED_LH_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16.  
  17. struct pat
  18. {
  19.   struct pat *nxt;
  20.   char *bdir;
  21.   char *fname;
  22.   int cnt;
  23.   char pname[1];
  24. };
  25.  
  26.  
  27. struct ftime
  28. {
  29.   uint ft_tsec    :5;        /* Two second interval */
  30.   uint ft_min    :6;        /* Minutes */
  31.   uint ft_hour    :5;        /* Hours */
  32.   uint ft_day    :5;        /* Days */
  33.   uint ft_month    :4;        /* Months */
  34.   uint ft_year    :7;        /* Year */
  35. };
  36.  
  37.  
  38. struct datetime
  39. {
  40.   ushort time;
  41.   ushort date;
  42. };
  43.  
  44.  
  45. typedef union stamp            /* time stamp */
  46. {
  47.   ulong u;
  48.   struct ftime s;
  49.   struct datetime t;
  50. } STAMP;
  51.  
  52.  
  53. struct fb            /* file name buffer */
  54. {
  55.   struct fb *nxt;
  56.   char *cpos;            /* position of effective path name */
  57.   char *fpos;            /* position of file name */
  58.   long time;
  59.   char used;
  60. #ifdef __SUPPORT_EA__
  61.   FEA2LIST *ea;
  62. #endif
  63.   char fname[1];
  64. };
  65.  
  66.  
  67. #if 0
  68. struct srchblk
  69. {
  70.   char *sb_name;
  71.   int sb_attrib;
  72.   time_t sb_ftime;
  73.   long sb_fsize;
  74.   void *sb_buf;
  75. };
  76. #endif
  77.  
  78.  
  79. #ifndef iskanji
  80. #define iskanji(c) \
  81.   ((uchar)(c) >= 0x80 && (uchar)(c) <= 0x9f || \
  82.    (uchar)(c) >= 0xe0 && (uchar)(c) <= 0xfd)
  83. #endif
  84. #define DELIM ('/')
  85. #define DELIM2 (0xffu)
  86. #define DELIMSTR "/"
  87.  
  88.  
  89. /* from mn.c */
  90. #ifndef MAXPATHLEN
  91. #define MAXPATHLEN 260
  92. #endif
  93. extern char arcname[MAXPATHLEN];
  94. extern char filename1[MAXPATHLEN];
  95. extern char filename2[MAXPATHLEN];
  96. extern char filename3[MAXPATHLEN];
  97. extern FILE *file1, *file2, *file3;
  98. extern int  cmdupdate;
  99. extern char workdir[];
  100. #if 0
  101. extern char *pager;
  102. extern char *keyword;
  103. #endif
  104. extern char cmd;
  105. extern char lhtmp1[], lhtmp2[];
  106. extern int errorlevel;
  107. extern int outredir;
  108. extern char work[];
  109. #ifdef __SUPPORT_UID_GID__
  110. #ifdef __OS2__
  111. typedef unsigned short uid_t;
  112. typedef unsigned short gid_t;
  113. #endif /* __OS2__ */
  114. extern uid_t uid;
  115. extern gid_t gid;
  116. #endif /* __SUPPORT_UID_GID__ */
  117.  
  118. void usage(void);
  119. void update_arcstamp(void);
  120.  
  121.  
  122. /* from append.c */
  123. void regext(char *);
  124. void freeze(char *, char *);
  125. int append(void);
  126. int endappend(void);
  127. void deletefiles(void);
  128. int freshen(char *);
  129.  
  130.  
  131. /* from extract.c */
  132. void extract(char *);
  133. void extract_internal(FILE *, char *);
  134.  
  135.  
  136. /* from list.c */
  137. void initlist(void);
  138. void list(void);
  139. void endlist(time_t);
  140.  
  141.  
  142. /* from match.c */
  143. extern struct pat *pbuf;
  144.  
  145. void initpat(void);
  146. void regpat(char *, char *);
  147. char *regbdir(char *);
  148. char *matchfname(char *, char *);
  149. char *matchpat(char *);
  150. int tstpat(void);
  151.  
  152.  
  153. /* from header.c */
  154. extern struct head hpb;
  155.  
  156. #if 0
  157. ulong inithdr(void);
  158. char *gethdr(int *);
  159. void makehdr(void);
  160. void writehdr(void);
  161. void adjusthdr(void);
  162. void freework(void);
  163. #endif
  164.  
  165. /* from files.c */
  166. extern struct fb *fbuf;
  167.  
  168. void mklist(void);
  169. struct fb *searchfile(char *);
  170.  
  171.  
  172. /* from getopt.c */
  173. extern char flg_r, flg_p, flg_x, flg_m, flg_a,
  174.   flg_c, flg_n, flg_t, flg_u, flg_v,
  175.   flg_w, flg_i, flg_h, flg_o, flg_z,
  176. #ifdef __SUPPORT_EA__
  177.   flg_l, flg_s, flg_at, flg_d, flg_f, flg_e;
  178. #else
  179.   flg_l, flg_s, flg_at, flg_d, flg_f;
  180. #endif /* __SUPPORT_EA__ */
  181.  
  182. int getopt(char *);
  183.  
  184.  
  185. /* from util.c */
  186. extern uchar pathdelim;
  187. extern uchar swchar;
  188.  
  189. char *convdelim(char *, char);
  190. char *getfilename(char *);
  191. char *backpath(char *);
  192. int getyn(void);
  193. void getswchar(void);
  194. time_t dos2unix(struct ftime *);
  195. struct ftime *unix2dos(time_t);
  196. int ratio(ulong, ulong, int);
  197. hword copyfile(FILE *, FILE *, long, int);
  198. #ifndef __DEBUG__
  199. void *e_malloc(size_t);
  200. void *e_realloc(void *, size_t);
  201. #endif
  202. FILE *myeopen(const char *, const char *, char *);
  203. FILE *mywopen(const char *, char *);
  204. FILE *myropen(const char *);
  205. void eprintf(char *, ...);
  206.  
  207.  
  208. /* from dosio.c */
  209. time_t getfiletime(FILE *);
  210. #ifndef __SUPPORT_CTIME_ATIME__
  211. int setfiletime(FILE *, time_t);
  212. #else
  213. int setfiletime(FILE *, time_t *, time_t *, time_t *);
  214. #endif
  215. long diskspace(char *);
  216.  
  217.  
  218. /* from error.c */
  219. void error(char *, const char *);
  220. void fileerror(char *, FILE *);
  221. void userbreak(int);
  222. void initbreak(void);
  223.  
  224.  
  225. /* from path.c */
  226. void form_path(char *);
  227.  
  228.  
  229. /* from self.c */
  230. void initsfx(void);
  231. int copysfx(void);
  232. void makesfx(char *);
  233.  
  234.  
  235. #ifdef __cplusplus
  236. }
  237. #endif
  238. #endif /* __INCLUDED_LH_H */
  239.