From: PHO Date: Wed, 6 Oct 2010 16:59:07 +0000 (+0900) Subject: Bindings.APR.XML and APU.Version X-Git-Tag: RELEASE-0.1^0 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=555f5bdd1b954ba961fa08bcc59bb3f77e57a58d;p=bindings-apr-util.git Bindings.APR.XML and APU.Version --- diff --git a/Bindings/APR/XML.hsc b/Bindings/APR/XML.hsc new file mode 100644 index 0000000..c048d6d --- /dev/null +++ b/Bindings/APR/XML.hsc @@ -0,0 +1,90 @@ +#include +#include + +module Bindings.APR.XML where +#strict_import +import Bindings.APR +import Bindings.APR.ErrNo +import Bindings.APR.File.Types +import Bindings.APR.Pools +import Bindings.APR.Tables +import Bindings.APR.XLate + +#starttype struct apr_text +# field text, Ptr CChar +# field next, Ptr +#stoptype + +#starttype struct apr_text_header +# field first, Ptr +# field last , Ptr +#stoptype + +#ccall apr_text_append, Ptr -> Ptr -> Ptr CChar -> IO () + +#num APR_XML_NS_DAV_ID +#num APR_XML_NS_NONE + +#num APR_XML_NS_ERROR_BASE +#cinline APR_XML_NS_IS_ERROR, CInt -> IO CInt + +#starttype struct apr_xml_attr +# field name , Ptr CChar +# field ns , CInt +# field value, Ptr CChar +# field next , Ptr +#stoptype + +#opaque_t apr_xml_ns_scope + +#starttype struct apr_xml_elem +# field name, Ptr CChar +# field ns , CInt +# field lang, Ptr CChar + +# field first_cdata , +# field following_cdata, + +# field parent , Ptr +# field next , Ptr +# field first_child, Ptr +# field attr , Ptr + +# field last_child , Ptr +# field ns_scope , Ptr + +# field priv, Ptr () +#stoptype + +#cinline APR_XML_ELEM_IS_EMPTY, Ptr -> IO CInt + +#starttype struct apr_xml_doc +# field root , Ptr +# field namespaces, Ptr +#stoptype + +#opaque_t apr_xml_parser + +#ccall apr_xml_parser_create , Ptr -> IO (Ptr ) +#ccall apr_xml_parse_file , Ptr -> Ptr (Ptr ) -> Ptr (Ptr ) -> Ptr -> -> IO +#ccall apr_xml_parser_feed , Ptr -> Ptr CChar -> -> IO +#ccall apr_xml_parser_done , Ptr -> Ptr (Ptr ) -> IO +#ccall apr_xml_parser_geterror, Ptr -> Ptr CChar -> -> IO (Ptr CChar) + +#ccall apr_xml_to_text, Ptr -> Ptr -> CInt -> Ptr -> Ptr CInt -> Ptr (Ptr CChar) -> Ptr -> IO () + +#num APR_XML_X2T_FULL +#num APR_XML_X2T_INNER +#num APR_XML_X2T_LANG_INNER +#num APR_XML_X2T_FULL_NS_LANG + +#ccall apr_xml_empty_elem , Ptr -> Ptr -> IO (Ptr CChar) +#ccall apr_xml_quote_string, Ptr -> Ptr CChar -> CInt -> IO (Ptr CChar) +#ccall apr_xml_quote_elem , Ptr -> Ptr -> IO () +#ccall apr_xml_insert_uri , Ptr -> Ptr CChar -> IO CInt + +#cinline APR_XML_GET_URI_ITEM, Ptr -> CInt -> IO (Ptr CChar) + +#if APR_CHARSET_EBCDIC +# ccall apr_xml_parser_convert_doc, Ptr -> Ptr -> Ptr -> IO +#endif diff --git a/Bindings/APU/Version.hsc b/Bindings/APU/Version.hsc new file mode 100644 index 0000000..9da2d30 --- /dev/null +++ b/Bindings/APU/Version.hsc @@ -0,0 +1,17 @@ +#include +#include + +module Bindings.APU.Version where +#strict_import +import Bindings.APR.Version + +#num APU_MAJOR_VERSION +#num APU_MINOR_VERSION +#num APU_PATCH_VERSION + +#globalarray APU_VERSION_STRING, CChar + +#ifndef APU_VERSION_ONLY +# ccall apu_version , Ptr -> IO () +# ccall apu_version_string, IO (Ptr CChar) +#endif diff --git a/bindings-apr-util.cabal b/bindings-apr-util.cabal index a78f1ac..46f80f6 100644 --- a/bindings-apr-util.cabal +++ b/bindings-apr-util.cabal @@ -29,7 +29,6 @@ Library apr-util-1 >= 1.3 Exposed-Modules: - Bindings.APU Bindings.APR.AnyLock Bindings.APR.Base64 Bindings.APR.Buckets @@ -55,6 +54,9 @@ Library Bindings.APR.URI Bindings.APR.UUID Bindings.APR.XLate + Bindings.APR.XML + Bindings.APU + Bindings.APU.Version C-Sources: cbits/helper_apr_anylock.c @@ -66,6 +68,8 @@ Library cbits/helper_apr_sdbm.c cbits/helper_apr_sha1.c cbits/helper_apr_strmatch.c + cbits/helper_apr_xml.c + cbits/helper_apu_version.c Extensions: ForeignFunctionInterface diff --git a/cbits/helper_apr_xml.c b/cbits/helper_apr_xml.c new file mode 100644 index 0000000..f66384a --- /dev/null +++ b/cbits/helper_apr_xml.c @@ -0,0 +1,6 @@ +#include +#include + +BC_INLINE1(APR_XML_NS_IS_ERROR , int, int) +BC_INLINE1(APR_XML_ELEM_IS_EMPTY, apr_xml_elem*, int) +BC_INLINE2(APR_XML_GET_URI_ITEM , apr_array_header_t*, int, const char*) diff --git a/cbits/helper_apu_version.c b/cbits/helper_apu_version.c new file mode 100644 index 0000000..28aeb78 --- /dev/null +++ b/cbits/helper_apu_version.c @@ -0,0 +1,4 @@ +#include +#include + +BC_GLOBALARRAY(APU_VERSION_STRING, char)