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