source: trunk/eas.c@ 1176

Last change on this file since 1176 was 1176, checked in by John Small, 17 years ago

Ticket 187: Draft 2: Move remaining function declarations

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1
2/***********************************************************************
3
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
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 10 May 08 SHL Correct compare typo
16
17***********************************************************************/
18
19#include <stdlib.h>
20#include <string.h>
21
22#define INCL_DOS
23#define INCL_WIN
24
25#include "dll\fm3dll.h"
26#include "dll\fm3dlg.h"
27#include "dll\makelist.h"
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
33
34static PSZ pszSrcFile = __FILE__;
35
36int main (int argc,char *argv[])
37{
38 HAB hab;
39 HMQ hmq;
40 CHAR fullname[CCHMAXPATH];
41 CHAR **list = NULL;
42 UINT x,numfiles = 0,numalloc = 0;
43
44 DosError(FERR_DISABLEHARDERR);
45 for(x = 1; x < argc; x++) {
46 if (!strchr("/;,`\'",*argv[x]) && IsFile(argv[x]) != -1) {
47 if (DosQueryPathInfo(argv[x],
48 FIL_QUERYFULLNAME,fullname,
49 sizeof(fullname)))
50 strcpy(fullname, argv[x]);
51 AddToList(fullname,&list,&numfiles,&numalloc);
52 }
53 }
54 hab = WinInitialize(0);
55 if (hab) {
56 hmq = WinCreateMsgQueue(hab,384);
57 if (hmq) {
58 if (InitFM3DLL(hab,argc,argv)) {
59 if (!list) {
60 strcpy(fullname, "*");
61 list = xmalloc(sizeof(CHAR *) * 2, pszSrcFile, __LINE__);
62 if (list &&
63 insert_filename(HWND_DESKTOP,fullname,TRUE,FALSE) &&
64 *fullname && *fullname != '*') {
65 list[0] = fullname;
66 list[1] = NULL;
67 }
68 }
69 if (list) {
70 WinDlgBox(HWND_DESKTOP,
71 HWND_DESKTOP,
72 DisplayEAsProc,
73 FM3ModHandle,
74 EA_FRAME,
75 (PVOID)list);
76 }
77 }
78 WinDestroyMsgQueue(hmq);
79 }
80 WinTerminate(hab);
81 }
82 xfree(list, pszSrcFile, __LINE__);
83 return 0;
84}
85
Note: See TracBrowser for help on using the repository browser.