From a3e60688974c71cb0f57ce393baf261500f80c08 Mon Sep 17 00:00:00 2001 From: PHO Date: Sat, 21 Aug 2010 01:08:14 +0900 Subject: [PATCH] Bindings.APR.Lib --- Bindings/APR/Lib.hsc | 37 +++++++++++++++++++++++++++++++++++++ bindings-apr.cabal | 2 ++ cbits/helper_apr_lib.c | 19 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 Bindings/APR/Lib.hsc create mode 100644 cbits/helper_apr_lib.c diff --git a/Bindings/APR/Lib.hsc b/Bindings/APR/Lib.hsc new file mode 100644 index 0000000..a949124 --- /dev/null +++ b/Bindings/APR/Lib.hsc @@ -0,0 +1,37 @@ +#include +#include + +module Bindings.APR.Lib where +#strict_import +import Bindings.APR +import Bindings.APR.ErrNo +import System.Posix.Types + +#num HUGE_STRING_LEN + +#starttype struct apr_vformatter_buff_t +# field curpos, Ptr CChar +# field endpos, Ptr CChar +#stoptype + +#ccall apr_filepath_name_get, Ptr CChar -> IO (Ptr CChar) + +#cinline apr_killpg, CPid -> CInt -> IO CInt + +-- apr_vformatter takes va_list... + +#ccall apr_password_get, Ptr CChar -> Ptr CChar -> Ptr -> IO + +#cinline apr_isalnum , CInt -> IO CInt +#cinline apr_isalpha , CInt -> IO CInt +#cinline apr_isdigit , CInt -> IO CInt +#cinline apr_isgraph , CInt -> IO CInt +#cinline apr_islower , CInt -> IO CInt +#cinline apr_isascii , CInt -> IO CInt +#cinline apr_isprint , CInt -> IO CInt +#cinline apr_ispunct , CInt -> IO CInt +#cinline apr_isspace , CInt -> IO CInt +#cinline apr_isupper , CInt -> IO CInt +#cinline apr_isxdigit, CInt -> IO CInt +#cinline apr_tolower , CInt -> IO CInt +#cinline apr_toupper , CInt -> IO CInt diff --git a/bindings-apr.cabal b/bindings-apr.cabal index f656208..4addaf0 100644 --- a/bindings-apr.cabal +++ b/bindings-apr.cabal @@ -44,6 +44,7 @@ Library Bindings.APR.GetOpt Bindings.APR.Global.Mutex Bindings.APR.Hash + Bindings.APR.Lib Bindings.APR.Pools Bindings.APR.Proc.Mutex Bindings.APR.Tables @@ -58,6 +59,7 @@ Library cbits/helper_apr_errno.c cbits/helper_apr_general.c cbits/helper_apr_pools.c + cbits/helper_apr_lib.c cbits/helper_apr_time.c cbits/helper_apr_user.c diff --git a/cbits/helper_apr_lib.c b/cbits/helper_apr_lib.c new file mode 100644 index 0000000..c1f01e2 --- /dev/null +++ b/cbits/helper_apr_lib.c @@ -0,0 +1,19 @@ +#include +#include +#include + +BC_INLINE2(apr_killpg, pid_t, int, int) + +BC_INLINE1(apr_isalnum , int, int) +BC_INLINE1(apr_isalpha , int, int) +BC_INLINE1(apr_isdigit , int, int) +BC_INLINE1(apr_isgraph , int, int) +BC_INLINE1(apr_islower , int, int) +BC_INLINE1(apr_isascii , int, int) +BC_INLINE1(apr_isprint , int, int) +BC_INLINE1(apr_ispunct , int, int) +BC_INLINE1(apr_isspace , int, int) +BC_INLINE1(apr_isupper , int, int) +BC_INLINE1(apr_isxdigit, int, int) +BC_INLINE1(apr_tolower , int, int) +BC_INLINE1(apr_toupper , int, int) -- 2.40.0