Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-02-17 22:38:33 +0300
committerChristopher Faylor <me@cgf.cx>2000-02-17 22:38:33 +0300
commit1fd5e000ace55b323124c7e556a7a864b972a5c4 (patch)
treedc4fcf1e5e22a040716ef92c496b8d94959b2baa /winsup/mingw/samples/globbing
parent369d8a8fd5e887eca547bf34bccfdf755c9e5397 (diff)
import winsup-2000-02-17 snapshot
Diffstat (limited to 'winsup/mingw/samples/globbing')
-rw-r--r--winsup/mingw/samples/globbing/glob.c20
-rw-r--r--winsup/mingw/samples/globbing/jamfile11
-rw-r--r--winsup/mingw/samples/globbing/noglob.c22
-rw-r--r--winsup/mingw/samples/globbing/readme.txt14
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>.
+