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