packages feed

bindings-apr-0.1: Bindings/APR/Tables.hsc

#include <bindings.dsl.h>
#include <apr_tables.h>

module Bindings.APR.Tables where
#strict_import
import Bindings.APR
import Bindings.APR.Pools

#opaque_t apr_table_t

#starttype struct apr_array_header_t
#  field pool    , Ptr <apr_pool_t>
#  field elt_size, CInt
#  field nelts   , CInt
#  field nalloc  , CInt
#  field elts    , Ptr CChar
#stoptype

#starttype struct apr_table_entry_t
#  field key, Ptr CChar
#  field val, Ptr CChar
#  field key_checksum, <apr_uint32_t>
#stoptype

#ccall apr_table_elts    , Ptr <apr_table_t> -> IO (Ptr <apr_array_header_t>)

#ccall apr_is_empty_table, Ptr <apr_table_t> -> IO CInt
#ccall apr_is_empty_array, Ptr <apr_array_header_t> -> IO CInt

#ccall apr_array_make    , Ptr <apr_pool_t> -> CInt -> CInt -> IO (Ptr <apr_array_header_t>)
#ccall apr_array_push    , Ptr <apr_array_header_t> -> IO (Ptr ())

-- It's impossible to wrap around APR_ARRAY_IDX and APR_ARRAY_PUSH as
-- they take C types as their arguments.

#ccall apr_array_pop     , Ptr <apr_array_header_t> -> IO (Ptr ())
#ccall apr_array_clear   , Ptr <apr_array_header_t> -> IO ()
#ccall apr_array_cat     , Ptr <apr_array_header_t> -> Ptr <apr_array_header_t> -> IO ()
#ccall apr_array_copy    , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
#ccall apr_array_copy_hdr, Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
#ccall apr_array_append  , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
#ccall apr_array_pstrcat , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> CChar -> IO (Ptr CChar)

#ccall apr_table_make  , Ptr <apr_pool_t> -> CInt -> IO (Ptr <apr_table_t>)
#ccall apr_table_copy  , Ptr <apr_pool_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)
#ccall apr_table_clone , Ptr <apr_pool_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)
#ccall apr_table_clear , Ptr <apr_table_t> -> IO ()
#ccall apr_table_get   , Ptr <apr_table_t> -> Ptr CChar -> IO (Ptr CChar)
#ccall apr_table_set   , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_setn  , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_unset , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_merge , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_mergen, Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_add   , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_addn  , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
#ccall apr_table_overlay, Ptr <apr_pool_t> -> Ptr <apr_table_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)

#callback apr_table_do_callback_fn_t, Ptr () -> Ptr CChar -> Ptr CChar -> IO CInt

-- It's impossible to wrap around apr_table_do and apr_table_vdo as
-- they take varargs.

#num APR_OVERLAP_TABLES_SET
#num APR_OVERLAP_TABLES_MERGE

#ccall apr_table_overlap , Ptr <apr_table_t> -> Ptr <apr_table_t> -> CUInt -> IO ()
#ccall apr_table_compress, Ptr <apr_table_t> -> CUInt -> IO ()