From 0848d77fdcf4583b989d3fb67a5b08e9bfad2ee8 Mon Sep 17 00:00:00 2001 From: PHO Date: Sat, 21 Aug 2010 14:58:37 +0900 Subject: [PATCH] Bindings.APR.Version --- Bindings/APR/Version.hsc | 28 ++++++++++++++++++++++++++++ bindings-apr.cabal | 2 ++ cbits/helper_apr_version.c | 4 ++++ 3 files changed, 34 insertions(+) create mode 100644 Bindings/APR/Version.hsc create mode 100644 cbits/helper_apr_version.c diff --git a/Bindings/APR/Version.hsc b/Bindings/APR/Version.hsc new file mode 100644 index 0000000..6f00153 --- /dev/null +++ b/Bindings/APR/Version.hsc @@ -0,0 +1,28 @@ +#include +#include + +module Bindings.APR.Version where +#strict_import + +#num APR_MAJOR_VERSION +#num APR_MINOR_VERSION +#num APR_PATCH_VERSION + +#cinline APR_VERSION_AT_LEAST, CInt -> CInt -> CInt -> IO CInt + +#pointer APR_IS_DEV_STRING +#pointer APR_VERSION_STRING + +#if !defined(APR_VERSION_ONLY) + +# starttype apr_version_t +# field major , CInt +# field minor , CInt +# field patch , CInt +# field is_dev, CInt +# stoptype + +# ccall apr_version, Ptr -> IO () +# ccall apr_version_string, IO (Ptr CChar) + +#endif \ No newline at end of file diff --git a/bindings-apr.cabal b/bindings-apr.cabal index 2d556d0..752bcb2 100644 --- a/bindings-apr.cabal +++ b/bindings-apr.cabal @@ -63,6 +63,7 @@ Library Bindings.APR.Thread.RWLock Bindings.APR.Time Bindings.APR.User + Bindings.APR.Version Bindings.APR.Want C-Sources: @@ -76,6 +77,7 @@ Library cbits/helper_apr_time.c cbits/helper_apr_thread_proc.c cbits/helper_apr_user.c + cbits/helper_apr_version.c Extensions: ForeignFunctionInterface diff --git a/cbits/helper_apr_version.c b/cbits/helper_apr_version.c new file mode 100644 index 0000000..add2bdf --- /dev/null +++ b/cbits/helper_apr_version.c @@ -0,0 +1,4 @@ +#include +#include + +BC_INLINE3(APR_VERSION_AT_LEAST, int, int, int, int) -- 2.40.0