summaryrefslogtreecommitdiffstats
path: root/private/sdktools/exp
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/sdktools/exp
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/sdktools/exp')
-rw-r--r--private/sdktools/exp/exp.c153
-rw-r--r--private/sdktools/exp/exp.rc10
-rw-r--r--private/sdktools/exp/makefile6
-rw-r--r--private/sdktools/exp/sources44
4 files changed, 213 insertions, 0 deletions
diff --git a/private/sdktools/exp/exp.c b/private/sdktools/exp/exp.c
new file mode 100644
index 000000000..eda5d4538
--- /dev/null
+++ b/private/sdktools/exp/exp.c
@@ -0,0 +1,153 @@
+/*** EXP.C - expunge deleted files deleted with the rm program ****************
+*
+* Copyright (c) 1986-1990, Microsoft Corporation. All rights reserved.
+*
+* Purpose:
+* The three tools EXP, RM and UNDEL are used to delete files so
+* that they can be undeleted. This is done my renaming the file into
+* a hidden directory called DELETED.
+*
+* Notes:
+* Exp command line syntax:
+*
+* EXP [options] [path ...]
+*
+* where the [options] are :-
+*
+* /r Recursively expunge from path specified
+* /q Quiet mode; no extraneous messages
+* /help spawn Qh if possible, else issue a Usage message
+*
+* Revision History:
+* 08-Jan-1990 SB SLM version upgrading added; Add CopyRightYrs Macro
+* 03-Jan-1990 SB define QH_TOPIC_NOT_FOUND
+* 20-Dec-1989 SB Add check for return code of 3 for qh
+* 14-Dec-1989 LN Update Copyright to include 1990
+* 23-Oct-1989 LN Version no bumped to 1.01
+* 02-Oct-1989 LN Changed Version no to 1.00
+* 08-Aug-1989 BW Add Version number. Fix usage syntax. Update copyright.
+* 15-May-1989 WB Add /help
+* 06-Apr-1987 BW Add copyright notice to Usage().
+* 22-Jul-1986 DL Make test for flag case insensitive, add /q
+*
+******************************************************************************/
+
+/* I N C L U D E Files */
+
+#include <stdio.h>
+#include <process.h>
+#include <ctype.h>
+#include <windows.h>
+#include <tools.h>
+
+#include <string.h>
+
+
+/* D E F I N E s */
+
+#define CopyRightYrs "1987-90"
+/* Need 2 steps, first to get correct values in and 2nd to paste them */
+/* paste() is hacked to allow LEADING ZEROES */
+#define paste(a, b, c) #a ".0" #b ".00" #c
+#define VERSION(major, minor, buildno) paste(major, minor, buildno)
+#define QH_TOPIC_NOT_FOUND 3
+
+
+/* G L O B A L s */
+
+flagType fRecurse = FALSE;
+FILE *pFile = stdout;
+char cd[MAX_PATH];
+
+
+/*
+ * Forward Function Declarations...
+ */
+void DoExp( char *, struct findType *, void *);
+void Usage( void );
+int _CRTAPI1 main( int, char** );
+
+
+void
+DoExp(p, b, dummy)
+char *p;
+struct findType *b;
+void *dummy;
+{
+ if (b == NULL ||
+ (_strcmpi(b->fbuf.cFileName, "deleted") && TESTFLAG(b->fbuf.dwFileAttributes,FILE_ATTRIBUTE_DIRECTORY) &&
+ strcmp(b->fbuf.cFileName, ".") && strcmp(b->fbuf.cFileName, ".."))) {
+ fexpunge(p, pFile);
+ if (fRecurse) {
+ if (!fPathChr(*(strend(p)-1)))
+ strcat(p, "\\");
+ strcat(p, "*.*");
+ forfile(p, FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM, DoExp, NULL);
+ }
+ }
+ dummy;
+}
+
+void
+Usage()
+{
+ printf(
+"Microsoft File Expunge Utility. Version %s\n"
+"Copyright (C) Microsoft Corp %s. All rights reserved.\n\n"
+"Usage: EXP [/help] [/rq] [{dir}*]\n",
+ VERSION(rmj, rmm, rup), CopyRightYrs);
+
+ exit( 1 );
+}
+
+
+_CRTAPI1 main(c, v)
+int c;
+char *v[];
+{
+ char *p;
+ int iRetCode;
+
+ ConvertAppToOem( c, v );
+ SHIFT(c,v);
+ while( c && fSwitChr( *( p = *v ) ) ) {
+ while (*++p) {
+ switch (tolower(*p)) {
+ case 'r':
+ fRecurse = TRUE;
+ break;
+ case 'q':
+ pFile = NULL;
+ break;
+ case 'h':
+ if (!_strcmpi(p, "help")) {
+ iRetCode = _spawnlp(P_WAIT, "qh.exe", "qh", "/u",
+ "exp.exe", NULL);
+ /* qh returns QH_TOPIC_NOT_FOUND and
+ * -1 is returned when the spawn fails
+ */
+ if (iRetCode != QH_TOPIC_NOT_FOUND && iRetCode != -1)
+ exit(0);
+ }
+ /*
+ * else fall thru...
+ */
+
+ default:
+ Usage();
+ }
+ }
+ SHIFT(c,v);
+ }
+ if (!c) {
+ rootpath(".", cd);
+ DoExp(cd, NULL, NULL);
+ }
+ else
+ while (c) {
+ strcpy(cd, *v);
+ DoExp(cd, NULL, NULL);
+ SHIFT(c,v);
+ }
+ return( 0 );
+}
diff --git a/private/sdktools/exp/exp.rc b/private/sdktools/exp/exp.rc
new file mode 100644
index 000000000..6b4309bb5
--- /dev/null
+++ b/private/sdktools/exp/exp.rc
@@ -0,0 +1,10 @@
+#include <windows.h>
+#include <ntverp.h>
+
+#define VER_FILETYPE VFT_APP
+#define VER_FILESUBTYPE VFT2_UNKNOWN
+#define VER_FILEDESCRIPTION_STR "Expunge File Utility"
+#define VER_INTERNALNAME_STR "exp.exe"
+#define VER_ORIGINALFILENAME_STR "exp.exe"
+
+#include "common.ver"
diff --git a/private/sdktools/exp/makefile b/private/sdktools/exp/makefile
new file mode 100644
index 000000000..6ee4f43fa
--- /dev/null
+++ b/private/sdktools/exp/makefile
@@ -0,0 +1,6 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/private/sdktools/exp/sources b/private/sdktools/exp/sources
new file mode 100644
index 000000000..5bb5f2ced
--- /dev/null
+++ b/private/sdktools/exp/sources
@@ -0,0 +1,44 @@
+!IF 0
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ sources.
+
+Abstract:
+
+ This file specifies the target component being built and the list of
+ sources files needed to build that component. Also specifies optional
+ compiler switches and libraries that are unique for the component being
+ built.
+
+
+Author:
+
+ Steve Wood (stevewo) 12-Apr-1990
+
+NOTE: Commented description of this file is in \nt\bak\bin\sources.tpl
+
+!ENDIF
+
+MAJORCOMP=sdktools
+MINORCOMP=exp
+
+TARGETNAME=exp
+TARGETPATH=obj
+TARGETTYPE=UMAPPL_NOLIB
+
+INCLUDES=..\ztools\inc
+# GPSIZE=32
+
+SOURCES= exp.c exp.rc
+
+
+C_DEFINES=-D_OS2_20_=0 -Dnear= -Dfar= -Dpascal=
+
+UMTYPE=console
+UMAPPL=exp
+UMLIBS=..\ztools\src\obj\*\ztools.lib \
+ \nt\public\sdk\lib\*\user32.lib
+UMRES=obj\*\exp.res