2 * Copyright 1997 Victor Schneider
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 int PASCAL WinMain(HINSTANCE hinstCurrent,
26 HINSTANCE hinstPrevious,
30 OFSTRUCT SourceOpenStruct1, SourceOpenStruct2;
31 char OriginalName[256];
32 char FAR *lpzDestFile;
34 HFILE hSourceFile, hDestFile;
35 /* Most Windows compilers have something like this: */
39 hSourceFile = LZOpenFile(_ARGV[1], (LPOFSTRUCT) &SourceOpenStruct1, OF_READ);
40 if ((_ARGC == 3) && (_ARGV[2] != NULL))
41 lpzDestFile = _ARGV[2];
43 lpzDestFile = OriginalName;
44 GetExpandedName(_ARGV[1], lpzDestFile);
46 hDestFile = LZOpenFile(lpzDestFile, (LPOFSTRUCT) &SourceOpenStruct2,
47 OF_CREATE | OF_WRITE);
48 dwreturn = LZCopy(hSourceFile, hDestFile);
50 fprintf(stderr,"LZCopy failed: return is %ld\n",dwreturn);