diff options
Diffstat (limited to 'winsup/mingw/samples/globbing')
-rw-r--r-- | winsup/mingw/samples/globbing/glob.c | 20 | ||||
-rw-r--r-- | winsup/mingw/samples/globbing/jamfile | 11 | ||||
-rw-r--r-- | winsup/mingw/samples/globbing/noglob.c | 22 | ||||
-rw-r--r-- | winsup/mingw/samples/globbing/readme.txt | 14 |
4 files changed, 67 insertions, 0 deletions
diff --git a/winsup/mingw/samples/globbing/glob.c b/winsup/mingw/samples/globbing/glob.c new file mode 100644 index 000000000..6bf8acaee --- /dev/null +++ b/winsup/mingw/samples/globbing/glob.c @@ -0,0 +1,20 @@ +
+#include <stdlib.h>
+#include <stdio.h>
+#include <windows.h>
+
+int
+main (int argc, char* argv[])
+{
+ int i;
+
+ printf ("Command line (via GetCommandLine) \"%s\"\n",
+ GetCommandLine());
+
+ for (i = 0; i < argc; i++)
+ {
+ printf ("Argv[%d] \"%s\"\n", i, argv[i]);
+ }
+
+ return 0;
+}
diff --git a/winsup/mingw/samples/globbing/jamfile b/winsup/mingw/samples/globbing/jamfile new file mode 100644 index 000000000..ff3a585d6 --- /dev/null +++ b/winsup/mingw/samples/globbing/jamfile @@ -0,0 +1,11 @@ +
+Object glob.o : glob.c ;
+
+MainFromObjects glob.exe : glob.o ;
+
+Main noglob.exe : noglob.c ;
+
+LIBDIR = \\mingw32\\lib\\ ;
+
+MainFromObjects CRTnoglob.exe : glob.o $(LIBDIR)CRT_noglob.o ;
+
diff --git a/winsup/mingw/samples/globbing/noglob.c b/winsup/mingw/samples/globbing/noglob.c new file mode 100644 index 000000000..8bc4c82a3 --- /dev/null +++ b/winsup/mingw/samples/globbing/noglob.c @@ -0,0 +1,22 @@ +
+#include <stdlib.h>
+#include <stdio.h>
+#include <windows.h>
+
+/* This line turns off automatic command line globbing. */
+int _CRT_glob = 0;
+
+int
+main (int argc, char* argv[])
+{
+ int i;
+
+ printf ("Command line (via GetCommandLine) \"%s\"\n",
+ GetCommandLine());
+ for (i = 0; i < argc; i++)
+ {
+ printf ("Argv[%d] \"%s\"\n", i, argv[i]);
+ }
+
+ return 0;
+}
diff --git a/winsup/mingw/samples/globbing/readme.txt b/winsup/mingw/samples/globbing/readme.txt new file mode 100644 index 000000000..5e20de826 --- /dev/null +++ b/winsup/mingw/samples/globbing/readme.txt @@ -0,0 +1,14 @@ +
+This directory contains samples which demonstrate default (globbing on)
+behavior, how to turn the globbing off with the _CRT_glob variable, and
+how to turn it off with the CRT_noglob object file.
+
+Run jam and then run glob, noglob and CRTnoglob with an argument like
+*.* to see the difference.
+
+The code in this directory is in the PUBLIC DOMAIN. It has NO WARRANTY,
+including, but not restricted to, warranties of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+Colin Peters <colin@bird.fu.is.saga-u.ac.jp>.
+
|