]> gitweb @ CieloNegro.org - bindings-librrd.git/blob - Bindings/Librrd/Client.hsc
added Bindings.Librrd.Client
[bindings-librrd.git] / Bindings / Librrd / Client.hsc
1 #include <bindings.dsl.h>
2 #include <HsBaseConfig.h>
3 #include <rrd_client.h>
4
5 -- |<http://oss.oetiker.ch/rrdtool/doc/librrd.en.html>
6 -- 
7 -- <http://oss.oetiker.ch/rrdtool/doc/rrdcached.en.html>
8
9 module Bindings.Librrd.Client where
10 #strict_import
11
12 #cinline RRDCACHED_DEFAULT_ADDRESS, CString
13 #cinline RRDCACHED_DEFAULT_PORT   , CString
14 #cinline ENV_RRDCACHED_ADDRESS    , CString
15
16 #ccall rrdc_connect     , CString -> IO CInt
17 #ccall rrdc_is_connected, CString -> IO CInt
18 #ccall rrdc_disconnect  , IO CInt
19
20 #ccall rrdc_update, CString -> CInt -> Ptr CString -> IO CInt
21
22 #ccall rrdc_flush          , CString -> IO CInt
23 #ccall rrdc_flush_if_daemon, CString -> CString -> IO CInt
24
25 -- Helper definitions for rrdc_stats_t
26 #num RRDC_STATS_TYPE_GAUGE
27 #num RRDC_STATS_TYPE_COUNTER
28
29 #starttype struct rrdc_stats_s
30 #field name , CString
31 #field type , Word16
32 #union_field value.counter, Word64
33 #union_field value.gauge  , CDouble
34 #field next , Ptr <rrdc_stats_s>
35 #stoptype
36 #synonym_t rrdc_stats_t, <rrdc_stats_s>
37
38 #ccall rrdc_stats_get , Ptr (Ptr <rrdc_stats_t>) -> IO CInt
39 #ccall rrdc_stats_free, Ptr <rrdc_stats_t> -> IO ()