[project @ 2004-07-23 15:31:59 by ross]
authorross <unknown>
Fri, 23 Jul 2004 15:32:00 +0000 (15:32 +0000)
committerross <unknown>
Fri, 23 Jul 2004 15:32:00 +0000 (15:32 +0000)
To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under
include, where Hugs can find it.

Text/Regex/Posix.hsc
cbits/regex/regcomp.c
cbits/regex/regerror.c
cbits/regex/regexec.c
cbits/regex/regfree.c
include/regex/regex.h [moved from cbits/regex/regex.h with 100% similarity]

index 56544e1..8cda010 100644 (file)
@@ -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 <sys/types.h>
+
+#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 "&regfree"
 foreign import ccall unsafe "regexec"
   c_regexec :: Ptr CRegex -> CString -> CSize
            -> Ptr CRegMatch -> CInt -> IO CInt
-
-#endif /* HAVE_REGEX_H */
index 4bb3557..be9fdfa 100644 (file)
@@ -49,7 +49,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
 #include <ctype.h>
 #include <limits.h>
 #include <stdlib.h>
-#include "regex.h"
+#include "regex/regex.h"
 
 // removed collate stuff --SDM
 // #include "collate.h"
index 4260c47..20816eb 100644 (file)
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)regerror.c        8.4 (Berkeley) 3/20/94";
 #include <string.h>
 #include <limits.h>
 #include <stdlib.h>
-#include "regex.h"
+#include "regex/regex.h"
 
 #include "utils.h"
 
index de177d5..dac0fa7 100644 (file)
@@ -54,7 +54,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
 #include <string.h>
 #include <limits.h>
 #include <ctype.h>
-#include "regex.h"
+#include "regex/regex.h"
 
 #include "utils.h"
 #include "regex2.h"
index 491b7f7..b46fc4f 100644 (file)
@@ -47,7 +47,7 @@ static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94";
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
-#include "regex.h"
+#include "regex/regex.h"
 
 #include "utils.h"
 #include "regex2.h"
similarity index 100%
rename from cbits/regex/regex.h
rename to include/regex/regex.h