1 /**
2  * @file ar.h AR module include file
3  *
4  * $Id: ar.h,v 1.6 2003/01/01 06:22:31 chipx86 Exp $
5  *
6  * @Copyright (C) 2001-2003 The GNUpdate Project.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA  02111-1307, USA.
22  */
23 
24 #ifndef _MOD_AR_H_
25 #define _MOD_AR_H_
26 
27 #include <libcomprex/internal.h>
28 #include <ctype.h>
29 
30 #define AR_MAGIC     "!<arch>\n"
31 #define AR_MAGIC_LEN 8
32 #define AR_FMAG      "`\n"
33 
34 #define AR_HEADER_LEN 60
35 
36 typedef struct
37 {
38 	long startPos;
39 	long lastPos;
40 
41 } CxArFileData;
42 
43 typedef struct
44 {
45 	char name[16];
46 	char date[12];
47 	char uid[6];
48 	char gid[6];
49 	char mode[8];
50 	char size[10];
51 	char fmag[2];
52 
53 } CxArHeader;
54 
55 CxStatus cxArValidateMagic(CxFP *fp);
56 CxStatus cxArReadHeader(CxFP *fp, CxArHeader *header);
57 
58 int cxArOctalToInt(const char *oct);
59 int cxArDecToInt(const char *dec);
60 
61 #endif /* _MOD_AR_H_ */
62 
63