home *** CD-ROM | disk | FTP | other *** search
- #define NAME "testFilePack"
- #define DISTRIBUTION "(Freeware) "
- #define REVISION "1"
- #define SDI_ENDCODE_NOCTRLC
-
- /* Programmheader
-
- Name: testFilePack
- Author: SDI
- Distribution: Freeware
- Description: easy file to file packer
- Compileropts: -
- Linkeropts: -l xpkmaster amiga
-
- 1.0 06.01.97 : wrote to find the read bit error
- 1.1 28.11.97 : moved chunk-hook into include file
- */
-
- #include <proto/exec.h>
- #include <proto/dos.h>
- #include <proto/xpkmaster.h>
- #include <exec/memory.h>
- #include "SDI_defines.h"
- #include "chunkhook.c"
-
- struct Library *XpkBase = 0;
- ULONG DosVersion = 37;
- struct RDArgs *rda = 0;
-
- #define PARAM "FROM/A,TO/A,METHOD"
-
- void main(void)
- {
- UBYTE errbuf[XPKERRMSGSIZE+1];
- struct {
- STRPTR from;
- STRPTR to;
- STRPTR method;
- } args = {0,0,"USER"};
-
- if(!(rda = ReadArgs(PARAM, (LONG *) &args, 0)) ||
- !(XpkBase = OpenLibrary(XPKNAME, 3)))
- End(RETURN_FAIL);
-
- if(XpkPackTags(XPK_InName, args.from, XPK_OutName, args.to,
- XPK_PackMethod, args.method, XPK_GetError,
- errbuf, XPK_ChunkHook, &chunkhook, TAG_DONE))
- {
- STRPTR a = errbuf;
- VPrintf("Can't XpkPack: %s\n", &a);
- End(RETURN_FAIL);
- }
-
- End(RETURN_OK);
- }
-
- void end(void)
- {
- if(XpkBase) CloseLibrary(XpkBase);
- if(rda) FreeArgs(rda);
- }
-
-