#ifndef	ARC_H
#define	ARC_H

/*
**	$VER: arc.h 7.0 (04.09.97) by Nik Soggia <nsoggia@telnetwork.it>
*/

#ifndef DOS_DOS_H
#include <dos/dos.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include "utility/tagitem.h"
#endif

/***************************************
** GetArcProperties() modes
*/

#define	APM_THEORY	0		/* what archiver may be able to do */
#define	APM_PRACTICE	1		/* what archiver can do now */

/***************************************
** GetArcNames() id's
*/

#define	GAN_COMPBITS	0		/* GAN_COMPBITS+[0-31] */
#define	GANSIZE		20		/* max string length */
/***************************************
** Archive#?() tags
*/

#define	ARC_FileName	(TAG_USER+1)	/* APTR to a single file name */
#define	ARC_WorkDir	(TAG_USER+2)	/* APTR to a temporary drawer name */
#define	ARC_MultiSize	(TAG_USER+3)	/* multivolume size in KB */
#define	ARC_Case	(TAG_USER+4)	/* >0 uppercase; <0 lowercase (def=0) */
#define	ARC_EnableWild	(TAG_USER+5)	/* true (<>0) enables wildcards (def=0) */
#define	ARC_Header	(TAG_USER+6)	/* levels: 1,2,3 (def=1) */
#define	ARC_Quiet	(TAG_USER+7)	/* levels: 1,2,3 (def=verbose) */
#define	ARC_Recurse	(TAG_USER+8)	/* true (<>0) enables (def=0) */
#define	ARC_StoreMode	(TAG_USER+9)	/* levels: 1,2,3,4 (def=4) */
#define	ARC_IgnorePath	(TAG_USER+10)	/* true (<>0) enables (def=0) */
#define	ARC_NewName	(TAG_USER+11)	/* APTR to a single file name */
#define	ARC_Password	(TAG_USER+12)	/* APTR to a password string */

/***************************************
** BumpArcName() modes
*/

#define	BUMPMODE_FIRST	0		/* add suffix */
#define	BUMPMODE_MORE	1		/* bump suffix */
#define	BUMPSIZE	32		/* dest min size is (src+BUFSIZE) */

/***************************************
** GetFlags() flags
*/

/*	archive properties; an archive can: */

#define	ARCB_COMMENT	0		/* preserve comments */
#define	ARCB_DATE	1		/* preserve creation date and time */
#define	ARCB_LEVEL	2		/* use many compression levels */
#define	ARCB_MULTI	3		/* be broken in more than one file */
#define	ARCB_PASSWORD	4		/* protect objects with passwords */
#define	ARCB_PROTECT	5		/* preserve protection bits */
#define	ARCB_TREE	6		/* contain many files */

#define	ARCF_COMMENT	(1<<ARCB_COMMENT)
#define	ARCF_DATE	(1<<ARCB_DATE)
#define	ARCF_LEVEL	(1<<ARCB_LEVEL)
#define	ARCF_MULTI	(1<<ARCB_MULTI)
#define	ARCF_PASSWORD	(1<<ARCB_PASSWORD)
#define	ARCF_PROTECT	(1<<ARCB_PROTECT)
#define	ARCF_TREE	(1<<ARCB_TREE)

/*	archiver properties; the archiver can: */

#define	ARCB_ADDPATH	16		/* add objects to archives with path */
#define	ARCB_CAT	17		/* add objects to archives */
#define	ARCB_CREATE	18		/* create archives */
#define	ARCB_DELETE	19		/* remove objects from archives */
#define	ARCB_EXTRACT	20		/* extract compressed objects */
#define	ARCB_FRESHEN	21		/* update objects in archives */
#define	ARCB_LIST	22		/* show archive contents */
#define	ARCB_MANYBIN	23		/* archiver is made of many binaries */
#define	ARCB_RENAME	24		/* rename objects in archives */
#define	ARCB_REPLACE	25		/* replace objects in archives */
#define	ARCB_TEST	26		/* check archive integrity */

#define	ARCF_ADDPATH	(1<<ARCF_ADDPATH)
#define	ARCF_CAT	(1<<ARCF_CAT)
#define	ARCF_CREATE	(1<<ARCF_CREATE)
#define	ARCF_DELETE	(1<<ARCF_DELETE)
#define	ARCF_EXTRACT	(1<<ARCF_EXTRACT)
#define	ARCF_FRESHEN	(1<<ARCF_FRESHEN)
#define	ARCF_LIST	(1<<ARCF_LIST)
#define	ARCF_MANYBIN	(1<<ARCF_MANYBIN)
#define	ARCF_RENAME	(1<<ARCF_RENAME)
#define	ARCF_REPLACE	(1<<ARCF_REPLACE)
#define	ARCF_TEST	(1<<ARCF_TEST)

/***************************************
** GetPattern() flags
*/

#define	PATB_FIRST	0		/* pattern for the first archive */
#define	PATB_MULTI	1		/* pattern for the last archives */
#define	PATB_ASCII	2		/* don't process pattern */

#define	PATF_FIRST	(1<<PATB_FIRST)
#define	PATF_MULTI	(1<<PATB_MULTI)
#define	PATF_ASCII	(1<<PATB_ASCII)

/***************************************
** ResidentArcCmd() types
*/

#define	RCT_GENERIC	0		/* this one can do all actions */
#define	RCT_CAT		(1<<0)		/* add objects to archives */
#define	RCT_CREATE	(1<<1)		/* create archives */
#define	RCT_DELETE	(1<<2)		/* remove objects from archives */
#define	RCT_EXTRACT	(1<<3)		/* extract compressed objects */
#define	RCT_FRESHEN	(1<<4)		/* update objects in archives */
#define	RCT_LIST	(1<<5)		/* show archive contents */
#define	RCT_MANYBIN	(1<<6)		/* archiver is made of many binaries */
#define	RCT_RENAME	(1<<7)		/* rename objects in archives */
#define	RCT_REPLACE	(1<<8)		/* replace objects in archives */
#define	RCT_TEST	(1<<9)		/* check archive integrity */

/***************************************
** ArchiveList() public structure (READ ONLY!)
*/

struct	ArcAnchor {
	LONG	aa_type;		/* -1 file, -2 filelink, 1 dir, 2 dirlink */
	APTR	aa_name;		/* file name (and its path) */
	ULONG	aa_protection;		/* protection bits */
	LONG	aa_size;		/* original size */
	LONG	aa_compressed;		/* compressed size */
	struct	DateStamp aa_date;	/* last modification date and time */
	APTR	aa_comment;		/* comment */
	UWORD	aa_owner;		/* user id (not used) */
	UWORD	aa_group;		/* group id (not used) */
	ULONG	aa_flags;		/* (not used, LEAVE ZERO) */
};

#endif /* ARC_H */

