7 int PASCAL WinMain(HINSTANCE hinstCurrent,
8 HINSTANCE hinstPrevious,
12 OFSTRUCT SourceOpenStruct1, SourceOpenStruct2;
13 char OriginalName[256];
14 char FAR *lpzDestFile;
16 HFILE hSourceFile, hDestFile;
17 /* Most Windows compilers have something like this: */
21 hSourceFile = LZOpenFile(_ARGV[1], (LPOFSTRUCT) &SourceOpenStruct1, OF_READ);
22 if ((_ARGC == 3) && (_ARGV[2] != NULL))
23 lpzDestFile = _ARGV[2];
25 lpzDestFile = OriginalName;
26 GetExpandedName(_ARGV[1], lpzDestFile);
28 hDestFile = LZOpenFile(lpzDestFile, (LPOFSTRUCT) &SourceOpenStruct2,
29 OF_CREATE | OF_WRITE);
30 dwreturn = LZCopy(hSourceFile, hDestFile);
32 fprintf(stderr,"LZCopy failed: return is %ld\n",dwreturn);