From 82d3f2e98b64ff19a2bbd87bfddb0fa82e5fabb3 Mon Sep 17 00:00:00 2001 From: ross Date: Fri, 23 Jul 2004 15:32:00 +0000 Subject: [PATCH] [project @ 2004-07-23 15:31:59 by ross] To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under include, where Hugs can find it. --- Text/Regex/Posix.hsc | 16 +++++++++------- cbits/regex/regcomp.c | 2 +- cbits/regex/regerror.c | 2 +- cbits/regex/regexec.c | 2 +- cbits/regex/regfree.c | 2 +- {cbits => include}/regex/regex.h | 0 6 files changed, 13 insertions(+), 11 deletions(-) rename {cbits => include}/regex/regex.h (100%) diff --git a/Text/Regex/Posix.hsc b/Text/Regex/Posix.hsc index 56544e1..8cda010 100644 --- a/Text/Regex/Posix.hsc +++ b/Text/Regex/Posix.hsc @@ -19,7 +19,6 @@ module Text.Regex.Posix ( -- * The @Regex@ type Regex, -- abstract -#if !defined(__HUGS__) || defined(HAVE_REGEX_H) -- * Compiling a regular expression regcomp, -- :: String -> Int -> IO Regex @@ -36,12 +35,19 @@ module Text.Regex.Posix ( -- String, -- everything after match -- [String])) -- subexpression matches -#endif ) where -#if !defined(__HUGS__) || defined(HAVE_REGEX_H) #include + +#if HAVE_REGEX_H && HAVE_REGCOMP #include "regex.h" +#else +#include "regex/regex.h" +{-# CBITS regex/reallocf.c #-} +{-# CBITS regex/regcomp.c #-} +{-# CBITS regex/regerror.c #-} +{-# CBITS regex/regexec.c #-} +{-# CBITS regex/regfree.c #-} #endif import Prelude @@ -54,8 +60,6 @@ type CRegex = () -- | A compiled regular expression newtype Regex = Regex (ForeignPtr CRegex) -#if !defined(__HUGS__) || defined(HAVE_REGEX_H) --- to the end -- ----------------------------------------------------------------------------- -- regcomp @@ -174,5 +178,3 @@ foreign import ccall unsafe "®free" foreign import ccall unsafe "regexec" c_regexec :: Ptr CRegex -> CString -> CSize -> Ptr CRegMatch -> CInt -> IO CInt - -#endif /* HAVE_REGEX_H */ diff --git a/cbits/regex/regcomp.c b/cbits/regex/regcomp.c index 4bb3557..be9fdfa 100644 --- a/cbits/regex/regcomp.c +++ b/cbits/regex/regcomp.c @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94"; #include #include #include -#include "regex.h" +#include "regex/regex.h" // removed collate stuff --SDM // #include "collate.h" diff --git a/cbits/regex/regerror.c b/cbits/regex/regerror.c index 4260c47..20816eb 100644 --- a/cbits/regex/regerror.c +++ b/cbits/regex/regerror.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94"; #include #include #include -#include "regex.h" +#include "regex/regex.h" #include "utils.h" diff --git a/cbits/regex/regexec.c b/cbits/regex/regexec.c index de177d5..dac0fa7 100644 --- a/cbits/regex/regexec.c +++ b/cbits/regex/regexec.c @@ -54,7 +54,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94"; #include #include #include -#include "regex.h" +#include "regex/regex.h" #include "utils.h" #include "regex2.h" diff --git a/cbits/regex/regfree.c b/cbits/regex/regfree.c index 491b7f7..b46fc4f 100644 --- a/cbits/regex/regfree.c +++ b/cbits/regex/regfree.c @@ -47,7 +47,7 @@ static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94"; #include #include #include -#include "regex.h" +#include "regex/regex.h" #include "utils.h" #include "regex2.h" diff --git a/cbits/regex/regex.h b/include/regex/regex.h similarity index 100% rename from cbits/regex/regex.h rename to include/regex/regex.h -- 1.7.10.4