* Makefile.in (DLL_OFILES): Remove v8 regexp files.
(OBSOLETE_FUNCTIONS): Remove v8 regexp functions. (NEW_FUNCTIONS): Remove POSIX regex functions. * cygwin.din: Export POSIX regex functions with their correct symbol name. Export with posix_ prefix for backward compatibility. * syscalls.cc (regfree): Remove ancient fake function. * regex/regex.h: Remove renaming regex functions within Cygwin. * regexp/*: Remove. * include /cygwin/version,.h: Bump API minor number.
This commit is contained in:
parent
f2cb69fd8e
commit
f9afd0ced7
|
@ -1,3 +1,15 @@
|
|||
2008-07-29 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* Makefile.in (DLL_OFILES): Remove v8 regexp files.
|
||||
(OBSOLETE_FUNCTIONS): Remove v8 regexp functions.
|
||||
(NEW_FUNCTIONS): Remove POSIX regex functions.
|
||||
* cygwin.din: Export POSIX regex functions with their correct symbol
|
||||
name. Export with posix_ prefix for backward compatibility.
|
||||
* syscalls.cc (regfree): Remove ancient fake function.
|
||||
* regex/regex.h: Remove renaming regex functions within Cygwin.
|
||||
* regexp/*: Remove.
|
||||
* include /cygwin/version,.h: Bump API minor number.
|
||||
|
||||
2008-07-27 Corinna Vinschen <corinna@vinschen.de>
|
||||
Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
|
|
|
@ -144,14 +144,13 @@ DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \
|
|||
sec_helper.o security.o select.o sem.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 v8_regexp.o \
|
||||
v8_regerror.o v8_regsub.o wait.o wincap.o window.o winf.o xsique.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
|
||||
|
||||
OBSOLETE_FUNCTIONS:=regcomp regerror regexec regfree regsub \
|
||||
open acl aclcheck aclfrommode aclfrompbits \
|
||||
OBSOLETE_FUNCTIONS:=open acl aclcheck aclfrommode aclfrompbits \
|
||||
aclfromtext aclsort acltomode acltopbits \
|
||||
acltotext chown facl fchown fcntl fdopen fgetpos fopen \
|
||||
freopen fseeko fsetpos fstat ftello ftruncate \
|
||||
|
@ -161,11 +160,7 @@ OBSOLETE_FUNCTIONS:=regcomp regerror regexec regfree regsub \
|
|||
setgid setgroups setregid setreuid setuid stat \
|
||||
telldir tmpfile truncate timezone
|
||||
|
||||
NEW_FUNCTIONS:=regcomp posix_regcomp \
|
||||
regerror posix_regerror \
|
||||
regexec posix_regexec \
|
||||
regfree posix_regfree \
|
||||
open _open64 \
|
||||
NEW_FUNCTIONS:=open _open64 \
|
||||
acl _acl32 \
|
||||
aclcheck _aclcheck32 \
|
||||
aclfrommode _aclfrommode32 \
|
||||
|
|
|
@ -1054,10 +1054,10 @@ posix_fallocate SIGFE
|
|||
posix_madvise SIGFE
|
||||
posix_memalign SIGFE
|
||||
posix_openpt SIGFE
|
||||
posix_regcomp SIGFE
|
||||
posix_regerror SIGFE
|
||||
posix_regexec SIGFE
|
||||
posix_regfree SIGFE
|
||||
posix_regcomp = regcomp SIGFE
|
||||
posix_regerror = regerror SIGFE
|
||||
posix_regexec = regexec SIGFE
|
||||
posix_regfree = regfree SIGFE
|
||||
pow NOSIGFE
|
||||
_pow = pow NOSIGFE
|
||||
pow10 NOSIGFE
|
||||
|
@ -1192,6 +1192,10 @@ realpath SIGFE
|
|||
recv = cygwin_recv SIGFE
|
||||
recvfrom = cygwin_recvfrom SIGFE
|
||||
recvmsg = cygwin_recvmsg SIGFE
|
||||
regcomp SIGFE
|
||||
regerror SIGFE
|
||||
regexec SIGFE
|
||||
regfree SIGFE
|
||||
remainder NOSIGFE
|
||||
_remainder = remainder NOSIGFE
|
||||
remainderf NOSIGFE
|
||||
|
|
|
@ -332,12 +332,13 @@ details. */
|
|||
linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat, symlinkat,
|
||||
unlinkat.
|
||||
185: Export futimens, utimensat.
|
||||
186: Remove ancient V8 regexp functions.
|
||||
*/
|
||||
|
||||
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
||||
|
||||
#define CYGWIN_VERSION_API_MAJOR 0
|
||||
#define CYGWIN_VERSION_API_MINOR 185
|
||||
#define CYGWIN_VERSION_API_MINOR 186
|
||||
|
||||
/* There is also a compatibity version number associated with the
|
||||
shared memory regions. It is incremented when incompatible
|
||||
|
|
|
@ -6,13 +6,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __INSIDE_CYGWIN__
|
||||
#define regcomp posix_regcomp
|
||||
#define regerror posix_regerror
|
||||
#define regexec posix_regexec
|
||||
#define regfree posix_regfree
|
||||
#endif
|
||||
|
||||
/* === regex2.h === */
|
||||
typedef _off_t regoff_t;
|
||||
typedef struct {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
This entire subtree is copyright the University of Toronto.
|
||||
The following copyright notice applies to all files found here. None of
|
||||
these files contain AT&T proprietary source code.
|
||||
_____________________________________________________________________________
|
||||
|
||||
Copyright (c) 1986 by University of Toronto.
|
||||
Written by Henry Spencer. Not derived from licensed software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose on any computer system, and to redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The author is not responsible for the consequences of use of
|
||||
this software, no matter how awful, even if they arise
|
||||
from defects in it.
|
||||
|
||||
2. The origin of this software must not be misrepresented, either
|
||||
by explicit claim or by omission.
|
||||
|
||||
3. Altered versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
This is a nearly-public-domain reimplementation of the V8 regexp(3) package.
|
||||
It gives C programs the ability to use egrep-style regular expressions, and
|
||||
does it in a much cleaner fashion than the analogous routines in SysV.
|
||||
|
||||
Copyright (c) 1986 by University of Toronto.
|
||||
Written by Henry Spencer. Not derived from licensed software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose on any computer system, and to redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The author is not responsible for the consequences of use of
|
||||
this software, no matter how awful, even if they arise
|
||||
from defects in it.
|
||||
|
||||
2. The origin of this software must not be misrepresented, either
|
||||
by explicit claim or by omission.
|
||||
|
||||
3. Altered versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
|
||||
Barring a couple of small items in the BUGS list, this implementation is
|
||||
believed 100% compatible with V8. It should even be binary-compatible,
|
||||
sort of, since the only fields in a "struct regexp" that other people have
|
||||
any business touching are declared in exactly the same way at the same
|
||||
location in the struct (the beginning).
|
||||
|
||||
This implementation is *NOT* AT&T/Bell code, and is not derived from licensed
|
||||
software. Even though U of T is a V8 licensee. This software is based on
|
||||
a V8 manual page sent to me by Dennis Ritchie (the manual page enclosed
|
||||
here is a complete rewrite and hence is not covered by AT&T copyright).
|
||||
The software was nearly complete at the time of arrival of our V8 tape.
|
||||
I haven't even looked at V8 yet, although a friend elsewhere at U of T has
|
||||
been kind enough to run a few test programs using the V8 regexp(3) to resolve
|
||||
a few fine points. I admit to some familiarity with regular-expression
|
||||
implementations of the past, but the only one that this code traces any
|
||||
ancestry to is the one published in Kernighan & Plauger (from which this
|
||||
one draws ideas but not code).
|
||||
|
||||
Simplistically: put this stuff into a source directory, copy regexp.h into
|
||||
/usr/include, inspect Makefile for compilation options that need changing
|
||||
to suit your local environment, and then do "make r". This compiles the
|
||||
regexp(3) functions, compiles a test program, and runs a large set of
|
||||
regression tests. If there are no complaints, then put regexp.o, regsub.o,
|
||||
and regerror.o into your C library, and regexp.3 into your manual-pages
|
||||
directory.
|
||||
|
||||
Note that if you don't put regexp.h into /usr/include *before* compiling,
|
||||
you'll have to add "-I." to CFLAGS before compiling.
|
||||
|
||||
The files are:
|
||||
|
||||
Makefile instructions to make everything
|
||||
regexp.3 manual page
|
||||
regexp.h header file, for /usr/include
|
||||
regexp.c source for regcomp() and regexec()
|
||||
regsub.c source for regsub()
|
||||
regerror.c source for default regerror()
|
||||
regmagic.h internal header file
|
||||
try.c source for test program
|
||||
timer.c source for timing program
|
||||
tests test list for try and timer
|
||||
|
||||
This implementation uses nondeterministic automata rather than the
|
||||
deterministic ones found in some other implementations, which makes it
|
||||
simpler, smaller, and faster at compiling regular expressions, but slower
|
||||
at executing them. In theory, anyway. This implementation does employ
|
||||
some special-case optimizations to make the simpler cases (which do make
|
||||
up the bulk of regular expressions actually used) run quickly. In general,
|
||||
if you want blazing speed you're in the wrong place. Replacing the insides
|
||||
of egrep with this stuff is probably a mistake; if you want your own egrep
|
||||
you're going to have to do a lot more work. But if you want to use regular
|
||||
expressions a little bit in something else, you're in luck. Note that many
|
||||
existing text editors use nondeterministic regular-expression implementations,
|
||||
so you're in good company.
|
||||
|
||||
This stuff should be pretty portable, given appropriate option settings.
|
||||
If your chars have less than 8 bits, you're going to have to change the
|
||||
internal representation of the automaton, although knowledge of the details
|
||||
of this is fairly localized. There are no "reserved" char values except for
|
||||
NUL, and no special significance is attached to the top bit of chars.
|
||||
The string(3) functions are used a fair bit, on the grounds that they are
|
||||
probably faster than coding the operations in line. Some attempts at code
|
||||
tuning have been made, but this is invariably a bit machine-specific.
|
|
@ -1,34 +0,0 @@
|
|||
/* regexp.h
|
||||
|
||||
Copyright 1996, 2001 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
/*
|
||||
* Definitions etc. for regexp(3) routines.
|
||||
*
|
||||
* Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
|
||||
* not the System V one.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define NSUBEXP 10
|
||||
typedef struct regexp {
|
||||
char *startp[NSUBEXP];
|
||||
char *endp[NSUBEXP];
|
||||
char regstart; /* Internal use only. */
|
||||
char reganch; /* Internal use only. */
|
||||
char *regmust; /* Internal use only. */
|
||||
int regmlen; /* Internal use only. */
|
||||
char program[1]; /* Unwarranted chumminess with compiler. */
|
||||
} regexp;
|
||||
|
||||
extern regexp *regcomp();
|
||||
extern int regexec();
|
||||
extern void regsub();
|
||||
extern void regerror();
|
|
@ -1,17 +0,0 @@
|
|||
/* regmagic.h
|
||||
|
||||
Copyright 1996, 2001 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* The first byte of the regexp internal "program" is actually this magic
|
||||
* number; the start node begins in the second byte.
|
||||
*/
|
||||
#define MAGIC 0234
|
|
@ -1,28 +0,0 @@
|
|||
/* regerror.c
|
||||
|
||||
Copyright 1996, 1998, 2001 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "regexp.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void __declspec(dllexport)
|
||||
regerror(const char *s __attribute__ ((unused)))
|
||||
{
|
||||
#ifdef ERRAVAIL
|
||||
error("regexp: %s", s);
|
||||
#else
|
||||
/*
|
||||
fprintf(stderr, "regexp(3): %s\n", s);
|
||||
exit(1);
|
||||
*/
|
||||
return; /* let std. egrep handle errors */
|
||||
#endif
|
||||
/* NOTREACHED */
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* regsub
|
||||
*
|
||||
* Copyright (c) 1986 by University of Toronto.
|
||||
* Written by Henry Spencer. Not derived from licensed software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose on any computer system, and to redistribute it freely,
|
||||
* subject to the following restrictions:
|
||||
*
|
||||
* 1. The author is not responsible for the consequences of use of
|
||||
* this software, no matter how awful, even if they arise
|
||||
* from defects in it.
|
||||
*
|
||||
* 2. The origin of this software must not be misrepresented, either
|
||||
* by explicit claim or by omission.
|
||||
*
|
||||
* 3. Altered versions must be plainly marked as such, and must not
|
||||
* be misrepresented as being the original software.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id$";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include "winsup.h"
|
||||
#include "regexp.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "regmagic.h"
|
||||
|
||||
#ifndef CHARBITS
|
||||
#define UCHARAT(p) ((int)*(unsigned char *)(p))
|
||||
#else
|
||||
#define UCHARAT(p) ((int)*(p)&CHARBITS)
|
||||
#endif
|
||||
|
||||
/*
|
||||
- regsub - perform substitutions after a regexp match
|
||||
*/
|
||||
void __declspec(dllexport)
|
||||
regsub(prog, source, dest)
|
||||
const regexp *prog;
|
||||
const char *source;
|
||||
char *dest;
|
||||
{
|
||||
register char *src;
|
||||
register char *dst;
|
||||
register char c;
|
||||
register int no;
|
||||
register int len;
|
||||
|
||||
if (prog == NULL || source == NULL || dest == NULL) {
|
||||
regerror("NULL parm to regsub");
|
||||
return;
|
||||
}
|
||||
if (UCHARAT(prog->program) != MAGIC) {
|
||||
regerror("damaged regexp fed to regsub");
|
||||
return;
|
||||
}
|
||||
|
||||
src = (char *)source;
|
||||
dst = dest;
|
||||
while ((c = *src++) != '\0') {
|
||||
if (c == '&')
|
||||
no = 0;
|
||||
else if (c == '\\' && '0' <= *src && *src <= '9')
|
||||
no = *src++ - '0';
|
||||
else
|
||||
no = -1;
|
||||
if (no < 0) { /* Ordinary character. */
|
||||
if (c == '\\' && (*src == '\\' || *src == '&'))
|
||||
c = *src++;
|
||||
*dst++ = c;
|
||||
} else if (prog->startp[no] != NULL && prog->endp[no] != NULL) {
|
||||
len = prog->endp[no] - prog->startp[no];
|
||||
(void) strncpy(dst, prog->startp[no], len);
|
||||
dst += len;
|
||||
if (len != 0 && *(dst-1) == '\0') { /* strncpy hit NUL. */
|
||||
regerror("damaged match string");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
*dst++ = '\0';
|
||||
}
|
|
@ -2401,13 +2401,6 @@ ptsname (int fd)
|
|||
return (char *) (cfd->ptsname ());
|
||||
}
|
||||
|
||||
/* FIXME: what is this? */
|
||||
extern "C" int __declspec(dllexport)
|
||||
regfree ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __stdcall
|
||||
mknod_worker (const char *path, mode_t type, mode_t mode, _major_t major,
|
||||
_minor_t minor)
|
||||
|
|
Loading…
Reference in New Issue