update to work with latest grpc

This commit is contained in:
Connor Clark 2016-04-19 10:20:02 -07:00
parent 17303329fb
commit 20693583d9
3 changed files with 24 additions and 26 deletions

View file

@ -1,11 +1,13 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
grpc_event *grpc_completion_queue_next_(grpc_completion_queue *cq, gpr_timespec *deadline) { grpc_event grpc_completion_queue_next_(grpc_completion_queue *cq,
grpc_completion_queue_next(cq, *deadline); gpr_timespec *deadline,
void *reserved) {
return grpc_completion_queue_next(cq, *deadline, reserved);
} }
grpc_event* grpc_completion_queue_pluck_(grpc_completion_queue *cq, void *tag, gpr_timespec *deadline) { grpc_event grpc_completion_queue_pluck_(grpc_completion_queue *cq, void *tag,
grpc_completion_queue_pluck(cq, tag, *deadline); gpr_timespec *deadline,
void *reserved) {
return grpc_completion_queue_pluck(cq, tag, *deadline, reserved);
} }

View file

@ -1,7 +1,7 @@
name: grpc-haskell name: grpc-haskell
version: 0.0.0.0 version: 0.0.0.0
synopsis: Haskell implementation of gRPC layered on shared C library. synopsis: Haskell implementation of gRPC layered on shared C library.
-- description: -- description:
homepage: http://github.com/aloiscochard/grpc-haskell homepage: http://github.com/aloiscochard/grpc-haskell
license: Apache-2.0 license: Apache-2.0
license-file: LICENSE license-file: LICENSE
@ -14,18 +14,18 @@ cabal-version: >=1.10
extra-source-files: cbits, include extra-source-files: cbits, include
library library
build-depends: build-depends:
base >=4.7 && <4.8 base
, clock >=0.4 && <0.5 , clock
c-sources: c-sources:
cbits/grpc_haskell.c cbits/grpc_haskell.c
exposed-modules: exposed-modules:
Network.GRPC.Core Network.GRPC.Core
Network.GRPC.Core.Constants Network.GRPC.Core.Constants
Network.GRPC.Core.Time Network.GRPC.Core.Time
extra-libraries: extra-libraries:
grpc grpc
includes: includes:
include/grpc_haskell.h include/grpc_haskell.h
, grpc/grpc.h , grpc/grpc.h
, grpc/status.h , grpc/status.h
@ -37,9 +37,9 @@ library
hs-source-dirs: src hs-source-dirs: src
test-suite test test-suite test
build-depends: build-depends:
base base
, QuickCheck >= 2.7 && < 2.8 , QuickCheck
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wall -fwarn-incomplete-patterns -O2 -threaded -rtsopts ghc-options: -Wall -fwarn-incomplete-patterns -O2 -threaded -rtsopts
hs-source-dirs: tests hs-source-dirs: tests

View file

@ -34,7 +34,6 @@ data Arg = Arg { argKey :: String, argValue :: ArgValue }
data ArgValue = ArgString String | ArgInt Int data ArgValue = ArgString String | ArgInt Int
{#enum grpc_call_error as CallError {underscoreToCase} deriving (Eq)#} {#enum grpc_call_error as CallError {underscoreToCase} deriving (Eq)#}
{#enum grpc_op_error as OpError {underscoreToCase} deriving (Eq)#}
{#pointer *grpc_byte_buffer as ByteBuffer newtype #} {#pointer *grpc_byte_buffer as ByteBuffer newtype #}
{#pointer *grpc_byte_buffer_reader as ByteBufferReader newtype #} {#pointer *grpc_byte_buffer_reader as ByteBufferReader newtype #}
@ -45,24 +44,21 @@ data ArgValue = ArgString String | ArgInt Int
{#pointer *grpc_op as Op newtype #} {#pointer *grpc_op as Op newtype #}
{#fun grpc_init as ^ {} -> `()'#} {#fun grpc_init as ^ {} -> `()'#}
{#fun grpc_shutdown as ^ {} -> `()'#} {#fun grpc_shutdown as ^ {} -> `()'#}
{#fun grpc_completion_queue_create as ^ {} -> `CompletionQueue'#} {#fun grpc_completion_queue_create as ^ {`Ptr ()'} -> `CompletionQueue'#}
{#fun grpc_completion_queue_next_ as ^ {`CompletionQueue', `CTimeSpecPtr'} -> `Event'#} {#fun grpc_completion_queue_next_ as ^ {`CompletionQueue', `CTimeSpecPtr'} -> `Event'#}
{#fun grpc_completion_queue_pluck_ as ^ {`CompletionQueue', `Ptr ()'} -> `Event'#} {#fun grpc_completion_queue_pluck_ as ^ {`CompletionQueue', `Ptr ()', `CTimeSpecPtr'} -> `Event'#}
{#fun grpc_event_finish as ^ {`Event'} -> `()'#}
{#fun grpc_completion_queue_shutdown as ^ {`CompletionQueue'} -> `()'#} {#fun grpc_completion_queue_shutdown as ^ {`CompletionQueue'} -> `()'#}
{#fun grpc_completion_queue_destroy as ^ {`CompletionQueue'} -> `()'#} {#fun grpc_completion_queue_destroy as ^ {`CompletionQueue'} -> `()'#}
{#fun grpc_channel_create_call_ as ^ {`Channel', `CompletionQueue', `String', `String', `CTimeSpecPtr'} -> `Call'#} {#fun grpc_channel_create_call_ as ^ {`Channel', `CompletionQueue', `String', `String', `CTimeSpecPtr'} -> `Call'#}
{#fun grpc_channel_create as ^ {`String', `ChannelArgsPtr'} -> `Channel'#} {#fun grpc_insecure_channel_create as ^ {`String', `ChannelArgsPtr', `Ptr ()'} -> `Channel'#}
{#fun grpc_channel_destroy as ^ {`Channel'} -> `()'#} {#fun grpc_channel_destroy as ^ {`Channel'} -> `()'#}
{#fun grpc_call_start_batch as ^ {`Call', `Op', `Int', `Ptr ()'} -> `CallError'#} {#fun grpc_call_start_batch as ^ {`Call', `Op', `Int', `Ptr ()', `Ptr ()'} -> `CallError'#}
{#fun grpc_call_cancel as ^ {`Call'} -> `()'#} {#fun grpc_call_cancel as ^ {`Call', `Ptr ()'} -> `()'#}
{#fun grpc_call_cancel_with_status as ^ {`Call', `StatusCode', `String'} -> `()'#} {#fun grpc_call_cancel_with_status as ^ {`Call', `StatusCode', `String', `Ptr ()'} -> `()'#}
{#fun grpc_call_destroy as ^ {`Call'} -> `()'#} {#fun grpc_call_destroy as ^ {`Call'} -> `()'#}