* 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.
This commit is contained in:
Christopher Faylor 2008-12-31 21:33:34 +00:00
parent 762cf3ee22
commit ecd5bc4ea8
6 changed files with 53 additions and 16 deletions

View File

@ -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> 2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
* include/bits/wordsize.h: New linux-compatibility header. * include/bits/wordsize.h: New linux-compatibility header.

View File

@ -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_registry.o fhandler_serial.o fhandler_socket.o fhandler_tape.o \
fhandler_termios.o fhandler_tty.o fhandler_virtual.o fhandler_windows.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 \ 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 \ glob_pattern_p.o grp.o heap.o hookapi.o inet_addr.o inet_network.o \
kernel32.o localtime.o lsearch.o malloc_wrapper.o minires-os-if.o \ init.o ioctl.o ipc.o kernel32.o localtime.o lsearch.o malloc_wrapper.o \
minires.o miscfuncs.o mktemp.o mmap.o msg.o mount.o net.o netdb.o nfs.o \ minires-os-if.o minires.o miscfuncs.o mktemp.o mmap.o msg.o mount.o \
nftw.o ntea.o passwd.o path.o pinfo.o pipe.o poll.o posix_ipc.o \ net.o netdb.o nfs.o nftw.o ntea.o passwd.o path.o pinfo.o pipe.o \
pthread.o random.o regcomp.o regerror.o regexec.o regfree.o registry.o \ poll.o posix_ipc.o pthread.o random.o regcomp.o regerror.o regexec.o \
resource.o rexec.o rcmd.o scandir.o sched.o sec_acl.o sec_auth.o \ regfree.o registry.o resource.o rexec.o rcmd.o scandir.o sched.o \
sec_helper.o security.o select.o sem.o setlsapwd.o shared.o shm.o \ sec_acl.o sec_auth.o sec_helper.o security.o select.o sem.o \
sigfe.o signal.o sigproc.o smallprint.o spawn.o strace.o strfuncs.o \ setlsapwd.o shared.o shm.o sigfe.o signal.o sigproc.o smallprint.o \
strptime.o strsep.o strsig.o sync.o syscalls.o sysconf.o syslog.o \ spawn.o strace.o strfuncs.o strptime.o strsep.o strsig.o sync.o \
termios.o thread.o timer.o times.o tls_pbuf.o tty.o uinfo.o uname.o \ syscalls.o sysconf.o syslog.o termios.o thread.o timer.o times.o \
wait.o wincap.o window.o winf.o xsique.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) $(EXTRA_DLL_OFILES) $(EXTRA_OFILES) $(MALLOC_OFILES) $(MT_SAFE_OBJECTS)
GMON_OFILES:=gmon.o mcount.o profil.o GMON_OFILES:=gmon.o mcount.o profil.o

View File

@ -719,9 +719,8 @@ getwd SIGFE
_getwd = getwd SIGFE _getwd = getwd SIGFE
getxattr SIGFE getxattr SIGFE
glob SIGFE glob SIGFE
_glob = glob SIGFE
globfree SIGFE globfree SIGFE
_globfree = globfree SIGFE glob_pattern_p
gmtime SIGFE gmtime SIGFE
_gmtime = gmtime SIGFE _gmtime = gmtime SIGFE
gmtime_r SIGFE gmtime_r SIGFE

View File

@ -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" */

View File

@ -109,8 +109,9 @@ __BEGIN_DECLS
# define DLLEXPORT __declspec(dllimport) # define DLLEXPORT __declspec(dllimport)
#endif #endif
int DLLEXPORT glob(const char *, int, int (*)(const char *, int), glob_t *); int DLLEXPORT glob (const char *, int, int (*)(const char *, int), glob_t *);
void DLLEXPORT globfree(glob_t *); void DLLEXPORT globfree (glob_t *);
int DLLEXPORT glob_pattern_p (const char *, int);
__END_DECLS __END_DECLS
#endif /* !_GLOB_H_ */ #endif /* !_GLOB_H_ */

View File

@ -51,7 +51,7 @@ bool is_toplevel_proc;
/* Setup the pinfo structure for this process. There may already be a /* Setup the pinfo structure for this process. There may already be a
_pinfo for this "pid" if h != NULL. */ _pinfo for this "pid" if h != NULL. */
void __stdcall void
pinfo::thisproc (HANDLE h) pinfo::thisproc (HANDLE h)
{ {
procinfo = NULL; procinfo = NULL;