1 /*********************************************************************** 2 This file is part of HA, a general purpose file archiver. 3 Copyright (C) 1995 Harri Hirvola 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 ************************************************************************ 19 HA archive handling 20 *************************************************************************/ 21 22 #define MYVER 2 /* Version info in archives */ 23 #define LOWVER 2 /* Lowest supported version */ 24 25 enum {M_CPY=0,M_ASC,M_HSC,M_UNK,M_DIR=14,M_SPECIAL}; /* Method types */ 26 27 #define ARC_OLD 0 /* Mode flags for arc_open() */ 28 #define ARC_NEW 1 29 #define ARC_RDO 2 30 31 #define T_DIR 1 /* Types for file type check */ 32 #define T_SPECIAL 2 33 #define T_SKIP 3 34 #define T_REGULAR 4 35 36 #define MSDOSMDH 1 /* Identifiers for machine */ 37 #define UNIXMDH 2 /* specific header data */ 38 39 typedef struct { /* Header of file in archive */ 40 unsigned char type; 41 unsigned char ver; 42 U32B clen; 43 U32B olen; 44 U32B time; 45 U32B crc; 46 char *path; 47 char *name; 48 unsigned mdilen; 49 unsigned mylen; 50 } Fheader; 51 52 extern int arcfile; /* Archive handle */ 53 extern char *arcname; /* Archive name */ 54 extern struct stat arcstat; /* Archive status (when opened) */ 55 56 void arc_open(char *arcname, int mode); 57 void arc_reset(void); 58 Fheader *arc_seek(void); 59 void arc_delete(void); 60 void arc_newfile(char *mdpath, char *name); 61 int arc_adddir(void); 62 int arc_addspecial(char *fullname); 63 void arc_accept(int method); 64 void arc_trynext(void); 65 int arc_addfile(void); 66 67 68 69 70 71 72 73