From a0b9ce4bee60136363cfff7a93c4e42eab972c02 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Thu, 6 Feb 1997 02:31:41 +0000 Subject: Windows/NT integration (V1_0_WIN32_BRANCH merge) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9788 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/ChangeLog | 6 ++++ src/util/profile/Makefile.in | 4 +-- src/util/windows/ChangeLog | 0 src/util/windows/Makefile.in | 16 ++++++++++ src/util/windows/libecho.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 src/util/windows/ChangeLog create mode 100644 src/util/windows/Makefile.in create mode 100644 src/util/windows/libecho.c (limited to 'src/util') diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 9bfcde824..f27c74c80 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,9 @@ +Wed Feb 5 20:18:33 1997 Richard Basch + + * Makefile.in: + Fixed typo (all-max -> all-mac) + Inconsistent colon usage; all-windows needed :: not : + Mon Nov 4 17:04:51 1996 Theodore Y. Ts'o * prof_parse.c (parse_std_line): Accept either ';' or '#' on the diff --git a/src/util/profile/Makefile.in b/src/util/profile/Makefile.in index a8ad8fff5..d59d240d8 100644 --- a/src/util/profile/Makefile.in +++ b/src/util/profile/Makefile.in @@ -26,13 +26,13 @@ LIBS = ../et/libcom_err.$(LIBEXT) install:: -all-max:: all-unix +all-mac:: all-unix all-unix:: shared includes libprofile.a test_parse test_profile shared: mkdir shared -all-windows: $(OBJS) +all-windows:: $(OBJS) awk-windows: $(AWK) -f $(BUILDTOP)/util/et/et_h.awk outfile=prof_err.h prof_err.et diff --git a/src/util/windows/ChangeLog b/src/util/windows/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/src/util/windows/Makefile.in b/src/util/windows/Makefile.in new file mode 100644 index 000000000..63bbcd7ff --- /dev/null +++ b/src/util/windows/Makefile.in @@ -0,0 +1,16 @@ +BUILDTOP = ..\.. + +CFLAGS = $(COPTS) $(INCLUDES) + +##WIN16##LFLAGS = /nologo /nod /nopackcode +##WIN32##LFLAGS = /nologo /nod + +##WIN32##all-windows:: libecho.exe + +libecho.exe: libecho.c + +install-windows:: + +clean-windows:: + $(RM) *.res *.map *.obj *.exe + diff --git a/src/util/windows/libecho.c b/src/util/windows/libecho.c new file mode 100644 index 000000000..9fcbe2e98 --- /dev/null +++ b/src/util/windows/libecho.c @@ -0,0 +1,76 @@ +/* + * libecho.c + * + * For each argument on the command line, echo it. Should expand + * DOS wildcards correctly. + * + * Syntax: libecho [-p prefix] list... + */ +#include +#include +#include + +void echo_files(char *, char *); + +int +main(int argc, char *argv[]) +{ + int i; + char *prefix; + + prefix = ""; + + if (argc < 2) { + fprintf(stderr, "Usage: libecho [-p prefix] list...\n"); + return 1; + } + + for (i = 1 ; i < argc ; i++) + if (!stricmp(argv[i], "-p")) + prefix = argv[++i]; + else + echo_files(prefix, argv[i]); + + return 0; +} + +void +echo_files(char *prefix, char *f) +{ + long ff; + struct _finddata_t fdt; + char *slash; + char filepath[256]; + + /* + * We're unix based quite a bit here. Look for normal slashes and + * make them reverse slashes. + */ + while((slash = strrchr(f, '/')) != NULL) + *slash = '\\'; + + strcpy(filepath, f); + + slash = strrchr(filepath, '\\'); + + if (slash) { + slash++; + *slash = 0; + } else { + filepath[0] = '\0'; + } + + ff = _findfirst(f, &fdt); + + if (ff < 0) + return; + + printf("%s%s%s\n", prefix, filepath, fdt.name); + + for (;;) { + if (_findnext(ff, &fdt) < 0) + break; + printf("%s%s%s\n", prefix, filepath, fdt.name); + } + _findclose(ff); +} -- cgit