-----------------------------------------------------------------------------
-- ToDo: should have an interface using PackedStrings.
+#include "config.h"
module Text.Regex.Posix (
-- * The @Regex@ type
) where
#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
import Foreign
import Foreign.C
+type CRegex = ()
+
-- | A compiled regular expression
newtype Regex = Regex (ForeignPtr CRegex)
REG_ERANGE, \
REG_ESPACE
-type CRegex = ()
type CRegMatch = ()
foreign import ccall unsafe "regcomp"