From: PHO Date: Sat, 11 Sep 2010 03:02:46 +0000 (+0900) Subject: Bindings.APR.DBM X-Git-Tag: RELEASE-0.1~17 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=8cfda548ff9566d805e28a5c1cb5b4c840470575;p=bindings-apr-util.git Bindings.APR.DBM --- diff --git a/Bindings/APR/DBM.hsc b/Bindings/APR/DBM.hsc new file mode 100644 index 0000000..2b40726 --- /dev/null +++ b/Bindings/APR/DBM.hsc @@ -0,0 +1,35 @@ +#include +#include + +module Bindings.APR.DBM where +#strict_import +import Bindings.APR +import Bindings.APR.ErrNo +import Bindings.APR.File.Info +import Bindings.APR.Pools + +#opaque_t apr_dbm_t + +#starttype apr_datum_t +# field dptr , Ptr CChar +# field dsize, +#stoptype + +#num APR_DBM_READONLY +#num APR_DBM_READWRITE +#num APR_DBM_RWCREATE +#num APR_DBM_RWTRUNC + +#ccall apr_dbm_open_ex, Ptr (Ptr ) -> Ptr CChar -> Ptr CChar -> -> -> Ptr -> IO +#ccall apr_dbm_open , Ptr (Ptr ) -> Ptr CChar -> -> -> Ptr -> IO +#ccall apr_dbm_close , Ptr -> IO () +#cinline apr_dbm_fetch , Ptr -> Ptr -> Ptr -> IO +#cinline apr_dbm_store , Ptr -> Ptr -> Ptr -> IO +#cinline apr_dbm_delete , Ptr -> Ptr -> IO +#cinline apr_dbm_exists , Ptr -> Ptr -> IO CInt +#ccall apr_dbm_firstkey, Ptr -> Ptr -> IO +#ccall apr_dbm_nextkey , Ptr -> Ptr -> IO +#cinline apr_dbm_freedatum, Ptr -> Ptr -> IO () +#ccall apr_dbm_geterror, Ptr -> Ptr CInt -> Ptr CChar -> -> IO (Ptr CChar) +#ccall apr_dbm_get_usednames_ex, Ptr -> Ptr CChar -> Ptr CChar -> Ptr (Ptr CChar) -> Ptr (Ptr CChar) -> IO +#ccall apr_dbm_get_usednames, Ptr -> Ptr CChar -> Ptr (Ptr CChar) -> Ptr (Ptr CChar) -> IO () diff --git a/bindings-apr-util.cabal b/bindings-apr-util.cabal index f154480..2018838 100644 --- a/bindings-apr-util.cabal +++ b/bindings-apr-util.cabal @@ -35,10 +35,12 @@ Library Bindings.APR.Buckets Bindings.APR.Date Bindings.APR.DBD + Bindings.APR.DBM C-Sources: cbits/helper_apr_anylock.c cbits/helper_apr_buckets.c + cbits/helper_apr_dbm.c Extensions: ForeignFunctionInterface diff --git a/cbits/helper_apr_dbm.c b/cbits/helper_apr_dbm.c new file mode 100644 index 0000000..bf52f0c --- /dev/null +++ b/cbits/helper_apr_dbm.c @@ -0,0 +1,22 @@ +#include +#include + +apr_status_t inline_apr_dbm_fetch(apr_dbm_t* dbm, apr_datum_t* key, apr_datum_t* pvalue) { + return apr_dbm_fetch(dbm, *key, pvalue); +} + +apr_status_t inline_apr_dbm_store(apr_dbm_t* dbm, apr_datum_t* key, apr_datum_t* value) { + return apr_dbm_store(dbm, *key, *value); +} + +apr_status_t inline_apr_dbm_delete(apr_dbm_t* dbm, apr_datum_t* key) { + return apr_dbm_delete(dbm, *key); +} + +int inline_apr_dbm_exists(apr_dbm_t* dbm, apr_datum_t* key) { + return apr_dbm_exists(dbm, *key); +} + +void inline_apr_dbm_freedatum(apr_dbm_t* dbm, apr_datum_t* data) { + apr_dbm_freedatum(dbm, *data); +}