[22] | 1 |
|
---|
[52] | 2 | /***********************************************************************
|
---|
[22] | 3 |
|
---|
[52] | 4 | $Id: eas.c 1176 2008-09-10 21:52:46Z jbs $
|
---|
| 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
|
---|
[1010] | 15 | 10 May 08 SHL Correct compare typo
|
---|
[52] | 16 |
|
---|
| 17 | ***********************************************************************/
|
---|
| 18 |
|
---|
[2] | 19 | #include <stdlib.h>
|
---|
| 20 | #include <string.h>
|
---|
[754] | 21 |
|
---|
| 22 | #define INCL_DOS
|
---|
| 23 | #define INCL_WIN
|
---|
| 24 |
|
---|
[1176] | 25 | #include "dll\fm3dll.h"
|
---|
[907] | 26 | #include "dll\fm3dlg.h"
|
---|
| 27 | #include "dll\makelist.h"
|
---|
[1176] | 28 | #include "dll\eas.h" // DisplayEAsProc
|
---|
| 29 | #include "dll\init.h" // InitFM3DLL
|
---|
| 30 | #include "dll\valid.h" // IsFile
|
---|
| 31 | #include "dll\wrappers.h" // xfree
|
---|
| 32 | #include "dll\getnames.h" // insert_filename
|
---|
[2] | 33 |
|
---|
[1011] | 34 | static PSZ pszSrcFile = __FILE__;
|
---|
| 35 |
|
---|
[52] | 36 | int main (int argc,char *argv[])
|
---|
| 37 | {
|
---|
[754] | 38 | HAB hab;
|
---|
| 39 | HMQ hmq;
|
---|
| 40 | CHAR fullname[CCHMAXPATH];
|
---|
| 41 | CHAR **list = NULL;
|
---|
[907] | 42 | UINT x,numfiles = 0,numalloc = 0;
|
---|
[2] | 43 |
|
---|
| 44 | DosError(FERR_DISABLEHARDERR);
|
---|
[754] | 45 | for(x = 1; x < argc; x++) {
|
---|
[620] | 46 | if (!strchr("/;,`\'",*argv[x]) && IsFile(argv[x]) != -1) {
|
---|
[754] | 47 | if (DosQueryPathInfo(argv[x],
|
---|
| 48 | FIL_QUERYFULLNAME,fullname,
|
---|
[620] | 49 | sizeof(fullname)))
|
---|
[754] | 50 | strcpy(fullname, argv[x]);
|
---|
[2] | 51 | AddToList(fullname,&list,&numfiles,&numalloc);
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
| 54 | hab = WinInitialize(0);
|
---|
[620] | 55 | if (hab) {
|
---|
[2] | 56 | hmq = WinCreateMsgQueue(hab,384);
|
---|
[620] | 57 | if (hmq) {
|
---|
| 58 | if (InitFM3DLL(hab,argc,argv)) {
|
---|
| 59 | if (!list) {
|
---|
[754] | 60 | strcpy(fullname, "*");
|
---|
[1011] | 61 | list = xmalloc(sizeof(CHAR *) * 2, pszSrcFile, __LINE__);
|
---|
[754] | 62 | if (list &&
|
---|
| 63 | insert_filename(HWND_DESKTOP,fullname,TRUE,FALSE) &&
|
---|
[1010] | 64 | *fullname && *fullname != '*') {
|
---|
[1011] | 65 | list[0] = fullname;
|
---|
| 66 | list[1] = NULL;
|
---|
[754] | 67 | }
|
---|
[620] | 68 | }
|
---|
[754] | 69 | if (list) {
|
---|
| 70 | WinDlgBox(HWND_DESKTOP,
|
---|
| 71 | HWND_DESKTOP,
|
---|
| 72 | DisplayEAsProc,
|
---|
| 73 | FM3ModHandle,
|
---|
| 74 | EA_FRAME,
|
---|
| 75 | (PVOID)list);
|
---|
| 76 | }
|
---|
[2] | 77 | }
|
---|
| 78 | WinDestroyMsgQueue(hmq);
|
---|
| 79 | }
|
---|
| 80 | WinTerminate(hab);
|
---|
| 81 | }
|
---|
[1039] | 82 | xfree(list, pszSrcFile, __LINE__);
|
---|
[2] | 83 | return 0;
|
---|
| 84 | }
|
---|
| 85 |
|
---|