C string macros should be treated as global arrays. master origin/HEAD origin/master RELEASE-0.1
authorPHO <pho@cielonegro.org>
Sun, 19 Sep 2010 03:04:48 +0000 (12:04 +0900)
committerPHO <pho@cielonegro.org>
Sun, 19 Sep 2010 03:04:48 +0000 (12:04 +0900)
Bindings/APR.hsc
Bindings/APR/Network/IO.hsc
Bindings/APR/Time.hsc
Bindings/APR/Version.hsc
bindings-apr.cabal
cbits/helper_apr.c [new file with mode: 0644]
cbits/helper_apr_network_io.c [new file with mode: 0644]
cbits/helper_apr_time.c
cbits/helper_apr_version.c

index 4913ba254d4ba520a8b712019b333f50fa93aba5..24d056a412ba2768d61978eaa6ef4f593c67bb58 100644 (file)
@@ -4,7 +4,7 @@
 module Bindings.APR where
 #strict_import
 
-{- I'm not sure if these are really useful... (PHO)
+{- I'm not sure if these are really helpful... (PHO)
  -}
 #num APR_HAS_INLINE
 
@@ -163,18 +163,18 @@ module Bindings.APR where
 #num APR_UINT64_MAX
 #num APR_SIZE_MAX
 
-#pointer APR_SSIZE_T_FMT
-#pointer APR_SIZE_T_FMT
-#pointer APR_OFF_T_FMT
-#pointer APR_PID_T_FMT
-#pointer APR_INT64_T_FMT
-#pointer APR_UINT64_T_FMT
-#pointer APR_UINT64_T_HEX_FMT
+#globalarray APR_SSIZE_T_FMT     , CChar
+#globalarray APR_SIZE_T_FMT      , CChar
+#globalarray APR_OFF_T_FMT       , CChar
+#globalarray APR_PID_T_FMT       , CChar
+#globalarray APR_INT64_T_FMT     , CChar
+#globalarray APR_UINT64_T_FMT    , CChar
+#globalarray APR_UINT64_T_HEX_FMT, CChar
 #num APR_PROC_MUTEX_IS_GLOBAL
-#pointer APR_EOL_STR
+#globalarray APR_EOL_STR         , CChar
 
 #opaque_t apr_wait_t
 
 #num APR_PATH_MAX
 
-#pointer APR_DSOPATH
+#globalarray APR_DSOPATH, CChar
index febaf5e4633a11b23735ff76f13c4bd8d1a39eec..2928e89f2e995185c2b10182d972e8016039f008 100644 (file)
@@ -14,7 +14,7 @@ import Bindings.APR.Want
 
 #num APR_MAX_SECS_TO_LINGER
 #num APRMAXHOSTLEN
-#pointer APR_ANYADDR
+#globalarray APR_ANYADDR, CChar
 
 #num APR_SO_LINGER
 #num APR_SO_KEEPALIVE
index a8945238989c58bb8a53b841049333a45c5025eb..2383647acbdb4245a2f6fdba229ab4927445fc7e 100644 (file)
@@ -11,7 +11,7 @@ import Bindings.APR.Pools
 #globalvar apr_day_snames  , Ptr (Ptr CChar)
 
 #integral_t apr_time_t
-#pointer APR_TIME_T_FMT
+#globalarray APR_TIME_T_FMT, CChar
 
 #integral_t apr_interval_time_t
 #integral_t apr_short_interval_time_t
index 6f0015327b17ae60f3878c2b19d0719894e72d87..30df2abee677ec221006fe92ce81bce61b785af4 100644 (file)
@@ -10,8 +10,7 @@ module Bindings.APR.Version where
 
 #cinline APR_VERSION_AT_LEAST, CInt -> CInt -> CInt -> IO CInt
 
-#pointer APR_IS_DEV_STRING
-#pointer APR_VERSION_STRING
+#globalarray APR_VERSION_STRING, CChar
 
 #if !defined(APR_VERSION_ONLY)
 
index 4b18e60082e7339da8df3b1f50c22af2ced2ac94..60bbfe4c92e031213d21c37cd30dad28f12cc297 100644 (file)
@@ -66,12 +66,14 @@ Library
         Bindings.APR.Want
 
     C-Sources:
+        cbits/helper_apr.c
         cbits/helper_apr_errno.c
         cbits/helper_apr_general.c
         cbits/helper_apr_global_mutex.c
         cbits/helper_apr_pools.c
         cbits/helper_apr_lib.c
         cbits/helper_apr_mmap.c
+        cbits/helper_apr_network_io.c
         cbits/helper_apr_portable.c
         cbits/helper_apr_signal.c
         cbits/helper_apr_time.c
diff --git a/cbits/helper_apr.c b/cbits/helper_apr.c
new file mode 100644 (file)
index 0000000..b80cbaf
--- /dev/null
@@ -0,0 +1,13 @@
+#include <bindings.cmacros.h>
+#include <apr.h>
+
+BC_GLOBALARRAY(APR_SSIZE_T_FMT     , char)
+BC_GLOBALARRAY(APR_SIZE_T_FMT      , char)
+BC_GLOBALARRAY(APR_OFF_T_FMT       , char)
+BC_GLOBALARRAY(APR_PID_T_FMT       , char)
+BC_GLOBALARRAY(APR_INT64_T_FMT     , char)
+BC_GLOBALARRAY(APR_UINT64_T_FMT    , char)
+BC_GLOBALARRAY(APR_UINT64_T_HEX_FMT, char)
+
+BC_GLOBALARRAY(APR_EOL_STR         , char)
+BC_GLOBALARRAY(APR_DSOPATH         , char)
diff --git a/cbits/helper_apr_network_io.c b/cbits/helper_apr_network_io.c
new file mode 100644 (file)
index 0000000..9e6ea00
--- /dev/null
@@ -0,0 +1,4 @@
+#include <bindings.cmacros.h>
+#include <apr_network_io.h>
+
+BC_GLOBALARRAY(APR_ANYADDR, char)
index 9c22ba6f5167c9c987fb0206924e579c8220f132..6adb6cfeaf6276c246986c0b25e16c6205345600 100644 (file)
@@ -1,6 +1,8 @@
 #include <bindings.cmacros.h>
 #include <apr_time.h>
 
+BC_GLOBALARRAY(APR_TIME_T_FMT, char)
+
 BC_INLINE1(apr_time_sec , apr_time_t, apr_time_t)
 BC_INLINE1(apr_time_usec, apr_time_t, apr_time_t)
 BC_INLINE1(apr_time_msec, apr_time_t, apr_time_t)
index add2bdf2b134651e12a85a5ed2b3cfc4dc45d2c2..4ad07f891667c7295d4af6998241e2c75e3bd4da 100644 (file)
@@ -2,3 +2,5 @@
 #include <apr_version.h>
 
 BC_INLINE3(APR_VERSION_AT_LEAST, int, int, int, int)
+
+BC_GLOBALARRAY(APR_VERSION_STRING, char)