packages feed

ngx-export 1.4.0 → 1.4.1

raw patch · 3 files changed

+145/−45 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- NgxExport: newtype CInt :: *
+ NgxExport: newtype CInt
- NgxExport: newtype CUInt :: *
+ NgxExport: newtype CUInt
- NgxExport: ngxCachedTimePtr :: IO (Ptr ())
+ NgxExport: ngxCachedTimePtr :: IO (Ptr (Ptr ()))

Files

Changelog.md view
@@ -1,3 +1,7 @@+### 1.4.1++- Corrected type of *ngxCachedTimePtr*.+ ### 1.4.0  - Added a number of opaque pointers to Nginx global objects for using them in
NgxExport.hs view
@@ -19,7 +19,7 @@ module NgxExport (     -- * Type declarations                   ContentHandlerResult-                 ,UnsafeContentHandlerResult +                 ,UnsafeContentHandlerResult     -- * Exporters                  ,ngxExportSS                  ,ngxExportSSS@@ -170,8 +170,12 @@ ngxExportC = ngxExport' $ infixE (Just $ varE 'const) (varE '(.)) . Just . varE  -- | Exports a function of type--- /'String' -> 'String'/--- for using in directive /haskell_run/.+--+-- @+-- 'String' -> 'String'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportSS :: Name -> Q [Dec] ngxExportSS =     ngxExport 'SS 'sS@@ -179,8 +183,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'String' -> 'String' -> 'String'/--- for using in directive /haskell_run/.+--+-- @+-- 'String' -> 'String' -> 'String'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportSSS :: Name -> Q [Dec] ngxExportSSS =     ngxExport 'SSS 'sSS@@ -188,8 +196,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /['String'] -> 'String'/--- for using in directive /haskell_run/.+--+-- @+-- ['String'] -> 'String'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportSLS :: Name -> Q [Dec] ngxExportSLS =     ngxExport 'SLS 'sLS@@ -197,8 +209,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'String' -> 'Bool'/--- for using in directive /haskell_run/.+--+-- @+-- 'String' -> 'Bool'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportBS :: Name -> Q [Dec] ngxExportBS =     ngxExport 'BS 'bS@@ -206,8 +222,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'String' -> 'String' -> 'Bool'/--- for using in directive /haskell_run/.+--+-- @+-- 'String' -> 'String' -> 'Bool'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportBSS :: Name -> Q [Dec] ngxExportBSS =     ngxExport 'BSS 'bSS@@ -215,8 +235,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /['String'] -> 'Bool'/--- for using in directive /haskell_run/.+--+-- @+-- ['String'] -> 'Bool'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportBLS :: Name -> Q [Dec] ngxExportBLS =     ngxExport 'BLS 'bLS@@ -224,8 +248,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'L.ByteString'/--- for using in directive /haskell_run/.+--+-- @+-- 'B.ByteString' -> 'L.ByteString'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportYY :: Name -> Q [Dec] ngxExportYY =     ngxExport 'YY 'yY@@ -234,8 +262,12 @@        Ptr (StablePtr L.ByteString) -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'Bool'/--- for using in directive /haskell_run/.+--+-- @+-- 'B.ByteString' -> 'Bool'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportBY :: Name -> Q [Dec] ngxExportBY =     ngxExport 'BY 'bY@@ -243,8 +275,12 @@        Ptr CString -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'IO' 'L.ByteString'/--- for using in directive /haskell_run/.+--+-- @+-- 'B.ByteString' -> 'IO' 'L.ByteString'+-- @+--+-- for using in directive __/haskell_run/__. ngxExportIOYY :: Name -> Q [Dec] ngxExportIOYY =     ngxExportC 'IOYY 'ioyY@@ -253,8 +289,12 @@        Ptr (StablePtr L.ByteString) -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'IO' 'L.ByteString'/--- for using in directive /haskell_run_async/.+--+-- @+-- 'B.ByteString' -> 'IO' 'L.ByteString'+-- @+--+-- for using in directive __/haskell_run_async/__. ngxExportAsyncIOYY :: Name -> Q [Dec] ngxExportAsyncIOYY =     ngxExportC 'IOYY 'asyncIOYY@@ -263,9 +303,13 @@        Ptr CUInt -> Ptr (StablePtr L.ByteString) -> IO (StablePtr (Async ()))|]  -- | Exports a function of type--- /'L.ByteString' -> 'B.ByteString' -> 'IO' 'L.ByteString'/--- for using in directive /haskell_run_async_on_request_body/. --+-- @+-- 'L.ByteString' -> 'B.ByteString' -> 'IO' 'L.ByteString'+-- @+--+-- for using in directive __/haskell_run_async_on_request_body/__.+-- -- The first argument of the exported function contains buffers of the client -- request body. ngxExportAsyncOnReqBody :: Name -> Q [Dec]@@ -277,9 +321,13 @@        Ptr CUInt -> Ptr (StablePtr L.ByteString) -> IO (StablePtr (Async ()))|]  -- | Exports a function of type--- /'B.ByteString' -> 'Bool' -> 'IO' 'L.ByteString'/--- for using in directive /haskell_run_service/. --+-- @+-- 'B.ByteString' -> 'Bool' -> 'IO' 'L.ByteString'+-- @+--+-- for using in directive __/haskell_run_service/__.+-- -- The boolean argument of the exported function marks that the service is -- being run for the first time. ngxExportServiceIOYY :: Name -> Q [Dec]@@ -290,8 +338,13 @@        Ptr CUInt -> Ptr (StablePtr L.ByteString) -> IO (StablePtr (Async ()))|]  -- | Exports a function of type--- /'B.ByteString' -> 'ContentHandlerResult'/--- for using in directives /haskell_content/ and /haskell_static_content/.+--+-- @+-- 'B.ByteString' -> 'ContentHandlerResult'+-- @+--+-- for using in directives __/haskell_content/__ and+-- __/haskell_static_content/__. ngxExportHandler :: Name -> Q [Dec] ngxExportHandler =     ngxExport 'Handler 'handler@@ -300,8 +353,13 @@        Ptr (StablePtr L.ByteString) -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'L.ByteString'/--- for using in directives /haskell_content/ and /haskell_static_content/.+--+-- @+-- 'B.ByteString' -> 'L.ByteString'+-- @+--+-- for using in directives __/haskell_content/__ and+-- __/haskell_static_content/__. ngxExportDefHandler :: Name -> Q [Dec] ngxExportDefHandler =     ngxExport 'YY 'defHandler@@ -310,8 +368,12 @@        Ptr (StablePtr L.ByteString) -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'UnsafeContentHandlerResult'/--- for using in directive /haskell_unsafe_content/.+--+-- @+-- 'B.ByteString' -> 'UnsafeContentHandlerResult'+-- @+--+-- for using in directive __/haskell_unsafe_content/__. ngxExportUnsafeHandler :: Name -> Q [Dec] ngxExportUnsafeHandler =     ngxExport 'UnsafeHandler 'unsafeHandler@@ -319,8 +381,12 @@        Ptr CString -> Ptr CSize -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> 'IO' 'ContentHandlerResult'/--- for using in directive /haskell_async_content/.+--+-- @+-- 'B.ByteString' -> 'IO' 'ContentHandlerResult'+-- @+--+-- for using in directive __/haskell_async_content/__. ngxExportAsyncHandler :: Name -> Q [Dec] ngxExportAsyncHandler =     ngxExport 'AsyncHandler 'asyncHandler@@ -330,9 +396,13 @@        Ptr CUInt -> Ptr (StablePtr L.ByteString) -> IO (StablePtr (Async ()))|]  -- | Exports a function of type--- /'L.ByteString' -> 'B.ByteString' -> 'IO' 'ContentHandlerResult'/--- for using in directive /haskell_async_content_on_request_body/. --+-- @+-- 'L.ByteString' -> 'B.ByteString' -> 'IO' 'ContentHandlerResult'+-- @+--+-- for using in directive __/haskell_async_content_on_request_body/__.+-- -- The first argument of the exported function contains buffers of the client -- request body. ngxExportAsyncHandlerOnReqBody :: Name -> Q [Dec]@@ -345,8 +415,12 @@        Ptr CUInt -> Ptr (StablePtr L.ByteString) -> IO (StablePtr (Async ()))|]  -- | Exports a function of type--- /'B.ByteString' -> 'IO' 'L.ByteString'/--- for using in directive /haskell_service_hook/.+--+-- @+-- 'B.ByteString' -> 'IO' 'L.ByteString'+-- @+--+-- for using in directive __/haskell_service_hook/__. ngxExportServiceHook :: Name -> Q [Dec] ngxExportServiceHook =     ngxExportC 'IOYY 'ioyYWithFree@@ -782,19 +856,41 @@     foldM (\k (I v) -> pokeElemOff x k v >> return (k + 1)) 0         (take n $ versionBranch version) --- | Returns an opaque pointer to the Nginx cycle object+-- | Returns an opaque pointer to the Nginx /cycle object/ -- for using it in C plugins.+--+-- Actual type of the returned pointer is+--+-- > ngx_cycle_t *+--+-- (value of argument __/cycle/__ in the worker's initialization function). ngxCyclePtr :: IO (Ptr ()) ngxCyclePtr = readIORef ngxCyclePtrStore --- | Returns an opaque pointer to the Nginx upstream main configuration+-- | Returns an opaque pointer to the Nginx /upstream main configuration/ -- for using it in C plugins.+--+-- Actual type of the returned pointer is+--+-- > ngx_http_upstream_main_conf_t *+--+-- (value of expression+--+-- >     ngx_http_cycle_get_module_main_conf(cycle, ngx_http_upstream_module))+--+-- in the worker's initialization function). ngxUpstreamMainConfPtr :: IO (Ptr ()) ngxUpstreamMainConfPtr = readIORef ngxUpstreamMainConfPtrStore --- | Returns an opaque pointer to the Nginx cached time object+-- | Returns an opaque pointer to the Nginx /cached time object/ -- for using it in C plugins.-ngxCachedTimePtr :: IO (Ptr ())+--+-- Actual type of the returned pointer is+--+-- > volatile ngx_time_t **+--+-- (/address/ of the Nginx global variable __/ngx_cached_time/__).+ngxCachedTimePtr :: IO (Ptr (Ptr ())) ngxCachedTimePtr = readIORef ngxCachedTimePtrStore  foreign export ccall ngxExportSetCyclePtr :: Ptr () -> IO ()@@ -805,8 +901,8 @@ ngxExportSetUpstreamMainConfPtr :: Ptr () -> IO () ngxExportSetUpstreamMainConfPtr = writeIORef ngxUpstreamMainConfPtrStore -foreign export ccall ngxExportSetCachedTimePtr :: Ptr () -> IO ()-ngxExportSetCachedTimePtr :: Ptr () -> IO ()+foreign export ccall ngxExportSetCachedTimePtr :: Ptr (Ptr ()) -> IO ()+ngxExportSetCachedTimePtr :: Ptr (Ptr ()) -> IO () ngxExportSetCachedTimePtr = writeIORef ngxCachedTimePtrStore  ngxCyclePtrStore :: IORef (Ptr ())@@ -817,7 +913,7 @@ ngxUpstreamMainConfPtrStore = unsafePerformIO $ newIORef nullPtr {-# NOINLINE ngxUpstreamMainConfPtrStore #-} -ngxCachedTimePtrStore :: IORef (Ptr ())+ngxCachedTimePtrStore :: IORef (Ptr (Ptr ())) ngxCachedTimePtrStore = unsafePerformIO $ newIORef nullPtr {-# NOINLINE ngxCachedTimePtrStore #-} 
ngx-export.cabal view
@@ -1,5 +1,5 @@ name:                       ngx-export-version:                    1.4.0+version:                    1.4.1 synopsis:                   Helper module for Nginx haskell module description:                Helper module for         <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>