aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-12-31 21:33:34 +0000
committerChristopher Faylor <me@cgf.cx>2008-12-31 21:33:34 +0000
commitecd5bc4ea8a158bd46e005dc4027c18d65a8106a (patch)
tree240f9a8dfe7cd88aa5e42355d91a6dc5d4f87d28
parent762cf3ee22b047d7eb0a06bf05a16dffab54cc53 (diff)
downloadnewlib-ecd5bc4ea8a158bd46e005dc4027c18d65a8106a.zip
newlib-ecd5bc4ea8a158bd46e005dc4027c18d65a8106a.tar.gz
newlib-ecd5bc4ea8a158bd46e005dc4027c18d65a8106a.tar.bz2
* glob_pattern_p.cc: New file.
* Makefile.in (DLL_OFILES): Add glob_pattern_p.o. * glob.h: Add declaration for glob_pattern_p. * pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/Makefile.in23
-rw-r--r--winsup/cygwin/cygwin.din3
-rw-r--r--winsup/cygwin/glob_pattern_p.cc28
-rw-r--r--winsup/cygwin/include/glob.h5
-rw-r--r--winsup/cygwin/pinfo.cc2
6 files changed, 53 insertions, 16 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index fe69eea..5c40fa3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-31 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * glob_pattern_p.cc: New file.
+ * Makefile.in (DLL_OFILES): Add glob_pattern_p.o.
+ * glob.h: Add declaration for glob_pattern_p.
+
+ * pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
+
2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
* include/bits/wordsize.h: New linux-compatibility header.
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 49baebc..4c433ff 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -135,17 +135,18 @@ DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \
fhandler_registry.o fhandler_serial.o fhandler_socket.o fhandler_tape.o \
fhandler_termios.o fhandler_tty.o fhandler_virtual.o fhandler_windows.o \
fhandler_zero.o flock.o fnmatch.o fork.o fts.o ftw.o getopt.o glob.o \
- grp.o heap.o hookapi.o inet_addr.o inet_network.o init.o ioctl.o ipc.o \
- kernel32.o localtime.o lsearch.o malloc_wrapper.o minires-os-if.o \
- minires.o miscfuncs.o mktemp.o mmap.o msg.o mount.o net.o netdb.o nfs.o \
- nftw.o ntea.o passwd.o path.o pinfo.o pipe.o poll.o posix_ipc.o \
- pthread.o random.o regcomp.o regerror.o regexec.o regfree.o registry.o \
- resource.o rexec.o rcmd.o scandir.o sched.o sec_acl.o sec_auth.o \
- sec_helper.o security.o select.o sem.o setlsapwd.o shared.o shm.o \
- sigfe.o signal.o sigproc.o smallprint.o spawn.o strace.o strfuncs.o \
- strptime.o strsep.o strsig.o sync.o syscalls.o sysconf.o syslog.o \
- termios.o thread.o timer.o times.o tls_pbuf.o tty.o uinfo.o uname.o \
- wait.o wincap.o window.o winf.o xsique.o \
+ glob_pattern_p.o grp.o heap.o hookapi.o inet_addr.o inet_network.o \
+ init.o ioctl.o ipc.o kernel32.o localtime.o lsearch.o malloc_wrapper.o \
+ minires-os-if.o minires.o miscfuncs.o mktemp.o mmap.o msg.o mount.o \
+ net.o netdb.o nfs.o nftw.o ntea.o passwd.o path.o pinfo.o pipe.o \
+ poll.o posix_ipc.o pthread.o random.o regcomp.o regerror.o regexec.o \
+ regfree.o registry.o resource.o rexec.o rcmd.o scandir.o sched.o \
+ sec_acl.o sec_auth.o sec_helper.o security.o select.o sem.o \
+ setlsapwd.o shared.o shm.o sigfe.o signal.o sigproc.o smallprint.o \
+ spawn.o strace.o strfuncs.o strptime.o strsep.o strsig.o sync.o \
+ syscalls.o sysconf.o syslog.o termios.o thread.o timer.o times.o \
+ tls_pbuf.o tty.o uinfo.o uname.o wait.o wincap.o window.o winf.o \
+ xsique.o \
$(EXTRA_DLL_OFILES) $(EXTRA_OFILES) $(MALLOC_OFILES) $(MT_SAFE_OBJECTS)
GMON_OFILES:=gmon.o mcount.o profil.o
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index 9c6385b..350f277 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -719,9 +719,8 @@ getwd SIGFE
_getwd = getwd SIGFE
getxattr SIGFE
glob SIGFE
-_glob = glob SIGFE
globfree SIGFE
-_globfree = globfree SIGFE
+glob_pattern_p
gmtime SIGFE
_gmtime = gmtime SIGFE
gmtime_r SIGFE
diff --git a/winsup/cygwin/glob_pattern_p.cc b/winsup/cygwin/glob_pattern_p.cc
new file mode 100644
index 0000000..e8f4251
--- /dev/null
+++ b/winsup/cygwin/glob_pattern_p.cc
@@ -0,0 +1,28 @@
+/* glob_pattern_p.c
+
+ int glob_pattern_p (__const char *__pattern, int __quote)
+
+ Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+ This function is not part of the interface specified by POSIX.2
+ but several programs want to use it. */
+
+#include <string.h>
+
+extern "C" {
+
+int glob_pattern_p (const char *pattern, int quote)
+{
+ const char *quote_chars = "\\?*[]";
+ if (!quote)
+ quote_chars++;
+ while ((pattern = strpbrk (pattern, quote_chars)) != NULL)
+ if (*pattern == '\\')
+ pattern++;
+ else
+ return true;
+ return false;
+}
+
+} /* extern "C" */
diff --git a/winsup/cygwin/include/glob.h b/winsup/cygwin/include/glob.h
index 1a463ca..93f2d7e 100644
--- a/winsup/cygwin/include/glob.h
+++ b/winsup/cygwin/include/glob.h
@@ -109,8 +109,9 @@ __BEGIN_DECLS
# define DLLEXPORT __declspec(dllimport)
#endif
-int DLLEXPORT glob(const char *, int, int (*)(const char *, int), glob_t *);
-void DLLEXPORT globfree(glob_t *);
+int DLLEXPORT glob (const char *, int, int (*)(const char *, int), glob_t *);
+void DLLEXPORT globfree (glob_t *);
+int DLLEXPORT glob_pattern_p (const char *, int);
__END_DECLS
#endif /* !_GLOB_H_ */
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index fd555c9..300388f 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -51,7 +51,7 @@ bool is_toplevel_proc;
/* Setup the pinfo structure for this process. There may already be a
_pinfo for this "pid" if h != NULL. */
-void __stdcall
+void
pinfo::thisproc (HANDLE h)
{
procinfo = NULL;