|
Last change
on this file since 863 was 862, checked in by Steven Levine, 18 years ago |
|
Get rid of statics
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | /***********************************************************************
|
|---|
| 3 |
|
|---|
| 4 | $Id: undel.c 862 2007-11-11 06:14:10Z stevenhl $
|
|---|
| 5 |
|
|---|
| 6 | File undelete applet
|
|---|
| 7 |
|
|---|
| 8 | Copyright (c) 1993-98 M. Kimes
|
|---|
| 9 | Copyright (c) 2007 Steven H. Levine
|
|---|
| 10 |
|
|---|
| 11 | 23 Sep 07 SHL Sync with standards
|
|---|
| 12 | 23 Sep 07 SHL Get rid of statics
|
|---|
| 13 |
|
|---|
| 14 | ***********************************************************************/
|
|---|
| 15 |
|
|---|
| 16 | #include <stdarg.h>
|
|---|
| 17 | #include <stdio.h>
|
|---|
| 18 | #include <stdlib.h>
|
|---|
| 19 | #include <string.h>
|
|---|
| 20 | #include <ctype.h>
|
|---|
| 21 |
|
|---|
| 22 | #define INCL_DOS
|
|---|
| 23 | #define INCL_WIN
|
|---|
| 24 | #include <os2.h>
|
|---|
| 25 |
|
|---|
| 26 | #include "dll\fm3dll.h"
|
|---|
| 27 | #include "dll\fm3dlg.h"
|
|---|
| 28 |
|
|---|
| 29 | int main(int argc, char *argv[])
|
|---|
| 30 | {
|
|---|
| 31 | HAB hab;
|
|---|
| 32 | HMQ hmq;
|
|---|
| 33 | FILESTATUS3 fs;
|
|---|
| 34 | CHAR fullname[CCHMAXPATH];
|
|---|
| 35 | CHAR *thisarg = NULL;
|
|---|
| 36 | INT x;
|
|---|
| 37 |
|
|---|
| 38 | DosError(FERR_DISABLEHARDERR);
|
|---|
| 39 | for (x = 1; x < argc; x++) {
|
|---|
| 40 | if (!strchr("/;,`\'", *argv[x]) && !thisarg) {
|
|---|
| 41 | thisarg = argv[x];
|
|---|
| 42 | break;
|
|---|
| 43 | }
|
|---|
| 44 | }
|
|---|
| 45 | if (!thisarg) {
|
|---|
| 46 | thisarg = fullname;
|
|---|
| 47 | save_dir(fullname);
|
|---|
| 48 | }
|
|---|
| 49 | DosError(FERR_DISABLEHARDERR);
|
|---|
| 50 | if (thisarg && !DosQueryPathInfo(thisarg, FIL_STANDARD, &fs, sizeof(fs))) {
|
|---|
| 51 | if (DosQueryPathInfo(thisarg,
|
|---|
| 52 | FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
|
|---|
| 53 | strcpy(fullname, thisarg);
|
|---|
| 54 | hab = WinInitialize(0);
|
|---|
| 55 | if (hab) {
|
|---|
| 56 | hmq = WinCreateMsgQueue(hab, 256);
|
|---|
| 57 | if (hmq) {
|
|---|
| 58 | if (InitFM3DLL(hab, argc, argv)) {
|
|---|
| 59 | MakeValidDir(fullname);
|
|---|
| 60 | WinDlgBox(HWND_DESKTOP,
|
|---|
| 61 | HWND_DESKTOP,
|
|---|
| 62 | UndeleteDlgProc,
|
|---|
| 63 | FM3ModHandle,
|
|---|
| 64 | UNDEL_FRAME,
|
|---|
| 65 | fullname);
|
|---|
| 66 | }
|
|---|
| 67 | DosSleep(250);
|
|---|
| 68 | WinDestroyMsgQueue(hmq);
|
|---|
| 69 | }
|
|---|
| 70 | WinTerminate(hab);
|
|---|
| 71 | }
|
|---|
| 72 | }
|
|---|
| 73 | else
|
|---|
| 74 | DosBeep(250, 100);
|
|---|
| 75 | return 0;
|
|---|
| 76 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.