source: trunk/eas.c@ 908

Last change on this file since 908 was 907, checked in by Steven Levine, 18 years ago

Avoid out of memory traps in Compare Directories
Rework Compare Directories progress display for 2 second update rate
Start refactoring to reduce dependence on fm3dll.h
Add timer services (IsITimerExpired etc.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
RevLine 
[22]1
[52]2/***********************************************************************
[22]3
[52]4 $Id: eas.c 907 2008-01-06 07:26:17Z stevenhl $
5
6 EA viewer applet
7
8 Copyright (c) 1993-98 M. Kimes
[754]9 Copyright (c) 2002, 2007 Steven H.Levine
[52]10
[620]11 16 Oct 02 SHL Reformat
12 08 Feb 03 SHL Free list with free() since we don't
13 allocate list contents
14 08 Apr 07 SHL Minor reformat
[52]15
16***********************************************************************/
17
[2]18#include <stdlib.h>
19#include <string.h>
[754]20
21#define INCL_DOS
22#define INCL_WIN
23
[907]24#include "dll\fm3dlg.h"
25#include "dll\makelist.h"
[2]26#include "dll\fm3dll.h"
27
[52]28int main (int argc,char *argv[])
29{
[754]30 HAB hab;
31 HMQ hmq;
32 CHAR fullname[CCHMAXPATH];
33 CHAR **list = NULL;
[907]34 UINT x,numfiles = 0,numalloc = 0;
[2]35
36 DosError(FERR_DISABLEHARDERR);
[754]37 for(x = 1; x < argc; x++) {
[620]38 if (!strchr("/;,`\'",*argv[x]) && IsFile(argv[x]) != -1) {
[754]39 if (DosQueryPathInfo(argv[x],
40 FIL_QUERYFULLNAME,fullname,
[620]41 sizeof(fullname)))
[754]42 strcpy(fullname, argv[x]);
[2]43 AddToList(fullname,&list,&numfiles,&numalloc);
44 }
45 }
46 hab = WinInitialize(0);
[620]47 if (hab) {
[2]48 hmq = WinCreateMsgQueue(hab,384);
[620]49 if (hmq) {
50 if (InitFM3DLL(hab,argc,argv)) {
51 if (!list) {
[754]52 strcpy(fullname, "*");
[620]53 list = malloc(sizeof(CHAR *) * 2);
[754]54 if (list &&
55 insert_filename(HWND_DESKTOP,fullname,TRUE,FALSE) &&
56 *fullname && *fullname == '*') {
57 list[0] = fullname;
58 list[1] = NULL;
59 }
[620]60 }
[754]61 if (list) {
62 WinDlgBox(HWND_DESKTOP,
63 HWND_DESKTOP,
64 DisplayEAsProc,
65 FM3ModHandle,
66 EA_FRAME,
67 (PVOID)list);
68 }
[2]69 }
70 WinDestroyMsgQueue(hmq);
71 }
72 WinTerminate(hab);
73 }
[52]74 if (list)
75 free(list);
[2]76 return 0;
77}
78
Note: See TracBrowser for help on using the repository browser.