From bcd52d085f2d06edab7dd48046202df59a626ea7 Mon Sep 17 00:00:00 2001 From: PHO Date: Tue, 31 Aug 2010 22:37:08 +0900 Subject: [PATCH] new header: bindings.apr.ring.h --- Bindings/APR/MMap.hsc | 4 ++-- bindings-apr.cabal | 6 ++++++ include/bindings.apr.ring.h | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 include/bindings.apr.ring.h diff --git a/Bindings/APR/MMap.hsc b/Bindings/APR/MMap.hsc index 376702d..de1d94d 100644 --- a/Bindings/APR/MMap.hsc +++ b/Bindings/APR/MMap.hsc @@ -1,5 +1,6 @@ #include #include +#include "bindings.apr.ring.h" module Bindings.APR.MMap where #strict_import @@ -15,8 +16,7 @@ import Bindings.APR.File.Types # field cntxt , Ptr # field mm , Ptr () # field size , -# field link.next, Ptr -# field link.prev, Ptr +# apr_ring_entry_field link, #stoptype #if APR_HAS_MMAP diff --git a/bindings-apr.cabal b/bindings-apr.cabal index 4da632a..4e8628e 100644 --- a/bindings-apr.cabal +++ b/bindings-apr.cabal @@ -77,5 +77,11 @@ Library cbits/helper_apr_user.c cbits/helper_apr_version.c + Include-Dirs: + include + + Install-Includes: + include/bindings.apr.ring.h + Extensions: ForeignFunctionInterface diff --git a/include/bindings.apr.ring.h b/include/bindings.apr.ring.h new file mode 100644 index 0000000..68f7bf7 --- /dev/null +++ b/include/bindings.apr.ring.h @@ -0,0 +1,14 @@ +#ifndef __BINDINGS_APR_RING_H__ +#define __BINDINGS_APR_RING_H__ + +#define hsc_apr_ring_entry_field(NAME, TYPE) \ + hsc_field(NAME.next, Ptr TYPE) \ + hsc_field(NAME.prev, Ptr TYPE) + +#define hsc_apr_ring_head_t(NAME, TYPE) \ + hsc_starttype(NAME) \ + hsc_field(next, Ptr TYPE) \ + hsc_field(prev, Ptr TYPE) \ + hsc_stoptype(dummy) + +#endif -- 2.40.0