| 1 | 
 | 
|---|
| 2 | /***********************************************************************
 | 
|---|
| 3 | 
 | 
|---|
| 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
 | 
|---|
| 9 |   Copyright (c) 2002, 2007 Steven H.Levine
 | 
|---|
| 10 | 
 | 
|---|
| 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
 | 
|---|
| 15 | 
 | 
|---|
| 16 | ***********************************************************************/
 | 
|---|
| 17 | 
 | 
|---|
| 18 | #include <stdlib.h>
 | 
|---|
| 19 | #include <string.h>
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #define INCL_DOS
 | 
|---|
| 22 | #define INCL_WIN
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #include "dll\fm3dlg.h"
 | 
|---|
| 25 | #include "dll\makelist.h"
 | 
|---|
| 26 | #include "dll\fm3dll.h"
 | 
|---|
| 27 | 
 | 
|---|
| 28 | int main (int argc,char *argv[])
 | 
|---|
| 29 | {
 | 
|---|
| 30 |   HAB hab;
 | 
|---|
| 31 |   HMQ hmq;
 | 
|---|
| 32 |   CHAR fullname[CCHMAXPATH];
 | 
|---|
| 33 |   CHAR **list = NULL;
 | 
|---|
| 34 |   UINT x,numfiles = 0,numalloc = 0;
 | 
|---|
| 35 | 
 | 
|---|
| 36 |   DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 37 |   for(x = 1; x < argc; x++) {
 | 
|---|
| 38 |     if (!strchr("/;,`\'",*argv[x]) && IsFile(argv[x]) != -1) {
 | 
|---|
| 39 |       if (DosQueryPathInfo(argv[x],
 | 
|---|
| 40 |                            FIL_QUERYFULLNAME,fullname,
 | 
|---|
| 41 |                            sizeof(fullname)))
 | 
|---|
| 42 |         strcpy(fullname, argv[x]);
 | 
|---|
| 43 |       AddToList(fullname,&list,&numfiles,&numalloc);
 | 
|---|
| 44 |     }
 | 
|---|
| 45 |   }
 | 
|---|
| 46 |   hab = WinInitialize(0);
 | 
|---|
| 47 |   if (hab) {
 | 
|---|
| 48 |     hmq = WinCreateMsgQueue(hab,384);
 | 
|---|
| 49 |     if (hmq) {
 | 
|---|
| 50 |       if (InitFM3DLL(hab,argc,argv)) {
 | 
|---|
| 51 |         if (!list) {
 | 
|---|
| 52 |           strcpy(fullname, "*");
 | 
|---|
| 53 |           list = malloc(sizeof(CHAR *) * 2);
 | 
|---|
| 54 |           if (list &&
 | 
|---|
| 55 |               insert_filename(HWND_DESKTOP,fullname,TRUE,FALSE) &&
 | 
|---|
| 56 |               *fullname && *fullname == '*') {
 | 
|---|
| 57 |             list[0] = fullname;
 | 
|---|
| 58 |             list[1] = NULL;
 | 
|---|
| 59 |           }
 | 
|---|
| 60 |         }
 | 
|---|
| 61 |         if (list) {
 | 
|---|
| 62 |           WinDlgBox(HWND_DESKTOP,
 | 
|---|
| 63 |                     HWND_DESKTOP,
 | 
|---|
| 64 |                     DisplayEAsProc,
 | 
|---|
| 65 |                     FM3ModHandle,
 | 
|---|
| 66 |                     EA_FRAME,
 | 
|---|
| 67 |                     (PVOID)list);
 | 
|---|
| 68 |         }
 | 
|---|
| 69 |       }
 | 
|---|
| 70 |       WinDestroyMsgQueue(hmq);
 | 
|---|
| 71 |     }
 | 
|---|
| 72 |     WinTerminate(hab);
 | 
|---|
| 73 |   }
 | 
|---|
| 74 |   if (list)
 | 
|---|
| 75 |     free(list);
 | 
|---|
| 76 |   return 0;
 | 
|---|
| 77 | }
 | 
|---|
| 78 | 
 | 
|---|