]> gitweb @ CieloNegro.org - bindings-apr.git/blob - Bindings/APR/Tables.hsc
more bindings
[bindings-apr.git] / Bindings / APR / Tables.hsc
1 #include <bindings.dsl.h>
2 #include <apr_tables.h>
3
4 module Bindings.APR.Tables where
5 #strict_import
6 import Bindings.APR
7 import Bindings.APR.Pools
8
9 #opaque_t apr_table_t
10
11 #starttype struct apr_array_header_t
12 #  field pool    , Ptr <apr_pool_t>
13 #  field elt_size, CInt
14 #  field nelts   , CInt
15 #  field nalloc  , CInt
16 #  field elts    , Ptr CChar
17 #stoptype
18
19 #starttype struct apr_table_entry_t
20 #  field key, Ptr CChar
21 #  field val, Ptr CChar
22 #  field key_checksum, <apr_uint32_t>
23 #stoptype
24
25 #ccall apr_table_elts    , Ptr <apr_table_t> -> IO (Ptr <apr_array_header_t>)
26
27 #ccall apr_is_empty_table, Ptr <apr_table_t> -> IO CInt
28 #ccall apr_is_empty_array, Ptr <apr_array_header_t> -> IO CInt
29
30 #ccall apr_array_make    , Ptr <apr_pool_t> -> CInt -> CInt -> IO (Ptr <apr_array_header_t>)
31 #ccall apr_array_push    , Ptr <apr_array_header_t> -> IO (Ptr ())
32
33 -- It's impossible to wrap around APR_ARRAY_IDX and APR_ARRAY_PUSH as
34 -- they take C types as their arguments.
35
36 #ccall apr_array_pop     , Ptr <apr_array_header_t> -> IO (Ptr ())
37 #ccall apr_array_clear   , Ptr <apr_array_header_t> -> IO ()
38 #ccall apr_array_cat     , Ptr <apr_array_header_t> -> Ptr <apr_array_header_t> -> IO ()
39 #ccall apr_array_copy    , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
40 #ccall apr_array_copy_hdr, Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
41 #ccall apr_array_append  , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> Ptr <apr_array_header_t> -> IO (Ptr <apr_array_header_t>)
42 #ccall apr_array_pstrcat , Ptr <apr_pool_t> -> Ptr <apr_array_header_t> -> CChar -> IO (Ptr CChar)
43
44 #ccall apr_table_make  , Ptr <apr_pool_t> -> CInt -> IO (Ptr <apr_table_t>)
45 #ccall apr_table_copy  , Ptr <apr_pool_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)
46 #ccall apr_table_clone , Ptr <apr_pool_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)
47 #ccall apr_table_clear , Ptr <apr_table_t> -> IO ()
48 #ccall apr_table_get   , Ptr <apr_table_t> -> Ptr CChar -> IO (Ptr CChar)
49 #ccall apr_table_set   , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
50 #ccall apr_table_setn  , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
51 #ccall apr_table_unset , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
52 #ccall apr_table_merge , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
53 #ccall apr_table_mergen, Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
54 #ccall apr_table_add   , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
55 #ccall apr_table_addn  , Ptr <apr_table_t> -> Ptr CChar -> Ptr CChar -> IO ()
56 #ccall apr_table_overlay, Ptr <apr_pool_t> -> Ptr <apr_table_t> -> Ptr <apr_table_t> -> IO (Ptr <apr_table_t>)
57
58 #callback apr_table_do_callback_fn_t, Ptr () -> Ptr CChar -> Ptr CChar -> IO CInt
59
60 -- It's impossible to wrap around apr_table_do and apr_table_vdo as
61 -- they take varargs.
62
63 #num APR_OVERLAP_TABLES_SET
64 #num APR_OVERLAP_TABLES_MERGE
65
66 #ccall apr_table_overlap , Ptr <apr_table_t> -> Ptr <apr_table_t> -> CUInt -> IO ()
67 #ccall apr_table_compress, Ptr <apr_table_t> -> CUInt -> IO ()