To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under
include, where Hugs can find it.
-- * The @Regex@ type
Regex, -- abstract
-- * The @Regex@ type
Regex, -- abstract
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
-- * Compiling a regular expression
regcomp, -- :: String -> Int -> IO Regex
-- * Compiling a regular expression
regcomp, -- :: String -> Int -> IO Regex
-- String, -- everything after match
-- [String])) -- subexpression matches
-- String, -- everything after match
-- [String])) -- subexpression matches
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
+
+#if HAVE_REGEX_H && HAVE_REGCOMP
+#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 #-}
-- | A compiled regular expression
newtype Regex = Regex (ForeignPtr CRegex)
-- | A compiled regular expression
newtype Regex = Regex (ForeignPtr CRegex)
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
--- to the end
-- -----------------------------------------------------------------------------
-- regcomp
-- -----------------------------------------------------------------------------
-- regcomp
foreign import ccall unsafe "regexec"
c_regexec :: Ptr CRegex -> CString -> CSize
-> Ptr CRegMatch -> CInt -> IO CInt
foreign import ccall unsafe "regexec"
c_regexec :: Ptr CRegex -> CString -> CSize
-> Ptr CRegMatch -> CInt -> IO CInt
-
-#endif /* HAVE_REGEX_H */
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
+#include "regex/regex.h"
// removed collate stuff --SDM
// #include "collate.h"
// removed collate stuff --SDM
// #include "collate.h"
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
+#include "regex/regex.h"
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
+#include "regex/regex.h"
#include "utils.h"
#include "regex2.h"
#include "utils.h"
#include "regex2.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
+#include "regex/regex.h"
#include "utils.h"
#include "regex2.h"
#include "utils.h"
#include "regex2.h"