2002-03-10 00:29:33 +01:00
|
|
|
/*
|
|
|
|
* Copyright 1997 Victor Schneider
|
2002-05-20 21:18:16 +02:00
|
|
|
* Copyright 2002 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2006-01-16 20:41:34 +01:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
|
1997-08-04 18:34:36 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#include <lzexpand.h>
|
|
|
|
|
2002-05-20 21:18:16 +02:00
|
|
|
int main(int argc, char *argv[])
|
1997-08-04 18:34:36 +02:00
|
|
|
{
|
|
|
|
OFSTRUCT SourceOpenStruct1, SourceOpenStruct2;
|
2002-12-13 00:01:35 +01:00
|
|
|
LONG ret;
|
1997-08-04 18:34:36 +02:00
|
|
|
HFILE hSourceFile, hDestFile;
|
|
|
|
|
2002-05-20 21:18:16 +02:00
|
|
|
if (argc < 2)
|
|
|
|
{
|
|
|
|
fprintf( stderr, "Usage: %s infile [outfile]\n", argv[0] );
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
hSourceFile = LZOpenFile(argv[1], &SourceOpenStruct1, OF_READ);
|
|
|
|
if (argv[2])
|
|
|
|
hDestFile = LZOpenFile(argv[2], &SourceOpenStruct2, OF_CREATE | OF_WRITE);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char OriginalName[MAX_PATH];
|
|
|
|
GetExpandedName(argv[1], OriginalName);
|
|
|
|
hDestFile = LZOpenFile(OriginalName, &SourceOpenStruct2, OF_CREATE | OF_WRITE);
|
|
|
|
}
|
2002-12-13 00:01:35 +01:00
|
|
|
ret = LZCopy(hSourceFile, hDestFile);
|
2000-01-08 23:21:47 +01:00
|
|
|
LZClose(hSourceFile);
|
|
|
|
LZClose(hDestFile);
|
2002-12-13 00:01:35 +01:00
|
|
|
if (ret <= 0) fprintf(stderr,"LZCopy failed: return is %ld\n",ret);
|
|
|
|
return (ret <= 0);
|
1997-08-04 18:34:36 +02:00
|
|
|
}
|